Skip to content
Permalink
Browse files
[giow] (1) Change autofocus='' to only focus the first control seen w…
…ith the attribute (per document).

git-svn-id: http://svn.whatwg.org/webapps@5222 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jul 29, 2010
1 parent 2a30fba commit 6d25f4285beaf723d622af23b7c5925ec92df622
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 47 deletions.
@@ -44617,7 +44617,7 @@ <h5 id=autofocusing-a-form-control><span class=secno>4.10.19.4 </span>Autofocusi
<!-- v2: Apply this to contentEditable elements -->

<p>The <dfn id=attr-fe-autofocus title=attr-fe-autofocus><code>autofocus</code></dfn>
content attribute allows the user to indicate that a control is to
content attribute allows the author to indicate that a control is to
be focused as soon as the page is loaded, allowing the user to just
start typing without having to manually focus the main control.</p>

@@ -44630,24 +44630,33 @@ <h5 id=autofocusing-a-form-control><span class=secno>4.10.19.4 </span>Autofocusi

<div class=impl>

<p>Whenever an element with the <code title=attr-fe-autofocus><a href=#attr-fe-autofocus>autofocus</a></code> attribute specified is
<p>When an element with the <code title=attr-fe-autofocus><a href=#attr-fe-autofocus>autofocus</a></code> attribute specified is
<a href=#insert-an-element-into-a-document title="insert an element into a document">inserted into a
document</a> whose <a href=#browsing-context>browsing context</a> did not have the
<a href=#sandboxed-automatic-features-browsing-context-flag>sandboxed automatic features browsing context flag</a> set
when the <code><a href=#document>Document</a></code> was created, the user agent should
<a href=#queue-a-task>queue a task</a> that checks to see if the element is
<a href=#focusable>focusable</a>, and if so, runs the <a href=#focusing-steps>focusing
steps</a> for that element. User agents may also change the
scrolling position of the document, or perform some other action
that brings the element to the user's attention. The <a href=#task-source>task
source</a> for this task is the <a href=#dom-manipulation-task-source>DOM manipulation task
source</a>.</p>
document</a>, user agents should run the following steps:</p>~

<ol><li><p>If the <code><a href=#document>Document</a></code>'s <a href=#browsing-context>browsing context</a>
had the <a href=#sandboxed-automatic-features-browsing-context-flag>sandboxed automatic features browsing context
flag</a> set when the <code><a href=#document>Document</a></code> was created, abort
these steps.</li>

<li><p>If the user agent has already reached the last step of this
list of steps in response to an element being <a href=#insert-an-element-into-a-document title="insert
an element into a document">inserted</a> into this
<code><a href=#document>Document</a></code>, abort these steps.</li>

<li><p>If the user has indicated (for example, by starting to type
in a form control) that he does not wish focus to be changed, then
optionally abort these steps.</li>

<p>User agents may ignore this attribute if the user has indicated
(for example, by starting to type in a form control) that he does
not wish focus to be changed.</p>
<li><p><a href=#queue-a-task>Queue a task</a> that checks to see if the element
is <a href=#focusable>focusable</a>, and if so, runs the <a href=#focusing-steps>focusing
steps</a> for that element. User agents may also change the
scrolling position of the document, or perform some other action
that brings the element to the user's attention. The <a href=#task-source>task
source</a> for this task is the <a href=#dom-manipulation-task-source>DOM manipulation task
source</a>.</li>

<p class=note>Focusing the control does not imply that the user
</ol><p class=note>Focusing the control does not imply that the user
agent must focus the browser window if it has lost focus.</p>

<p>The <dfn id=dom-fe-autofocus title=dom-fe-autofocus><code>autofocus</code></dfn>
41 index
@@ -44544,7 +44544,7 @@ out of 233&thinsp;257&thinsp;824 bytes available&lt;/meter&gt;&lt;/p&gt;</pre>
<!-- v2: Apply this to contentEditable elements -->

<p>The <dfn id=attr-fe-autofocus title=attr-fe-autofocus><code>autofocus</code></dfn>
content attribute allows the user to indicate that a control is to
content attribute allows the author to indicate that a control is to
be focused as soon as the page is loaded, allowing the user to just
start typing without having to manually focus the main control.</p>

@@ -44557,24 +44557,33 @@ out of 233&thinsp;257&thinsp;824 bytes available&lt;/meter&gt;&lt;/p&gt;</pre>

<div class=impl>

