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

@ -915,6 +915,11 @@ nsCSSSelector::AppendToStringWithoutCombinatorsOrNegations
// Append each pseudo-class in the linked list
for (nsPseudoClassList* list = mPseudoClassList; list; list = list->mNext) {
// Serialize pseudo-elements that were treated as if they were a
// pseudo-class to the two colon syntax.
if (nsCSSPseudoClasses::IsHybridPseudoElement(list->mType)) {
aString.Append(char16_t(':'));
}
nsCSSPseudoClasses::PseudoTypeToString(list->mType, temp);
// This should not be escaped since (a) the pseudo-class string
// has a ":" that can't be escaped and (b) all pseudo-classes at