mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 11:57:32 +09:00
Bug 1411878 - Support Element.shadowRoot and Element.assignedSlot / TextNode.assignedSlot on closed shadow root
Tag #1375
This commit is contained in:
parent
67c4d022dc
commit
31b26a24e3
8 changed files with 67 additions and 11 deletions
|
|
@ -152,6 +152,36 @@ nsIContent::FindFirstNonChromeOnlyAccessContent() const
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-slotable-assignedslot
|
||||
HTMLSlotElement*
|
||||
nsIContent::GetAssignedSlotByMode() const
|
||||
{
|
||||
/**
|
||||
* Get slotable's assigned slot for the result of
|
||||
* find a slot with open flag UNSET [1].
|
||||
*
|
||||
* [1] https://dom.spec.whatwg.org/#assign-a-slot
|
||||
*/
|
||||
HTMLSlotElement* slot = GetAssignedSlot();
|
||||
if (!slot) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(GetParent());
|
||||
MOZ_ASSERT(GetParent()->GetShadowRoot());
|
||||
|
||||
/**
|
||||
* Additional check for open flag SET:
|
||||
* If slotable’s parent’s shadow root's mode is not "open",
|
||||
* then return null.
|
||||
*/
|
||||
if (GetParent()->GetShadowRoot()->IsClosed()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return slot;
|
||||
}
|
||||
|
||||
nsINode*
|
||||
nsIContent::GetFlattenedTreeParentNodeInternal(FlattenedParentType aType) const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue