You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The section "6.2 Focus Navigation" [1] does not specify how the autofocus attribute [2] is to be handled if set on an element within a ShadowRoot.
As of now Chrome and Firefox consider all elements at page load, including the ones in ShadowRoots when looking for an element with autofocus. That, however, is not the behavior I expected from an encapsulated DOM. What I expected is the same behavior the dialog element presents in showModal in steps 8 - 10 [3].
Is it possible to add a note to the focus section saying that autofocus behavior should be the same as if the element with autofocus was a member of the document instead of a ShadowRoot? That wouldn't change current meaning, but make things a bit more clear (for authors, I guess)
I think there is no action item for the spec, as of now. If someone think that autofocus attribute in shadow trees should be honored, please reopen this issue.
Title: [Shadow]: how is the autofocus attribute supposed to be handled? (bugzilla: 27757)
Migrated from: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27757
comment: 0
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27757#c0
Rodney Rehm wrote on 2015-01-05 21:23:37 +0000.
The section "6.2 Focus Navigation" [1] does not specify how the autofocus attribute [2] is to be handled if set on an element within a ShadowRoot.
As of now Chrome and Firefox consider all elements at page load, including the ones in ShadowRoots when looking for an element with autofocus. That, however, is not the behavior I expected from an encapsulated DOM. What I expected is the same behavior the dialog element presents in showModal in steps 8 - 10 [3].
[1] http://w3c.github.io/webcomponents/spec/shadow/#focus-navigation
[2] http://www.w3.org/html/wg/drafts/html/master/forms.html#autofocusing-a-form-control:-the-autofocus-attribute
[3] http://www.w3.org/html/wg/drafts/html/master/interactive-elements.html#dom-dialog-showmodal
comment: 1
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27757#c1
Hayato Ito wrote on 2015-01-06 01:03:17 +0000.
See also bug 26365.
comment: 2
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27757#c2
Hayato Ito wrote on 2015-01-07 04:37:59 +0000.
To be clear, because the Shadow DOM spec doesn't override how autofocus works at all, the current behavior of Blink looks against the spec.
autofocus is also on the radar on bug 26365.
comment: 3
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27757#c3
Rodney Rehm wrote on 2015-01-07 08:21:06 +0000.
Is it possible to add a note to the focus section saying that autofocus behavior should be the same as if the element with autofocus was a member of the document instead of a ShadowRoot? That wouldn't change current meaning, but make things a bit more clear (for authors, I guess)
comment: 4
comment_url: https://www.w3.org/Bugs/Public/show_bug.cgi?id=27757#c4
Hayato Ito wrote on 2015-04-15 06:30:18 +0000.
Yes, we can.
Looks the autofocus was mentioned at b9f45ee. However, there is no mention at Focus Navigation section.
We have to fix somehow.
The text was updated successfully, but these errors were encountered: