mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-05 23:07:31 +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
|
|
@ -1104,6 +1104,25 @@ Element::GetSlot(nsAString& aName)
|
|||
GetAttr(kNameSpaceID_None, nsGkAtoms::slot, aName);
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-element-shadowroot
|
||||
ShadowRoot*
|
||||
Element::GetShadowRootByMode() const
|
||||
{
|
||||
/**
|
||||
* 1. Let shadow be context object’s shadow root.
|
||||
* 2. If shadow is null or its mode is "closed", then return null.
|
||||
*/
|
||||
ShadowRoot* shadowRoot = GetShadowRoot();
|
||||
if (!shadowRoot || shadowRoot->IsClosed()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 3. Return shadow.
|
||||
*/
|
||||
return shadowRoot;
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-element-attachshadow
|
||||
already_AddRefed<ShadowRoot>
|
||||
Element::AttachShadow(const ShadowRootInit& aInit, ErrorResult& aError)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue