Skip to content

Commit

Permalink
[e] (0) Clean up the term 'specially focusable' and the requirements …
Browse files Browse the repository at this point in the history
…around it so that it all makes more sense. In particular, clarify that 'being rendered' is a prerequisite to being focusable even if you have tabindex='' set.

Affected topics: HTML

git-svn-id: http://svn.whatwg.org/webapps@7005 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 22, 2012
1 parent beaee03 commit 4d88aaf
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 128 deletions.
88 changes: 46 additions & 42 deletions complete.html
Expand Up @@ -56642,7 +56642,7 @@ <h4 id=pseudo-classes><span class=secno>4.14.2 </span>Pseudo-classes</h4>

<li><code><a href=#the-command-element>command</a></code> elements that do not have a <code title=attr-command-disabled><a href=#attr-command-disabled>disabled</a></code> attribute</li>

<li>elements that are <a href=#specially-focusable>specially focusable</a></li>
<li>elements that have their <a href=#specially-focusable>tabindex focus flag</a> set</li>

</ul><p class=example>For example, if the user is using a keyboard
to push a <code><a href=#the-button-element>button</a></code> element by pressing the space bar,
Expand Down Expand Up @@ -71101,9 +71101,10 @@ <h3 id=focus><span class=secno>8.3 </span>Focus</h3>
<h4 id=sequential-focus-navigation-and-the-tabindex-attribute><span class=secno>8.3.1 </span>Sequential focus navigation and the <code title=attr-tabindex><a href=#attr-tabindex>tabindex</a></code> attribute</h4>

<p>The <dfn id=attr-tabindex title=attr-tabindex><code>tabindex</code></dfn>
content attribute specifies whether the element is focusable,
whether it can be reached using sequential focus navigation, and the
relative order of the element for the purposes of sequential focus
content attribute allows authors to control whether an element is
supposed to be focusable, whether it is supposed to be reachable
using sequential focus navigation, and what is to be the relative
order of the element for the purposes of sequential focus
navigation. The name "tab index" comes from the common use of the
"tab" key to navigate through the focusable elements. The term
"tabbing" refers to moving forward through the focusable elements
Expand All @@ -71115,6 +71116,11 @@ <h4 id=sequential-focus-navigation-and-the-tabindex-attribute><span class=secno>

<div class=impl>

<p>Each element has a <dfn id=specially-focusable>tabindex focus
flag</dfn>. This flag is a factor that contributes towards
determining whether an element is <a href=#focusable>focusable</a>, as
described in the next section.</p>

<p>If the attribute is specified, it must be parsed using the
<a href=#rules-for-parsing-integers>rules for parsing integers</a>. The attribute's values have
the following meanings:</p>
Expand All @@ -71124,25 +71130,26 @@ <h4 id=sequential-focus-navigation-and-the-tabindex-attribute><span class=secno>

<dd>

<p>The user agent should follow platform conventions to determine if
the element is to be focusable and, if so, whether the element can
be reached using sequential focus navigation, and if so, what its
relative order should be.</p>
<p>The user agent should follow platform conventions to determine
if the element's <a href=#specially-focusable>tabindex focus flag</a> is set and, if
so, whether the element can be reached using sequential focus
navigation, and if so, what its relative order should be.</p>

