HTML Standard Tracker

Filter

File a bug

SVNBugCommentTime (UTC)
2804Handle elements losing focus when they are hidden, etc.2009-02-13 01:09
@@ -38248,21 +38248,22 @@ explain that only direct children of the <menu> matter
      <li><code>input</code> elements whose <code
      title="attr-input-type">type</code> attribute is in the <span
      title="attr-input-type-submit">Submit Button</span>, <span
      title="attr-input-type-image">Image Button</span>, <span
      title="attr-input-type-reset">Reset Button</span>, or <span
      title="attr-input-type-button">Button</span> state</li>
 
      <li><code>command</code> elements that do not have a <code
      title="attr-command-disabled">disabled</code> attribute</li>
 
-     <li>any other element, if it is <span>focusable</span></li>
+     <li>any other element, if it is <span>specially
+     focusable</span></li>
 
     </ul>
 
     <p class="example">For example, if the user is using a keyboard to
     push a <code>button</code> element by pressing the space bar, the
     element would match this pseudo-class in between the time that the
     element received the <code title="event-keydown">keydown</code>
     event and the time the element received the <code
     title="event-keyup">keyup</code> event.</p>
 
@@ -38311,21 +38312,22 @@ explain that only direct children of the <menu> matter
      <li><code>command</code> elements that do not have a <code
      title="attr-command-disabled">disabled</code> attribute</li>
 
      <li><code>li</code> elements that are children of
      <code>menu</code> elements, and that have a child element that
      defines a <span title="concept-command">command</span>, if the
      first such element's <span
      title="command-facet-disabledstate">Disabled State</span> facet
      is false (not disabled)</li>
 
-     <li>any other element, if it is <span>focusable</span></li>
+     <li>any other element, if it is <span>specially
+     focusable</span></li>
 
     </ul>
 
    </dd>
 
 
    <dt><dfn title="selector-disabled"><code>:disabled</code></dfn></dt>
 
    <dd>
 
@@ -48606,36 +48608,81 @@ at the first element with the given ID must be treated as if it was cloned and r
      greater than the value of the <code
      title="attr-tabindex">tabindex</code> attribute on the
      element.</li>
 
     </ul>
 
    </dd>
 
   </dl>
 
-  <p>An element is <dfn>focusable</dfn> if the <code
+  <p>An element is <dfn>specially focusable</dfn> if the <code
   title="attr-tabindex">tabindex</code> attribute's definition above
-  defines the element to be focusable <em>and</em> the element is
-  <span>being rendered</span><!-- XXX xref, define display:none as not
-  being rendered, off-screen as being rendered? -->.</p>
+  defines the element to be focusable.</p>
 
-  <p>An element that is <span>focusable</span> but does not otherwise
-  have an <span>activation behavior</span> defined has an
+  <p>An element that is <span>specially focusable</span> but does not
+  otherwise have an <span>activation behavior</span> defined has an
   <span>activation behavior</span> that does nothing.</p>
 
   <p class="note">This means that an element that is only focusable
   because of its <code title="attr-tabindex">tabindex</code> attribute
   will fire a <code title="event-click">click</code> event in response
   to a non-mouse activation (e.g. hitting the "enter" key while the
   element is focused).</p>
 
+  <p>An element is <dfn>focusable</dfn> if the user agent's default
+  behavior allows it to be focusable or if the element is
+  <span>specially focusable</span>, but only if the element is
+  <span>being rendered</span><!-- XXX xref, define display:none,
+  orphan nodes as not being rendered, off-screen as being rendered?
+  -->.</p>
+
+  <p>User agents should make the following elements
+  <span>focusable</span>, unless platform conventions dictate
+  otherwise:</p>
+
+  <ul>
+
+   <li><code>a</code> elements that have an <code
+   title="attr-hyperlink-href">href</code> attribute</li>
+
+   <li class="XXX"><code>area</code> elements that have an <code
+   title="attr-hyperlink-href">href</code> attribute</li> <!-- should
+   define the behavior in the face of multiple images and in the face
+   of no images -->
+
+   <li><code>link</code> elements that have an <code
+   title="attr-link-href">href</code> attribute</li>
+
+   <li><code>bb</code> elements whose <code
+   title="attr-bb-type">type</code> attribute is in a state whose
+   <i>relevance</i> is true</li>
+
+   <li><code>button</code> elements that are not <span
+   title="concept-fe-disabled">disabled</span></li>
+
+   <li><code>input</code> elements whose <code
+   title="attr-input-type">type</code> attribute are not in the
+   <span title="attr-input-type-hidden">Hidden</span> state and that
+   are not <span title="concept-fe-disabled">disabled</span></li>
+
+   <li><code>select</code> elements that are not <span
+   title="concept-fe-disabled">disabled</span></li>
+
+   <li><code>textarea</code> elements that are not <span
+   title="concept-fe-disabled">disabled</span></li>
+
+   <li><code>command</code> elements that do not have a <code
+   title="attr-command-disabled">disabled</code> attribute</li>
+
+  </ul>
+
   <p>The <dfn title="dom-tabIndex"><code>tabIndex</code></dfn> DOM
   attribute must <span>reflect</span> the value of the <code
   title="attr-tabindex">tabindex</code> content attribute. If the
   attribute is not present, or parsing its value returns an error,
   then the DOM attribute must return 0 for elements that are focusable
   and &#x2212;1 for elements that are not focusable.</p>
 
 
   <h4 id="focus-management">Focus management</h4>
 
@@ -48686,23 +48733,33 @@ at the first element with the given ID must be treated as if it was cloned and r
    <span>broadcast <code title="event-formchange">formchange</code>
    events</span> at the element's <span>form owner</span>.</p>
 
    <li><p>Unfocus the element.</p></li>
 
    <li><p><span>Fire a simple event</span> that doesn't bubble called
    <code title="event-blur">blur</code> at the element.</p></li>
 
   </ol>
 
-  <p>User agents should run the <span>unfocusing steps</span> for an
-  element whenever the user moves the focus away from any
-  <span>focusable</span> element.</p>
+  <p>When the user moves the focus away from a <span>focusable</span>
+  element, the user agent should run the <span>unfocusing steps</span>
+  that element.</p>
+
+  <p>When an element that is focused stops being a
+  <span>focusable</span> element, the user agent should run the
+  <span>unfocusing steps</span> that element.</p>
+
+  <p class="example">For example, this might happen because the
+  element is removed from its <code>Document</code>, or has a <code
+  title="attr-hidden">hidden</code> attribute added. It would also
+  happen to an <code>input</code> element when the element gets <span
+  title="concept-fe-disabled">disabled</span>.</p>
 
 
   <h4>Document-level focus APIs</h4>
 
   <p>The <dfn
   title="dom-document-activeElement"><code>activeElement</code></dfn>
   attribute on <code>DocumentHTML</code> objects must return the
   element in the document that is focused. If no element in the
   <code>Document</code> is focused, this must return <span>the body
   element</span>.</p>

|