<p>Whenever an element with the <code title=attr-fe-autofocus><a href=#attr-fe-autofocus>autofocus</a></code> attribute specified is
<p>When an element with the <code title=attr-fe-autofocus><a href=#attr-fe-autofocus>autofocus</a></code> attribute specified is
<a href=#insert-an-element-into-a-document title="insert an element into a document">inserted into a
document</a> whose <a href=#browsing-context>browsing context</a> did not have the
<a href=#sandboxed-automatic-features-browsing-context-flag>sandboxed automatic features browsing context flag</a> set
when the <code><a href=#document>Document</a></code> was created, the user agent should
<a href=#queue-a-task>queue a task</a> that checks to see if the element is
<a href=#focusable>focusable</a>, and if so, runs the <a href=#focusing-steps>focusing
steps</a> for that element. User agents may also change the
scrolling position of the document, or perform some other action
that brings the element to the user's attention. The <a href=#task-source>task
source</a> for this task is the <a href=#dom-manipulation-task-source>DOM manipulation task
source</a>.</p>
document</a>, user agents should run the following steps:</p>~

<ol><li><p>If the <code><a href=#document>Document</a></code>'s <a href=#browsing-context>browsing context</a>
had the <a href=#sandboxed-automatic-features-browsing-context-flag>sandboxed automatic features browsing context
flag</a> set when the <code><a href=#document>Document</a></code> was created, abort
these steps.</li>

<li><p>If the user agent has already reached the last step of this
list of steps in response to an element being <a href=#insert-an-element-into-a-document title="insert
an element into a document">inserted</a> into this
<code><a href=#document>Document</a></code>, abort these steps.</li>

<li><p>If the user has indicated (for example, by starting to type
in a form control) that he does not wish focus to be changed, then
optionally abort these steps.</li>

<p>User agents may ignore this attribute if the user has indicated
(for example, by starting to type in a form control) that he does
not wish focus to be changed.</p>
<li><p><a href=#queue-a-task>Queue a task</a> that checks to see if the element
is <a href=#focusable>focusable</a>, and if so, runs the <a href=#focusing-steps>focusing
steps</a> for that element. User agents may also change the
scrolling position of the document, or perform some other action
that brings the element to the user's attention. The <a href=#task-source>task
source</a> for this task is the <a href=#dom-manipulation-task-source>DOM manipulation task
source</a>.</li>

<p class=note>Focusing the control does not imply that the user
</ol><p class=note>Focusing the control does not imply that the user
agent must focus the browser window if it has lost focus.</p>

<p>The <dfn id=dom-fe-autofocus title=dom-fe-autofocus><code>autofocus</code></dfn>
43 source
@@ -49956,7 +49956,7 @@ out of 233&#x2009;257&#x2009;824 bytes available&lt;/meter>&lt;/p></pre>
<!-- v2: Apply this to contentEditable elements -->

<p>The <dfn title="attr-fe-autofocus"><code>autofocus</code></dfn>
content attribute allows the user to indicate that a control is to
content attribute allows the author to indicate that a control is to
be focused as soon as the page is loaded, allowing the user to just
start typing without having to manually focus the main control.</p>

@@ -49969,23 +49969,36 @@ out of 233&#x2009;257&#x2009;824 bytes available&lt;/meter>&lt;/p></pre>

<div class="impl">

<p>Whenever an element with the <code
<p>When an element with the <code
title="attr-fe-autofocus">autofocus</code> attribute specified is
<span title="insert an element into a document">inserted into a
document</span> whose <span>browsing context</span> did not have the
<span>sandboxed automatic features browsing context flag</span> set
when the <code>Document</code> was created, the user agent should
<span>queue a task</span> that checks to see if the element is
<span>focusable</span>, and if so, runs the <span>focusing
steps</span> for that element. User agents may also change the
scrolling position of the document, or perform some other action
that brings the element to the user's attention. The <span>task
source</span> for this task is the <span>DOM manipulation task
source</span>.</p>
document</span>, user agents should run the following steps:</p>~

<ol>

<li><p>If the <code>Document</code>'s <span>browsing context</span>
had the <span>sandboxed automatic features browsing context
flag</span> set when the <code>Document</code> was created, abort
these steps.</p></li>

<p>User agents may ignore this attribute if the user has indicated
(for example, by starting to type in a form control) that he does
not wish focus to be changed.</p>
<li><p>If the user agent has already reached the last step of this
list of steps in response to an element being <span title="insert
an element into a document">inserted</span> into this
<code>Document</code>, abort these steps.</p></li>

<li><p>If the user has indicated (for example, by starting to type
in a form control) that he does not wish focus to be changed, then
optionally abort these steps.</p></li>

<li><p><span>Queue a task</span> that checks to see if the element
is <span>focusable</span>, and if so, runs the <span>focusing
steps</span> for that element. User agents may also change the
scrolling position of the document, or perform some other action
that brings the element to the user's attention. The <span>task
source</span> for this task is the <span>DOM manipulation task
source</span>.</p></li>

</ol>

<p class="note">Focusing the control does not imply that the user
agent must focus the browser window if it has lost focus.</p>

0 comments on commit 6d25f42

Please sign in to comment.