mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 14:58:37 +09:00
Issue #1593 - Follow-up: Accept only a single selector in the argument of :host/:host-context
Current spec says these two pseudo-classes accept only a single compound selector: :host( <compound-selector> ) :host-context( <compound-selector> )
This commit is contained in:
parent
0391e8ab09
commit
9037d5662d
3 changed files with 13 additions and 0 deletions
|
|
@ -6552,6 +6552,11 @@ CSSParserImpl::ParsePseudoClassWithSelectorListArg(nsCSSSelector& aSelector,
|
|||
return eSelectorParsingStatus_Error; // our caller calls SkipUntil(')')
|
||||
}
|
||||
|
||||
if (nsCSSPseudoClasses::HasSingleSelectorArg(aType) &&
|
||||
slist->mNext) {
|
||||
return eSelectorParsingStatus_Error; // our caller calls SkipUntil(')')
|
||||
}
|
||||
|
||||
for (nsCSSSelectorList *l = slist; l; l = l->mNext) {
|
||||
nsCSSSelector *s = l->mSelectors;
|
||||
if (s == nullptr) {
|
||||
|
|
|
|||
|
|
@ -102,6 +102,13 @@ nsCSSPseudoClasses::HasNthPairArg(Type aType)
|
|||
aType == Type::nthLastOfType;
|
||||
}
|
||||
|
||||
bool
|
||||
nsCSSPseudoClasses::HasSingleSelectorArg(Type aType)
|
||||
{
|
||||
return aType == Type::host ||
|
||||
aType == Type::hostContext;
|
||||
}
|
||||
|
||||
void
|
||||
nsCSSPseudoClasses::PseudoTypeToString(Type aType, nsAString& aString)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ public:
|
|||
static Type GetPseudoType(nsIAtom* aAtom, EnabledState aEnabledState);
|
||||
static bool HasStringArg(Type aType);
|
||||
static bool HasNthPairArg(Type aType);
|
||||
static bool HasSingleSelectorArg(Type aType);
|
||||
static bool HasForgivingSelectorListArg(Type aType) {
|
||||
return aType == Type::is ||
|
||||
aType == Type::matches ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue