Issue #1592 - Part 2: Parse ::slotted() pseudo-element as if it were a pseudo-class

- Block slot elements from being matched by ::slotted
- Ensure ::slotted() is serialized as a pseudo-element
- Add pref to control whether the pseudo-class is enabled
This commit is contained in:
FranklinDM 2023-03-18 09:36:25 +08:00 committed by roytam1
commit 77ad970db6
8 changed files with 81 additions and 3 deletions

View file

@ -106,7 +106,8 @@ bool
nsCSSPseudoClasses::HasSingleSelectorArg(Type aType)
{
return aType == Type::host ||
aType == Type::hostContext;
aType == Type::hostContext ||
aType == Type::slotted;
}
bool
@ -126,7 +127,8 @@ nsCSSPseudoClasses::HasSelectorListArg(Type aType)
aType == Type::mozAny ||
aType == Type::mozAnyPrivate ||
aType == Type::host ||
aType == Type::hostContext;
aType == Type::hostContext ||
aType == Type::slotted;
}
bool
@ -169,3 +171,9 @@ nsCSSPseudoClasses::IsUserActionPseudoClass(Type aType)
aType == Type::active ||
aType == Type::focus;
}
/* static */ bool
nsCSSPseudoClasses::IsHybridPseudoElement(Type aType)
{
return aType == Type::slotted;
}