<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>27757</bug_id>
          
          <creation_ts>2015-01-05 21:23:37 +0000</creation_ts>
          <short_desc>[Shadow]: how is the autofocus attribute supposed to be handled?</short_desc>
          <delta_ts>2015-05-27 03:02:19 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - Component Model</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>26365</dependson>
          <blocked>28552</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Rodney Rehm">mail</reporter>
          <assigned_to name="Hayato Ito">hayato</assigned_to>
          <cc>annevk</cc>
    
    <cc>hayato</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>116805</commentid>
    <comment_count>0</comment_count>
    <who name="Rodney Rehm">mail</who>
    <bug_when>2015-01-05 21:23:37 +0000</bug_when>
    <thetext>The section &quot;6.2 Focus Navigation&quot; [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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116809</commentid>
    <comment_count>1</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2015-01-06 01:03:17 +0000</bug_when>
    <thetext>See also bug 26365.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116872</commentid>
    <comment_count>2</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2015-01-07 04:37:59 +0000</bug_when>
    <thetext>To be clear, because the Shadow DOM spec doesn&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116878</commentid>
    <comment_count>3</comment_count>
    <who name="Rodney Rehm">mail</who>
    <bug_when>2015-01-07 08:21:06 +0000</bug_when>
    <thetext>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&apos;t change current meaning, but make things a bit more clear (for authors, I guess)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119515</commentid>
    <comment_count>4</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2015-04-15 06:30:18 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120511</commentid>
    <comment_count>5</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2015-05-27 03:02:19 +0000</bug_when>
    <thetext>Moved to https://github.com/w3c/webcomponents/issues/97</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>