@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?
Readonly attribute?
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).
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.
I guess the attribute shouldn't be harmful, even if if wasn't used frequently.
Yeah looks like this was added in the initial impl of delegatesFocus but wasn't part of the explainer. Sounds reasonable to keep around.
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.
I noticed this today as well, so I sent https://github.com/whatwg/dom/pull/974 + https://github.com/web-platform-tests/wpt/pull/28593, and I've filed https://github.com/whatwg/dom/issues/975 about making the attribute mutable.
This has been implemented in WebKit as of https://trac.webkit.org/r276585
Yay, thanks @rniwa!
Most helpful comment
This has been implemented in WebKit as of https://trac.webkit.org/r276585