mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-20 19:33:08 +09:00
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:
parent
ab63b7b946
commit
77ad970db6
8 changed files with 81 additions and 3 deletions
|
|
@ -1963,6 +1963,29 @@ static bool SelectorMatches(Element* aElement,
|
|||
}
|
||||
break;
|
||||
|
||||
case CSSPseudoClassType::slotted:
|
||||
{
|
||||
// Slot elements cannot be matched.
|
||||
if (aElement->IsHTMLElement(nsGkAtoms::slot)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// The current element must have an assigned slot.
|
||||
if (!aElement->GetAssignedSlot()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
NodeMatchContext nodeContext(EventStates(),
|
||||
aNodeMatchContext.mIsRelevantLink);
|
||||
if (!SelectorListMatches(aElement,
|
||||
pseudoClass,
|
||||
nodeContext,
|
||||
aTreeMatchContext)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CSSPseudoClassType::host:
|
||||
{
|
||||
ShadowRoot* shadow = aElement->GetShadowRoot();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue