Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[] (0) WF2: Define the autofocus='' attribute. Define generic task so…
…urces.

git-svn-id: http://svn.whatwg.org/webapps@2218 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 19, 2008
1 parent 9e8af46 commit 8d20641
Show file tree
Hide file tree
Showing 2 changed files with 198 additions and 30 deletions.
129 changes: 105 additions & 24 deletions index
Expand Up @@ -1416,6 +1416,10 @@
contexts</a>

<li><a href="#event0"><span class=secno>5.4.2 </span>Event loops</a>
<ul class=toc>
<li><a href="#generic"><span class=secno>5.4.2.1. </span>Generic
task sources</a>
</ul>

<li><a href="#security4"><span class=secno>5.4.3 </span>Security
exceptions</a>
Expand Down Expand Up @@ -5689,7 +5693,7 @@
incrementally, as, for instance, with a progressively interlaced JPEG or
an HTML file, multiple tasks may be queued to process the data as it is
downloaded. The <a href="#task-source">task source</a> for these tasks
is the <dfn id=networking>networking task source</dfn>.</p>
is the <a href="#networking">networking task source</a>.</p>
<!-- XXX make sure each use of 'fetch' defines what the appropriate
task is -->

Expand Down Expand Up @@ -7288,7 +7292,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
void <a href="#document.write" title=dom-document-write>write</a>([Variadic] in DOMString text);
void <a href="#document.writeln..." title=dom-document-writeln>writeln</a>([Variadic] in DOMString text);

// <a href="#user-interaction">user interaction</a>
// <a href="#user-interaction0">user interaction</a>
<a href="#selection1">Selection</a> <a href="#getselection0" title=dom-document-getSelection>getSelection</a>();
readonly attribute <span>Element</span> <a href="#activeelement" title=dom-document-activeElement>activeElement</a>;
boolean <a href="#hasfocus" title=dom-document-hasFocus>hasFocus</a>();
Expand Down Expand Up @@ -7874,7 +7878,7 @@ http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C%21DOCTYPE%20html%3E..
readonly attribute <a href="#domtokenlist0">DOMTokenList</a> <a href="#classlist" title=dom-classList>classList</a>;
readonly attribute <a href="#domstringmap0">DOMStringMap</a> <a href="#dataset" title=dom-dataset>dataset</a>;

// <a href="#user-interaction">user interaction</a>
// <a href="#user-interaction0">user interaction</a>
attribute boolean <a href="#hidden5" title=dom-hidden>hidden</a>;
void <a href="#click1" title=dom-click>click</a>();
void <a href="#scrollintoview" title=dom-scrollIntoView>scrollIntoView</a>();
Expand Down Expand Up @@ -30827,12 +30831,49 @@ interface <dfn id=htmloptionelement>HTMLOptionElement</dfn> : <a href="#htmlelem
<h5 id=autofocusing><span class=secno>4.10.13.4. </span>Autofocusing a form
control</h5>

<p class=big-issue>... <dfn id=autofocus
title=attr-fe-autofocus>autofocus</dfn> content attribute
<p>The <dfn id=autofocus
title=attr-fe-autofocus><code>autofocus</code></dfn> content attribute
allows the user 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>The <code title=attr-fe-autofocus><a
href="#autofocus">autofocus</a></code> attribute is a <a
href="#boolean0">boolean attribute</a>.

<p>There must not be more than one element in the document with the <code
title=attr-fe-autofocus><a href="#autofocus">autofocus</a></code>
attribute specified.

<p>Whenever an element with the <code title=attr-fe-autofocus><a
href="#autofocus">autofocus</a></code> attribute specified is <a
href="#inserted" title="insert an element into a document">inserted into a
document</a>, the user agent should <a href="#queue">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">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">DOM manipulation task source</a>.

<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 class=note>Focusing the control does not imply that the user agent must
focus the browser window if it has lost focus.

<p>The <dfn id=autofocus0
title=dom-fe-autofocus><code>autofocus</code></dfn> DOM attribute must <a
href="#reflect">reflect</a> the content attribute of the same name.

<div class=example>
<p>In the following snippet, the text control would be focused when the
document was loaded.</p>

<p class=big-issue>... <dfn id=autofocus0
title=dom-fe-autofocus>autofocus</dfn> DOM attribute</p>
<!-- If the element is <span>focusable</span>, run the <span>focusing steps</step> for that element. -->
<pre>&lt;input maxlength="256" name="q" value="" autofocus&gt;
&lt;input type="submit" value="Search"&gt;</pre>
</div>

<h4 id=attributes2><span class=secno>4.10.14 </span><dfn
id=attributes5>Attributes for form submission</dfn></h4>
Expand Down Expand Up @@ -37423,13 +37464,13 @@ never reset. This is nice and consistent.)
different <a href="#task-queues" title="task queue">task queues</a>.

