getShadowRoot command returns user agent shadow roots
Categories
(Remote Protocol :: Marionette, defect, P2)
Tracking
(firefox150 fixed)
| Tracking | Status | |
|---|---|---|
| firefox150 | --- | fixed |
People
(Reporter: jdescottes, Assigned: jdescottes)
References
(Blocks 1 open bug)
Details
(Whiteboard: [webdriver:m19][webdriver:relnote])
Attachments
(1 external file, 1 obsolete file)
The WebDriver classic https://www.w3.org/TR/webdriver2/#get-element-shadow-root get element shadow root method relies on https://searchfox.org/firefox-main/rev/d5fa7178279c137900f4d0c46793e5ec1df3fb1b/remote/shared/DOM.sys.mjs#1081-1087
dom.getShadowRoot = function (el) {
const shadowRoot = el.openOrClosedShadowRoot;
if (!shadowRoot) {
throw new lazy.error.NoSuchShadowRootError();
}
return shadowRoot;
};
This helper doesn't check if the shadow root is a UA shadowroot or not, so it will leak UA shadowroots, eg when called on a <select> element.
| Assignee | ||
Updated•9 months ago
|
| Assignee | ||
Updated•9 months ago
|
Comment 1•9 months ago
|
||
FYI on bug 2016673 a check for shadowRoot.isUAWidget() was added which can be done here as well.
| Assignee | ||
Comment 2•9 months ago
|
||
I was writing a test for this, but weirdly enough, Chrome also returns a shadow root eg for a "select".
With BiDi they don't seem to return shadow roots for select elements, so not sure what's different here, but I think we should at least check on the spec side.
Might just do a PR on wpt to discuss that.
| Assignee | ||
Comment 3•9 months ago
|
||
(In reply to Henrik Skupin [:whimboo][⌚️UTC+1] (away from Feb 12th - Feb 22nd) from comment #1)
FYI on bug 2016673 a check for
shadowRoot.isUAWidget()was added which can be done here as well.
Yes it's in see also already, that's what prompted to file this bug.
| Assignee | ||
Comment 4•9 months ago
|
||
Filed an issue on the classic spec and PR for WPT
https://github.com/w3c/webdriver/issues/1948
https://github.com/web-platform-tests/wpt/pull/57823
| Assignee | ||
Comment 5•9 months ago
|
||
Updated•9 months ago
|
| Assignee | ||
Comment 6•9 months ago
|
||
Also created a PR at https://github.com/web-platform-tests/wpt/pull/57823
to discuss with the group.
Should land either the PR or this patch.
Updated•8 months ago
|
Comment 8•8 months ago
|
||
| bugherder | ||
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Updated•7 months ago
|
Description
•