<p class=note>One valid reason to ignore the platform
conventions and always allow an element to be focused would be if
the user's only mechanism for activating an element is through a
keyboard action that triggers the focused element.</p>
conventions and always allow an element to be focused (by setting
its <a href=#specially-focusable>tabindex focus flag</a>) would be if the user's only
mechanism for activating an element is through a keyboard action
that triggers the focused element.</p>

</dd>

<dt id=negative-tabindex>If the value is a negative integer</dt>

<dd>

<p>The user agent must allow the element to be focused, but should
not allow the element to be reached using sequential focus
navigation.</p>
<p>The user agent must set the element's <a href=#specially-focusable>tabindex focus
flag</a>, but should not allow the element to be reached using
sequential focus navigation.</p>

<p class=note>One valid reason to ignore the requirement that
sequential focus navigation not allow the author to lead to the
Expand All @@ -71158,26 +71165,26 @@ <h4 id=sequential-focus-navigation-and-the-tabindex-attribute><span class=secno>

<dd>

<p>The user agent must allow the element to be focused, should
allow the element to be reached using sequential focus navigation,
and should follow platform conventions to determine the element's
relative order.</p>
<p>The user agent must set the element's <a href=#specially-focusable>tabindex focus
flag</a>, should allow the element to be reached using
sequential focus navigation, and should follow platform
conventions to determine the element's relative order.</p>

</dd>

<dt>If the value is greater than zero</dt>

<dd>

<p>The user agent must allow the element to be focused, should
allow the element to be reached using sequential focus navigation,
and should place the element in the sequential focus navigation
order so that it is:</p>
<p>The user agent must set the element's <a href=#specially-focusable>tabindex focus
flag</a>, should allow the element to be reached using
sequential focus navigation, and should place the element in the
sequential focus navigation order so that it is:</p>

<ul><li>before any focusable element whose <code title=attr-tabindex><a href=#attr-tabindex>tabindex</a></code> attribute has been
omitted or whose value, when parsed, returns an error,</li>
<ul><li>before any <a href=#focusable>focusable</a> element whose <code title=attr-tabindex><a href=#attr-tabindex>tabindex</a></code> attribute has been omitted
or whose value, when parsed, returns an error,</li>

<li>before any focusable element whose <code title=attr-tabindex><a href=#attr-tabindex>tabindex</a></code> attribute has a value equal
<li>before any <a href=#focusable>focusable</a> element whose <code title=attr-tabindex><a href=#attr-tabindex>tabindex</a></code> attribute has a value equal
to or less than zero,</li>

<li>after any element whose <code title=attr-tabindex><a href=#attr-tabindex>tabindex</a></code> attribute has a value
Expand All @@ -71200,12 +71207,9 @@ <h4 id=sequential-focus-navigation-and-the-tabindex-attribute><span class=secno>

</ul></dd>

</dl><p>An element is <dfn id=specially-focusable>specially focusable</dfn> if the <code title=attr-tabindex><a href=#attr-tabindex>tabindex</a></code> attribute's definition above
defines the element to be focusable.</p>

<p>An element that is <a href=#specially-focusable>specially focusable</a> but does not
otherwise have an <a href=#activation-behavior>activation behavior</a> defined has an
<a href=#activation-behavior>activation behavior</a> that does nothing.</p>
</dl><p>An element that has its <a href=#specially-focusable>tabindex focus flag</a> set but
does not otherwise have an <a href=#activation-behavior>activation behavior</a> defined
has an <a href=#activation-behavior>activation behavior</a> that does nothing.</p>

<p class=note>This means that an element that is only focusable
because of its <code title=attr-tabindex><a href=#attr-tabindex>tabindex</a></code> attribute
Expand All @@ -71227,15 +71231,15 @@ <h4 id=sequential-focus-navigation-and-the-tabindex-attribute><span class=secno>
<h4 id=focus-management><span class=secno>8.3.2 </span>Focus management</h4>

<p>An element is <dfn id=focusable>focusable</dfn> if the user agent's default
behavior allows it to be focusable or if the element is
<a href=#specially-focusable>specially focusable</a>, but only if the element is either
<a href=#being-rendered>being rendered</a> or <!-- CANVAS-FOCUS-FALLBACK --> is a
descendant of a <code><a href=#the-canvas-element>canvas</a></code> element that
behavior allows it to be focusable or if the element has its
<a href=#specially-focusable>tabindex focus flag</a> set, but only if the element is
either <a href=#being-rendered>being rendered</a> or <!-- CANVAS-FOCUS-FALLBACK -->
is a descendant of a <code><a href=#the-canvas-element>canvas</a></code> element that
<a href=#represents>represents</a> <a href=#embedded-content>embedded content</a>.</p>

<p>User agents should make the following elements
<a href=#focusable>focusable</a>, unless platform conventions dictate
otherwise:</p>
<a href=#focusable>focusable</a> as part of their default behavior, unless
platform conventions dictate otherwise:</p>

<ul><li><code><a href=#the-a-element>a</a></code> elements that have an <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> attribute</li>

Expand Down Expand Up @@ -71270,9 +71274,9 @@ <h4 id=focus-management><span class=secno>8.3.2 </span>Focus management</h4>
reused with multiple images on a page.)</p>

<p>The user agent may also make part of a <code><a href=#the-details-element>details</a></code>
element's rendering focusable, to enable the element to be opened or
closed using keyboard input. However, this is distinct from the
<code><a href=#the-details-element>details</a></code> or <code><a href=#the-summary-element>summary</a></code> element being
element's rendering <a href=#focusable>focusable</a>, to enable the element to
be opened or closed using keyboard input. However, this is distinct
from the <code><a href=#the-details-element>details</a></code> or <code><a href=#the-summary-element>summary</a></code> element being
focusable.</p>

<hr><p>The <dfn id=focusing-steps>focusing steps</dfn> are as follows:</p>
Expand All @@ -71281,8 +71285,8 @@ <h4 id=focus-management><span class=secno>8.3.2 </span>Focus management</h4>
<code>Document</code></a>, or if the element's
<code><a href=#document>Document</a></code> has no <a href=#browsing-context>browsing context</a>, or if
the element's <code><a href=#document>Document</a></code>'s <a href=#browsing-context>browsing context</a>
has no <a href=#top-level-browsing-context>top-level browsing context</a>, then abort these
steps.</p>
has no <a href=#top-level-browsing-context>top-level browsing context</a>, or if the element
is not <a href=#focusable>focusable</a>, then abort these steps.</p>

<li><p>If focusing the element will remove the focus from another
element, then run the <a href=#unfocusing-steps>unfocusing steps</a> for that
Expand Down

0 comments on commit 4d88aaf

Please sign in to comment.