-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Should delegatesFocus use the flat tree? #7207
Comments
@mfreed7, do you find the arguments here convincing? I think we should probably use the shadow tree instead of the flat tree, for both |
Yeah, I do find them a bit convincing. But as I mentioned, I'd feel better getting some input from developers that use Absent any such developer input, I suppose I could be convinced by the above arguments. I do think it sounds a bit funny to focus light dom slotted content. So if we're in a hurry to resolve this one way or the other, I'm ok changing Chromium's |
I'm not on a massive rush other than "the longer we wait to change this, the easier it is for people to depend on it" |
Trying to get developer feedback seems fair. I think you're more connected to the web components developer-using community than I am these days, so could you take point on that? Edit: I also tweeted, to do my part :) https://twitter.com/domenic/status/1450919182850211849 I don't think we're in a big hurry, but it does stand out as a wart. And I got the impression it was hurting Firefox's progress on shipping some stuff? |
I'm my limited experience using WCs, this change seems to make sense and is in line with other isolation models. If I want to focus/blur some slotted content I should be able to do that regardless of the shadow DOM by keeping a reference to the slotted light DOM. I see |
This changes makes sense to me. I've only dabbled with |
Just one data point but I have used it a fair amount and was under the impression that the proposed behavior was already how it worked. I either got lucky and just never had slots prior to the first in-shadow focusable or possibly just learned I have some bugs I don't know about! |
Seems there's no great compelling argument for the current behavior then... I'm happy to update the WPTs and Gecko. @domenic can / do you want to fix the spec? It'd probably take me a bit more than you, but if you're busy I can try :-) |
https://bugzilla.mozilla.org/show_bug.cgi?id=1737020 has a patch + tests |
Sure, I'm happy to fix the spec. I will do it by expanding the scope of #7079. |
Thanks for tweeting, @domenic. Based on seemingly universal support for not including slotted content, I also agree. Let's land it. Thanks, I appreciate you gathering some additional input! |
This behavior is much more reasonable and aligns with developers expectations better, see whatwg/html#7207. Differential Revision: https://phabricator.services.mozilla.com/D129146 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1737020 gecko-commit: e41c536602c68eb6ad42e53e0d2a7f7a4209931e gecko-reviewers: smaug, sefeng
…n the flat tree. r=smaug,sefeng This behavior is much more reasonable and aligns with developers expectations better, see whatwg/html#7207. Differential Revision: https://phabricator.services.mozilla.com/D129146
This behavior is much more reasonable and aligns with developers expectations better, see whatwg/html#7207. Differential Revision: https://phabricator.services.mozilla.com/D129146 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1737020 gecko-commit: e41c536602c68eb6ad42e53e0d2a7f7a4209931e gecko-reviewers: smaug, sefeng
…n the flat tree. r=smaug,sefeng This behavior is much more reasonable and aligns with developers expectations better, see whatwg/html#7207. Differential Revision: https://phabricator.services.mozilla.com/D129146
This behavior is much more reasonable and aligns with developers expectations better, see whatwg/html#7207. Differential Revision: https://phabricator.services.mozilla.com/D129146 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1737020 gecko-commit: e41c536602c68eb6ad42e53e0d2a7f7a4209931e gecko-reviewers: smaug, sefeng
* Make it use the shadow tree instead of the flat tree. Closes whatwg#7207. * Make it work with the unfocusing steps symmetrically to the focusing steps. Closes whatwg#7070.
9ba7124 updated delegatesFocus to use the shadow tree, as part of whatwg#7207. However we forgot to update the autofocus="" processing in the same way.
* Make it use the shadow tree instead of the flat tree. Closes whatwg#7207. * Make it work with the unfocusing steps symmetrically to the focusing steps. Closes whatwg#7070.
9ba7124 updated delegatesFocus to use the shadow tree, as part of whatwg#7207. However we forgot to update the autofocus="" processing in the same way.
See discussion in #7079. Including the effects of that PR, focusing and unfocusing (e.g. via
focus()
andblur()
) a delegatesFocus shadow host uses the flat tree: giventhe
<div tabindex=0>In light tree</div>
will be focused, and if you inserthost.blur()
afterward, the div will be blurred.@emilio states
which I tend to agree with. Recall that the main use cases for delegatesFocus are things like
<input type="date">
where you want to focus things in the shadow DOM, not the light DOM.The alternate proposal is that delegatesFocus should use the shadow tree. In this case, in the above example, the
<div tabindex=0>In shadow tree</div>
would get focus delegated to it, anddocument.activeElement
would be the shadow host, and:focus
would match the host.The text was updated successfully, but these errors were encountered: