Custom element a with slot attribute who has a parent without a matching slot tag breaks viewing of descendants in the inspector
Categories
(DevTools :: Inspector, defect, P3)
Tracking
(firefox68 fixed)
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: michael.england, Assigned: jdescottes)
References
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15
Steps to reproduce:
It seems you can't inspect a custom element's children or shadow root when there is a child custom element that wants to be slotted to a non-existenting slot tag. We ran into this scenario because we have a few layout elements that will render a slot depending on some state of the component. Here's a jsfiddle demonstrating the behavior: https://jsfiddle.net/michael_england/25dsnk48/
1.) Create two custom elements such as the following:
customElements.define('my-first-element', class extends HTMLElement {
connectedCallback() {
this.attachShadow({mode: 'open'})
this.shadowRoot.innerHTML = '<div>foo-bar, I can't be found in dev tools</div>'
}
});
customElements.define('my-second-element', class extends HTMLElement {
connectedCallback() {
this.attachShadow({mode: 'open'})
this.shadowRoot.innerHTML = '<div>second-element</slot.'
}
});
2.) Compose them like:
<my-first-element>
<my-second-element slot="non-existing-slot"></my-second-element>
</my-first-element>
3.) Open inspector
4.) Can't view descendants or shadow root of my-first-element
Actual results:
You can't view descendants or shadow root of my-first-element
Expected results:
You should be able to view children and shadow root.
@jdescottes I am told you will know what is going on here.
Assignee | ||
Comment 2•7 years ago
|
||
Thanks for the report, will take a look!
Assignee | ||
Comment 3•7 years ago
|
||
Except for rawParentNode, all consumers of getDocumentWalker should be ok with this fallback.
Comment 5•7 years ago
|
||
bugherder |
Reporter | ||
Comment 6•7 years ago
|
||
I'm wondering if the changes have a shared code path with WebDriver/Selenium, or if there is a way to find out if it does? Our QE has tests that fail unless we remove the offending child element or we run the test using the nightly (FF68), which has this fix. If it does have a shared path, anyway we can get this back ported to 65? Thanks!
Description
•