Closed Bug 1411878 Opened 2 years ago Closed 2 years ago

Support Element.shadowRoot and Element.assignedSlot / TextNode.assignedSlot on shadow root of closed mode

Categories

(Core :: DOM: Core & HTML, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: ben.tian, Assigned: ben.tian)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file, 1 obsolete file)

Attribute getters to revise if shadow root mode is 'closed':

- Element.shadowRoot returns null
  https://dom.spec.whatwg.org/#dom-element-shadowroot

- Element.assignedSlot / TextNode.assignedSlot returns null
  https://dom.spec.whatwg.org/#dom-slotable-assignedslot
Depends on: 1404842, 1408341
(In reply to Ben Tian [:btian] from comment #0)
> Attribute getters to revise if shadow root mode is 'closed':
> 
> - Element.shadowRoot returns null
>   https://dom.spec.whatwg.org/#dom-element-shadowroot
> 
> - Element.assignedSlot / TextNode.assignedSlot returns null
>   https://dom.spec.whatwg.org/#dom-slotable-assignedslot

Also Event.composedPath() for events associated with elements inside the shadow DOM, returns []
https://dom.spec.whatwg.org/#dom-event-composedpath
WIP patch for following getters. The patch renames getters with [BinaryName] to avoid method name conflict with existing ones.

> - Element.shadowRoot returns null
>   https://dom.spec.whatwg.org/#dom-element-shadowroot
> 
> - Element.assignedSlot / TextNode.assignedSlot returns null
>   https://dom.spec.whatwg.org/#dom-slotable-assignedslot
Assignee: nobody → btian
Attachment #8922665 - Attachment is obsolete: true
(In reply to Ben Tian [:btian] from comment #1)
> (In reply to Ben Tian [:btian] from comment #0)
> > Attribute getters to revise if shadow root mode is 'closed':
> > 
> > - Element.shadowRoot returns null
> >   https://dom.spec.whatwg.org/#dom-element-shadowroot
> > 
> > - Element.assignedSlot / TextNode.assignedSlot returns null
> >   https://dom.spec.whatwg.org/#dom-slotable-assignedslot

For this bug I'll land closed shadow root support for above getters first, and leave support for Event.composedPath either in bug 1412775 or a follow-up bug.

Rename bug title accordingly.

> Also Event.composedPath() for events associated with elements inside the
> shadow DOM, returns []
> https://dom.spec.whatwg.org/#dom-event-composedpath
Summary: Support operations on shadow root of closed mode → Support Element.shadowRoot and Element.assignedSlot / TextNode.assignedSlot on shadow root of closed mode
Attachment #8923673 - Flags: review?(mrbkap)
Priority: -- → P2
Comment on attachment 8923673 [details]
Bug 1411878 - Support Element.shadowRoot and Element.assignedSlot / TextNode.assignedSlot on closed shadow root

https://reviewboard.mozilla.org/r/194796/#review202628
Attachment #8923673 - Flags: review?(mrbkap) → review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/c13b0d4625b7
Support Element.shadowRoot and Element.assignedSlot / TextNode.assignedSlot on closed shadow root r=mrbkap
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/c13b0d4625b7
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
I've documented this by making sure the "Value" sections of the following pages include useful information about when the getters might return null:

https://developer.mozilla.org/en-US/docs/Web/API/Element/shadowRoot
https://developer.mozilla.org/en-US/docs/Web/API/Slotable/assignedSlot
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.