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

[Shadow]: how is the autofocus attribute supposed to be handled? (bugzilla: 27757) #97

Closed
hayatoito opened this issue May 25, 2015 · 1 comment

Comments

@hayatoito
Copy link
Contributor

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.

@hayatoito
Copy link
Contributor Author

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.

hayatoito added a commit that referenced this issue Jun 4, 2015
…because it is not defined in Focus Navigation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants