HTML Standard Tracker


File a bug

SVNBugCommentTime (UTC)
2218WF2: Define the autofocus='' attribute. Define generic task sources.2008-09-19 01:02
@@ -3506,21 +3506,21 @@
     protocol"><code title="">javascript:</code> URLs</span></span>,
    <li><p>When the resource is available, <span>queue a task</span>
    that uses the resource as appropriate. If the resource can be
    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 -->
   <p class="note">The <span>offline application cache</span>
   processing model introduces some <a
   href="#changesToNetworkingModel">changes to the networking model</a>
   to handle the returning of cached resources.</p>
@@ -27170,25 +27170,60 @@ interface <dfn>HTMLOptionElement</dfn> : <span>HTMLElement</span> {
   <h5>A form control's value</h5>
   <p class="big-issue">... <dfn title="concept-fe-value">value</dfn></p>
   <!-- XXX autocomplete: define somewhere that the value may be set from a stored value -->
   <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>
   <h4><dfn>Attributes for form submission</dfn></h4>
   <p class="big-issue">... <dfn title="attr-fs-action">action</dfn> content attribute</p>
   <p class="big-issue">... <dfn title="dom-fs-action">action</dfn> DOM attribute</p>
   <p class="big-issue">... <dfn title="concept-fs-action">action</dfn> if present else form's else default</p>
@@ -33610,22 +33645,21 @@ never reset. This is nice and consistent.)
   of the relevant <span>event loop</span>. All the tasks from one
   particular <dfn>task source</dfn> (e.g. the callbacks generated by
   timers, the events dispatched for mouse movements, the tasks queued
   for the parser) must always be added to the same <span>task
   queue</span>, but tasks from different <span title="task
   source">task sources</span> may be placed in different <span
   title="task queue">task queues</span>.</p>
   <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
   processing events from any one <span>task source</span> out of
   <p>An <span>event loop</span> must continually run through the
   following steps for as long as it exists:</p>
@@ -33640,20 +33674,73 @@ never reset. This is nice and consistent.)
    <code>Document</code> or <span>browsing context</span> to reflect
    the current state.</p></li>
    <li><p>Return to the first step of the <span>event
+  <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>
   <!-- SCRIPT EXEC -->
   <h4 id="javascript-protocol"><dfn title="javascript protocol">The <code title="">javascript:</code> protocol</dfn></h4>
   <p>A URL using the <code title="">javascript:</code> protocol must,