Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShadowRoot's delegatesFocus #931

Closed
annevk opened this issue Dec 9, 2020 · 9 comments · Fixed by #974
Closed

ShadowRoot's delegatesFocus #931

annevk opened this issue Dec 9, 2020 · 9 comments · Fixed by #974
Labels
good first issue Ideal for someone new to a WHATWG standard or software project topic: shadow Relates to shadow trees (as defined in DOM)

Comments

@annevk
Copy link
Member

annevk commented Dec 9, 2020

@sideshowbarker discovered that Chrome exposes delegatesFocus on ShadowRoot. This hasn't really appeared in any specification as far as I can tell (e.g., dglazkov-era's https://www.w3.org/TR/2015/WD-shadow-dom-20151215/#the-shadowroot-interface doesn't have it), but given that we expose other state that can be set when creating a shadow root, such as mode, it might well be reasonable to add.

@rniwa @smaug---- @rakina thoughts?

@annevk annevk added topic: shadow Relates to shadow trees (as defined in DOM) needs implementer interest Moving the issue forward requires implementers to express interest labels Dec 9, 2020
@rniwa
Copy link
Collaborator

rniwa commented Dec 9, 2020

Readonly attribute?

@sideshowbarker
Copy link
Contributor

Readonly attribute?

I assume so (and so it wouldn't require more than fairly minimal changes to the spec, to essentially just expose the value of the internal flag which is already there).

@annevk
Copy link
Member Author

annevk commented Dec 9, 2020

https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/dom/shadow_root.idl has readonly attribute boolean delegatesFocus; which is what you'd expect here.

@smaug----
Copy link
Collaborator

I guess the attribute shouldn't be harmful, even if if wasn't used frequently.

@annevk annevk added good first issue Ideal for someone new to a WHATWG standard or software project and removed needs implementer interest Moving the issue forward requires implementers to express interest labels Dec 10, 2020
@rakina
Copy link
Member

rakina commented Dec 10, 2020

Yeah looks like this was added in the initial impl of delegatesFocus but wasn't part of the explainer. Sounds reasonable to keep around.

ddbeck pushed a commit to mdn/browser-compat-data that referenced this issue Dec 10, 2020
This change marks ShadowRoot.prototype.delegatesFocus standard_track:false
and deprecated:true. https://dom.spec.whatwg.org/#interface-shadowroot
doesn’t actually define any such exposed property — neither for
ShadowRoot nor for the interfaces it inherits from.

Blink/Chrome does expose such a property, but that’s not due to any
actual spec requirements.

Related:
mdn/sprints#3917
whatwg/dom#931
@rniwa
Copy link
Collaborator

rniwa commented Dec 10, 2020

I'll be in the favor for adding this readonly attribute to make the API more interoperable. I don't think trying to remove it in Blink is productive course of action given there isn't really a downside to it.

Tangentially, maybe we should make it writeable. There isn't much downside to making it possible to update this flag after shadow root creation but we should probably track that in a separate issue once this is addressed.

@foolip
Copy link
Member

foolip commented Apr 20, 2021

I noticed this today as well, so I sent #974 + web-platform-tests/wpt#28593, and I've filed #975 about making the attribute mutable.

@rniwa
Copy link
Collaborator

rniwa commented Apr 26, 2021

This has been implemented in WebKit as of https://trac.webkit.org/r276585

@foolip
Copy link
Member

foolip commented Apr 26, 2021

Yay, thanks @rniwa!

sideshowbarker added a commit to w3c/browser-compat-data that referenced this issue Apr 27, 2021
whatwg/dom#974 added ShadowRoot.prototype.delegatesFocus
to the DOM spec (see whatwg/dom@f346858). And
per whatwg/dom#931 (comment)
(https://trac.webkit.org/r276585) it’s been implemented in WebKit.

So given that now it’s part of the DOM standard, and implemented in multiple
browsers, this changes resets the BCD status flags for it.
sideshowbarker added a commit to w3c/browser-compat-data that referenced this issue Apr 27, 2021
whatwg/dom#974 added ShadowRoot.prototype.delegatesFocus
to the DOM spec (see whatwg/dom@f346858). And
per whatwg/dom#931 (comment)
(https://trac.webkit.org/r276585) it’s been implemented in WebKit.

So given that it’s now part of the DOM standard, and implemented in multiple
browsers, this changes resets the BCD status flags for it.
sideshowbarker added a commit to w3c/browser-compat-data that referenced this issue Apr 27, 2021
whatwg/dom#974 added ShadowRoot.prototype.delegatesFocus
to the DOM spec (see whatwg/dom@f346858). And
per whatwg/dom#931 (comment)
(https://trac.webkit.org/r276585) it’s been implemented in WebKit.

So given that it’s now part of the DOM standard, and implemented in multiple
browsers, this change resets the BCD status flags for it.
sideshowbarker added a commit to mdn/content that referenced this issue Apr 27, 2021
whatwg/dom#974 added ShadowRoot.prototype.delegatesFocus
to the DOM spec (see whatwg/dom@f346858). And
per whatwg/dom#931 (comment)
(https://trac.webkit.org/r276585) it’s been implemented in WebKit.

So given that it’s now part of the DOM standard, and implemented in multiple
browsers, this change drops the Deprecated_Header macro from the source — as
well as fixing the spec URL.
sideshowbarker added a commit to mdn/content that referenced this issue Apr 27, 2021
whatwg/dom#974 added ShadowRoot.prototype.delegatesFocus
to the DOM spec (see whatwg/dom@f346858). And
per whatwg/dom#931 (comment)
(https://trac.webkit.org/r276585) it’s been implemented in WebKit.

So given that it’s now part of the DOM standard, and implemented in multiple
browsers, this change drops the Deprecated_Header macro from the source — as
well as fixing the spec URL.

Related BCD change: mdn/browser-compat-data#10102
sideshowbarker added a commit to w3c/browser-compat-data that referenced this issue Apr 27, 2021
whatwg/dom#974 added ShadowRoot.prototype.delegatesFocus
to the DOM spec (see whatwg/dom@f346858). And
per whatwg/dom#931 (comment)
(https://trac.webkit.org/r276585) it’s been implemented in WebKit.

So given that it’s now part of the DOM standard, and implemented in multiple
browsers, this change resets the BCD status flags for it.

Related MDN change: mdn/content#4508
foolip pushed a commit to mdn/browser-compat-data that referenced this issue Apr 27, 2021
whatwg/dom#974 added ShadowRoot.prototype.delegatesFocus
to the DOM spec (see whatwg/dom@f346858). And
per whatwg/dom#931 (comment)
(https://trac.webkit.org/r276585) it’s been implemented in WebKit.

So given that it’s now part of the DOM standard, and implemented in multiple
browsers, this change resets the BCD status flags for it.

Related MDN change: mdn/content#4508
Elchi3 pushed a commit to mdn/content that referenced this issue Apr 27, 2021
whatwg/dom#974 added ShadowRoot.prototype.delegatesFocus
to the DOM spec (see whatwg/dom@f346858). And
per whatwg/dom#931 (comment)
(https://trac.webkit.org/r276585) it’s been implemented in WebKit.

So given that it’s now part of the DOM standard, and implemented in multiple
browsers, this change drops the Deprecated_Header macro from the source — as
well as fixing the spec URL.

Related BCD change: mdn/browser-compat-data#10102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Ideal for someone new to a WHATWG standard or software project topic: shadow Relates to shadow trees (as defined in DOM)
Development

Successfully merging a pull request may close this issue.

6 participants