<p class=example>For example, a user agent could have one <a
href="#task-queues">task queue</a> for mouse and key events (the
<span>user interaction task source</span>, not defined in this
specification<!-- XXX xref -->), and another for everything else. The user
agent could then give keyboard and mouse events preference over other
tasks three quarters of the time, keeping the interface responsive but not
starving other task queues, and never processing events from any one <a
href="#task-source">task source</a> out of order.
href="#task-queues">task queue</a> for mouse and key events (the <a
href="#user-interaction">user interaction task source</a>), and another
for everything else. The user agent could then give keyboard and mouse
events preference over other tasks three quarters of the time, keeping the
interface responsive but not starving other task queues, and never
processing events from any one <a href="#task-source">task source</a> out
of order.

<p>An <a href="#event4">event loop</a> must continually run through the
following steps for as long as it exists:
Expand All @@ -37452,6 +37493,46 @@ never reset. This is nice and consistent.)
<p>Return to the first step of the <a href="#event4">event loop</a>.
</ol>

<h5 id=generic><span class=secno>5.4.2.1. </span>Generic task sources</h5>

<p>The following <a href="#task-source" title="task source">task
sources</a> are used by a number of mostly unrelated features in this and
other specifications.

<dl>
<dt>The <dfn id=dom-manipulation>DOM manipulation task source</dfn>

<dd>
<p>This <a href="#task-source">task source</a> is used for features that
react to DOM manipulations, such as things that happen asynchronously
when an element is <a href="#inserted" title="insert an element into a
document">inserted into the document</a>.</p>

<p>Asynchronous mutation events must be dispatched using <a href="#tasks"
title=concept-task>tasks</a> <a href="#queue" title="queue a
task">queued</a> with the <a href="#dom-manipulation">DOM manipulation
task source</a>. <a href="#refsDOMEVENTS">[DOMEVENTS]</a></p>

<dt>The <dfn id=user-interaction>user interaction task source</dfn>

<dd>
<p>This <a href="#task-source">task source</a> is used for features that
react to user interaction, for example keyboard or mouse input.</p>

<p>Asynchronous events sent in response to user input (e.g. <span
title=event-click>click</span> events) must be dispatched using <a
href="#tasks" title=concept-task>tasks</a> <a href="#queue" title="queue
a task">queued</a> with the <a href="#user-interaction">user interaction
task source</a>. <a href="#refsDOMEVENTS">[DOMEVENTS]</a></p>

<dt>The <dfn id=networking>networking task source</dfn>

<dd>
<p>This <a href="#task-source">task source</a> is used for features that
trigger in response to network activity.</p>
<!-- XHR should use this -->
</dl>

<h4 id=security4><span class=secno>5.4.3 </span>Security exceptions</h4>

<p class=big-issue>Define <dfn id=security10>security exception</dfn>.</p>
Expand Down Expand Up @@ -44424,7 +44505,7 @@ at the first element with the given ID must be treated as if it was cloned and r
<p>This specification does not define how new values will get approved. It
is expected that the Wiki will have a community that addresses this.

<h2 id=editing><span class=secno>6. </span><dfn id=user-interaction>User
<h2 id=editing><span class=secno>6. </span><dfn id=user-interaction0>User
Interaction</dfn></h2>

