This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27757 - [Shadow]: how is the autofocus attribute supposed to be handled?
Summary: [Shadow]: how is the autofocus attribute supposed to be handled?
Status: RESOLVED MOVED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Hayato Ito
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on: 26365
Blocks: 28552
  Show dependency treegraph
 
Reported: 2015-01-05 21:23 UTC by Rodney Rehm
Modified: 2015-05-27 03:02 UTC (History)
4 users (show)

See Also:


Attachments

Description Rodney Rehm 2015-01-05 21:23:37 UTC
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 Hayato Ito 2015-01-06 01:03:17 UTC
See also bug 26365.
Comment 2 Hayato Ito 2015-01-07 04:37:59 UTC
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 Rodney Rehm 2015-01-07 08:21:06 UTC
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 Hayato Ito 2015-04-15 06:30:18 UTC
Yes, we can.
Looks the autofocus was mentioned at https://github.com/w3c/webcomponents/commit/b9f45ee237536f461a0526c1c0b070ac63c1ce6b. However, there is no mention at Focus Navigation section.

We have to fix somehow.
Comment 5 Hayato Ito 2015-05-27 03:02:19 UTC
Moved to https://github.com/w3c/webcomponents/issues/97