<p>This section describes various features that allow authors to enable
Expand Down Expand Up @@ -53823,8 +53904,8 @@ interface <dfn id=messagechannel>MessageChannel</dfn> {

<hr>

<p>The <dfn id=generic>generic CDATA element parsing algorithm</dfn> and
the <dfn id=generic0>generic RCDATA element parsing algorithm</dfn>
<p>The <dfn id=generic0>generic CDATA element parsing algorithm</dfn> and
the <dfn id=generic1>generic RCDATA element parsing algorithm</dfn>
consist of the following steps. These algorithms are always invoked in
response to a start tag token.

Expand All @@ -53833,10 +53914,10 @@ interface <dfn id=messagechannel>MessageChannel</dfn> {
<p><a href="#insert0">Insert an HTML element</a> for the token.

<li>
<p>If the algorithm that was invoked is the <a href="#generic">generic
<p>If the algorithm that was invoked is the <a href="#generic0">generic
CDATA element parsing algorithm</a>, switch the tokeniser's <a
href="#content4">content model flag</a> to the CDATA state; otherwise
the algorithm invoked was the <a href="#generic0">generic RCDATA element
the algorithm invoked was the <a href="#generic1">generic RCDATA element
parsing algorithm</a>, switch the tokeniser's <a
href="#content4">content model flag</a> to the RCDATA state.

Expand Down Expand Up @@ -54441,7 +54522,7 @@ interface <dfn id=messagechannel>MessageChannel</dfn> {
<dt>A start tag whose tag name is "title"

<dd>
<p>Follow the <a href="#generic0">generic RCDATA element parsing
<p>Follow the <a href="#generic1">generic RCDATA element parsing
algorithm</a>.</p>

<dt>A start tag whose tag name is "noscript", if the <a
Expand All @@ -54450,7 +54531,7 @@ interface <dfn id=messagechannel>MessageChannel</dfn> {
<dt>A start tag whose tag name is one of: "noframes", "style"

<dd>
<p>Follow the <a href="#generic">generic CDATA element parsing
<p>Follow the <a href="#generic0">generic CDATA element parsing
algorithm</a>.</p>

<dt>A start tag whose tag name is "noscript", if the <a
Expand Down Expand Up @@ -55468,7 +55549,7 @@ interface <dfn id=messagechannel>MessageChannel</dfn> {
<p><a href="#reconstruct">Reconstruct the active formatting elements</a>,
if any.</p>

<p>Follow the <a href="#generic">generic CDATA element parsing
<p>Follow the <a href="#generic0">generic CDATA element parsing
algorithm</a>.</p>

<dt>A start tag whose tag name is "table"
Expand Down Expand Up @@ -55688,7 +55769,7 @@ interface <dfn id=messagechannel>MessageChannel</dfn> {
href="#scripting3">scripting flag</a> is enabled

<dd>
<p>Follow the <a href="#generic">generic CDATA element parsing
<p>Follow the <a href="#generic0">generic CDATA element parsing
algorithm</a>.</p>

<dt>A start tag whose tag name is "select"
Expand Down
99 changes: 93 additions & 6 deletions source
Expand Up @@ -3513,7 +3513,7 @@
processed incrementally, as, for instance, with a progressively
interlaced JPEG or an HTML file, multiple tasks may be queued to
process the data as it is downloaded. The <span>task source</span>
for these tasks is the <dfn>networking task source</dfn>.</p>
for these tasks is the <span>networking task source</span>.</p>
<!-- XXX make sure each use of 'fetch' defines what the appropriate
task is -->

Expand Down Expand Up @@ -27177,11 +27177,46 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {

<h5>Autofocusing a form control</h5>

<p class="big-issue">... <dfn title="attr-fe-autofocus">autofocus</dfn> content attribute</p>
<p>The <dfn title="attr-fe-autofocus"><code>autofocus</code></dfn>
content attribute allows the user 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>

<p class="big-issue">... <dfn title="dom-fe-autofocus">autofocus</dfn> DOM attribute</p>
<p>The <code title="attr-fe-autofocus">autofocus</code> attribute is
a <span>boolean attribute</span>.</p>

<!-- If the element is <span>focusable</span>, run the <span>focusing steps</step> for that element. -->
<p>There must not be more than one element in the document with the
<code title="attr-fe-autofocus">autofocus</code> attribute
specified.</p>

<p>Whenever 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>, 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>

<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>

<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 title="dom-fe-autofocus"><code>autofocus</code></dfn>
DOM attribute must <span>reflect</span> the content attribute of the
same name.</p>

<div class="example">
<p>In the following snippet, the text control would be focused when
the document was loaded.</p>
<pre>&lt;input maxlength="256" name="q" value="" autofocus&gt;
&lt;input type="submit" value="Search"&gt;</pre>
</div>



Expand Down Expand Up @@ -33617,8 +33652,7 @@ never reset. This is nice and consistent.)

<p class="example">For example, a user agent could have one
<span>task queue</span> for mouse and key events (the <span>user
interaction task source</span>, not defined in this
specification<!-- XXX xref -->), and another for everything
interaction task source</span>), and another for everything
else. The user agent could then give keyboard and mouse events
preference over other tasks three quarters of the time, keeping the
interface responsive but not starving other task queues, and never
Expand Down Expand Up @@ -33647,6 +33681,59 @@ never reset. This is nice and consistent.)



<h5>Generic task sources</h5>

<p>The following <span title="task source">task sources</span> are
used by a number of mostly unrelated features in this and other
specifications.</p>

<dl>

<dt>The <dfn>DOM manipulation task source</dfn></dt>

<dd>

<p>This <span>task source</span> is used for features that react
to DOM manipulations, such as things that happen asynchronously
when an element is <span title="insert an element into a
document">inserted into the document</span>.</p>

<p>Asynchronous mutation events must be dispatched using <span
title="concept-task">tasks</span> <span title="queue a
task">queued</span> with the <span>DOM manipulation task
source</span>. <a href="#refsDOMEVENTS">[DOMEVENTS]</a></p>

</dd>

<dt>The <dfn>user interaction task source</dfn></dt>

<dd>

<p>This <span>task source</span> is used for features that react
to user interaction, for example keyboard or mouse input.</p>

<p>Asynchronous events sent in response to user input (e.g. <span
title="event-click">click</span> events) must be dispatched using
<span title="concept-task">tasks</span> <span title="queue a
task">queued</span> with the <span>user interaction task
source</span>. <a href="#refsDOMEVENTS">[DOMEVENTS]</a></p>

</dd>

<dt>The <dfn>networking task source</dfn></dt>

<dd>

<p>This <span>task source</span> is used for features that trigger
in response to network activity.</p>

<!-- XHR should use this -->

</dd>

</dl>


<h4>Security exceptions</h4>

<p class="big-issue">Define <dfn>security exception</dfn>.</p>
Expand Down

0 comments on commit 8d20641

Please sign in to comment.