[html5] r3068 - [] (0) Bring setTimeout() and setInterval() up to date with recent changes and b [...]

whatwg at whatwg.org whatwg at whatwg.org
Sun May 3 23:10:32 PDT 2009


Author: ianh
Date: 2009-05-03 23:10:31 -0700 (Sun, 03 May 2009)
New Revision: 3068

Modified:
   index
   source
Log:
[] (0) Bring setTimeout() and setInterval() up to date with recent changes and bring them back into the fold.

Modified: index
===================================================================
--- index	2009-05-03 07:59:56 UTC (rev 3067)
+++ index	2009-05-04 06:10:31 UTC (rev 3068)
@@ -39,7 +39,7 @@
   <div class=head>
    <p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
    <h1>HTML 5</h1>
-   <h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 3 May 2009</h2>
+   <h2 class="no-num no-toc" id=draft-recommendation-—-date:-01-jan-1901>Draft Recommendation — 4 May 2009</h2>
    <p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
    <p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
    <dl><dt>Multiple-page version:</dt>
@@ -709,93 +709,94 @@
        <li><a href=#event-firing><span class=secno>5.5.6.3 </span>Event firing</a></li>
        <li><a href=#events-and-the-window-object><span class=secno>5.5.6.4 </span>Events and the <code>Window</code> object</a></li>
        <li><a href=#runtime-script-errors><span class=secno>5.5.6.5 </span>Runtime script errors</a></ol></ol></li>
-   <li><a href=#user-prompts><span class=secno>5.6 </span>User prompts</a>
+   <li><a href=#timers><span class=secno>5.6 </span>Timers</a></li>
+   <li><a href=#user-prompts><span class=secno>5.7 </span>User prompts</a>
     <ol>
-     <li><a href=#simple-dialogs><span class=secno>5.6.1 </span>Simple dialogs</a></li>
-     <li><a href=#printing><span class=secno>5.6.2 </span>Printing</a></li>
-     <li><a href=#dialogs-implemented-using-separate-documents><span class=secno>5.6.3 </span>Dialogs implemented using separate documents</a></ol></li>
-   <li><a href=#system-state-and-capabilities><span class=secno>5.7 </span>System state and capabilities</a>
+     <li><a href=#simple-dialogs><span class=secno>5.7.1 </span>Simple dialogs</a></li>
+     <li><a href=#printing><span class=secno>5.7.2 </span>Printing</a></li>
+     <li><a href=#dialogs-implemented-using-separate-documents><span class=secno>5.7.3 </span>Dialogs implemented using separate documents</a></ol></li>
+   <li><a href=#system-state-and-capabilities><span class=secno>5.8 </span>System state and capabilities</a>
     <ol>
-     <li><a href=#client-identification><span class=secno>5.7.1 </span>Client identification</a></li>
-     <li><a href=#custom-handlers><span class=secno>5.7.2 </span>Custom protocol and content handlers</a>
+     <li><a href=#client-identification><span class=secno>5.8.1 </span>Client identification</a></li>
+     <li><a href=#custom-handlers><span class=secno>5.8.2 </span>Custom protocol and content handlers</a>
       <ol>
-       <li><a href=#security-and-privacy><span class=secno>5.7.2.1 </span>Security and privacy</a></li>
-       <li><a href=#sample-handler-impl><span class=secno>5.7.2.2 </span>Sample user interface</a></ol></li>
-     <li><a href=#manually-releasing-the-storage-mutex><span class=secno>5.7.3 </span>Manually releasing the storage mutex</a></ol></li>
-   <li><a href=#offline><span class=secno>5.8 </span>Offline Web applications</a>
+       <li><a href=#security-and-privacy><span class=secno>5.8.2.1 </span>Security and privacy</a></li>
+       <li><a href=#sample-handler-impl><span class=secno>5.8.2.2 </span>Sample user interface</a></ol></li>
+     <li><a href=#manually-releasing-the-storage-mutex><span class=secno>5.8.3 </span>Manually releasing the storage mutex</a></ol></li>
+   <li><a href=#offline><span class=secno>5.9 </span>Offline Web applications</a>
     <ol>
-     <li><a href=#introduction-3><span class=secno>5.8.1 </span>Introduction</a></li>
-     <li><a href=#appcache><span class=secno>5.8.2 </span>Application caches</a></li>
-     <li><a href=#manifests><span class=secno>5.8.3 </span>The cache manifest syntax</a>
+     <li><a href=#introduction-3><span class=secno>5.9.1 </span>Introduction</a></li>
+     <li><a href=#appcache><span class=secno>5.9.2 </span>Application caches</a></li>
+     <li><a href=#manifests><span class=secno>5.9.3 </span>The cache manifest syntax</a>
       <ol>
-       <li><a href=#a-sample-manifest><span class=secno>5.8.3.1 </span>A sample manifest</a></li>
-       <li><a href=#writing-cache-manifests><span class=secno>5.8.3.2 </span>Writing cache manifests</a></li>
-       <li><a href=#parsing-cache-manifests><span class=secno>5.8.3.3 </span>Parsing cache manifests</a></ol></li>
-     <li><a href=#updating-an-application-cache><span class=secno>5.8.4 </span>Updating an application cache</a></li>
-     <li><a href=#matching-a-fallback-namespace><span class=secno>5.8.5 </span>Matching a fallback namespace</a></li>
-     <li><a href=#the-application-cache-selection-algorithm><span class=secno>5.8.6 </span>The application cache selection algorithm</a></li>
-     <li><a href=#changesToNetworkingModel><span class=secno>5.8.7 </span>Changes to the networking model</a></li>
-     <li><a href=#application-cache-api><span class=secno>5.8.8 </span>Application cache API</a></li>
-     <li><a href=#browser-state><span class=secno>5.8.9 </span>Browser state</a></ol></li>
-   <li><a href=#history><span class=secno>5.9 </span>Session history and navigation</a>
+       <li><a href=#a-sample-manifest><span class=secno>5.9.3.1 </span>A sample manifest</a></li>
+       <li><a href=#writing-cache-manifests><span class=secno>5.9.3.2 </span>Writing cache manifests</a></li>
+       <li><a href=#parsing-cache-manifests><span class=secno>5.9.3.3 </span>Parsing cache manifests</a></ol></li>
+     <li><a href=#updating-an-application-cache><span class=secno>5.9.4 </span>Updating an application cache</a></li>
+     <li><a href=#matching-a-fallback-namespace><span class=secno>5.9.5 </span>Matching a fallback namespace</a></li>
+     <li><a href=#the-application-cache-selection-algorithm><span class=secno>5.9.6 </span>The application cache selection algorithm</a></li>
+     <li><a href=#changesToNetworkingModel><span class=secno>5.9.7 </span>Changes to the networking model</a></li>
+     <li><a href=#application-cache-api><span class=secno>5.9.8 </span>Application cache API</a></li>
+     <li><a href=#browser-state><span class=secno>5.9.9 </span>Browser state</a></ol></li>
+   <li><a href=#history><span class=secno>5.10 </span>Session history and navigation</a>
     <ol>
-     <li><a href=#the-session-history-of-browsing-contexts><span class=secno>5.9.1 </span>The session history of browsing contexts</a></li>
-     <li><a href=#the-history-interface><span class=secno>5.9.2 </span>The <code>History</code> interface</a></li>
-     <li><a href=#activating-state-object-entries><span class=secno>5.9.3 </span>Activating state object entries</a></li>
-     <li><a href=#the-location-interface><span class=secno>5.9.4 </span>The <code>Location</code> interface</a>
+     <li><a href=#the-session-history-of-browsing-contexts><span class=secno>5.10.1 </span>The session history of browsing contexts</a></li>
+     <li><a href=#the-history-interface><span class=secno>5.10.2 </span>The <code>History</code> interface</a></li>
+     <li><a href=#activating-state-object-entries><span class=secno>5.10.3 </span>Activating state object entries</a></li>
+     <li><a href=#the-location-interface><span class=secno>5.10.4 </span>The <code>Location</code> interface</a>
       <ol>
-       <li><a href=#security-3><span class=secno>5.9.4.1 </span>Security</a></ol></li>
-     <li><a href=#history-notes><span class=secno>5.9.5 </span>Implementation notes for session history</a></ol></li>
-   <li><a href=#browsing-the-web><span class=secno>5.10 </span>Browsing the Web</a>
+       <li><a href=#security-3><span class=secno>5.10.4.1 </span>Security</a></ol></li>
+     <li><a href=#history-notes><span class=secno>5.10.5 </span>Implementation notes for session history</a></ol></li>
+   <li><a href=#browsing-the-web><span class=secno>5.11 </span>Browsing the Web</a>
     <ol>
-     <li><a href=#navigating-across-documents><span class=secno>5.10.1 </span>Navigating across documents</a></li>
-     <li><a href=#read-html><span class=secno>5.10.2 </span>Page load processing model for HTML files</a></li>
-     <li><a href=#read-xml><span class=secno>5.10.3 </span>Page load processing model for XML files</a></li>
-     <li><a href=#read-text><span class=secno>5.10.4 </span>Page load processing model for text files</a></li>
-     <li><a href=#read-image><span class=secno>5.10.5 </span>Page load processing model for images</a></li>
-     <li><a href=#read-plugin><span class=secno>5.10.6 </span>Page load processing model for content that uses plugins</a></li>
-     <li><a href=#read-ua-inline><span class=secno>5.10.7 </span>Page load processing model for inline content that doesn't have a DOM</a></li>
-     <li><a href=#scroll-to-fragid><span class=secno>5.10.8 </span>Navigating to a fragment identifier</a></li>
-     <li><a href=#history-traversal><span class=secno>5.10.9 </span>History traversal</a></li>
-     <li><a href=#unloading-documents><span class=secno>5.10.10 </span>Unloading documents</a>
+     <li><a href=#navigating-across-documents><span class=secno>5.11.1 </span>Navigating across documents</a></li>
+     <li><a href=#read-html><span class=secno>5.11.2 </span>Page load processing model for HTML files</a></li>
+     <li><a href=#read-xml><span class=secno>5.11.3 </span>Page load processing model for XML files</a></li>
+     <li><a href=#read-text><span class=secno>5.11.4 </span>Page load processing model for text files</a></li>
+     <li><a href=#read-image><span class=secno>5.11.5 </span>Page load processing model for images</a></li>
+     <li><a href=#read-plugin><span class=secno>5.11.6 </span>Page load processing model for content that uses plugins</a></li>
+     <li><a href=#read-ua-inline><span class=secno>5.11.7 </span>Page load processing model for inline content that doesn't have a DOM</a></li>
+     <li><a href=#scroll-to-fragid><span class=secno>5.11.8 </span>Navigating to a fragment identifier</a></li>
+     <li><a href=#history-traversal><span class=secno>5.11.9 </span>History traversal</a></li>
+     <li><a href=#unloading-documents><span class=secno>5.11.10 </span>Unloading documents</a>
       <ol>
-       <li><a href=#event-definition><span class=secno>5.10.10.1 </span>Event definition</a></ol></ol></li>
-   <li><a href=#links><span class=secno>5.11 </span>Links</a>
+       <li><a href=#event-definition><span class=secno>5.11.10.1 </span>Event definition</a></ol></ol></li>
+   <li><a href=#links><span class=secno>5.12 </span>Links</a>
     <ol>
-     <li><a href=#hyperlink-elements><span class=secno>5.11.1 </span>Hyperlink elements</a></li>
-     <li><a href=#following-hyperlinks><span class=secno>5.11.2 </span>Following hyperlinks</a>
+     <li><a href=#hyperlink-elements><span class=secno>5.12.1 </span>Hyperlink elements</a></li>
+     <li><a href=#following-hyperlinks><span class=secno>5.12.2 </span>Following hyperlinks</a>
       <ol>
-       <li><a href=#hyperlink-auditing><span class=secno>5.11.2.1 </span>Hyperlink auditing</a></ol></li>
-     <li><a href=#linkTypes><span class=secno>5.11.3 </span>Link types</a>
+       <li><a href=#hyperlink-auditing><span class=secno>5.12.2.1 </span>Hyperlink auditing</a></ol></li>
+     <li><a href=#linkTypes><span class=secno>5.12.3 </span>Link types</a>
       <ol>
-       <li><a href=#link-type-alternate><span class=secno>5.11.3.1 </span>Link type "<code>alternate</code>"</a></li>
-       <li><a href=#link-type-archives><span class=secno>5.11.3.2 </span>Link type "<code>archives</code>"</a></li>
-       <li><a href=#link-type-author><span class=secno>5.11.3.3 </span>Link type "<code>author</code>"</a></li>
-       <li><a href=#link-type-bookmark><span class=secno>5.11.3.4 </span>Link type "<code>bookmark</code>"</a></li>
-       <li><a href=#link-type-external><span class=secno>5.11.3.5 </span>Link type "<code>external</code>"</a></li>
-       <li><a href=#link-type-feed><span class=secno>5.11.3.6 </span>Link type "<code>feed</code>"</a></li>
-       <li><a href=#link-type-help><span class=secno>5.11.3.7 </span>Link type "<code>help</code>"</a></li>
-       <li><a href=#rel-icon><span class=secno>5.11.3.8 </span>Link type "<code>icon</code>"</a></li>
-       <li><a href=#link-type-license><span class=secno>5.11.3.9 </span>Link type "<code>license</code>"</a></li>
-       <li><a href=#link-type-nofollow><span class=secno>5.11.3.10 </span>Link type "<code>nofollow</code>"</a></li>
-       <li><a href=#link-type-noreferrer><span class=secno>5.11.3.11 </span>Link type "<code>noreferrer</code>"</a></li>
-       <li><a href=#link-type-pingback><span class=secno>5.11.3.12 </span>Link type "<code>pingback</code>"</a></li>
-       <li><a href=#link-type-prefetch><span class=secno>5.11.3.13 </span>Link type "<code>prefetch</code>"</a></li>
-       <li><a href=#link-type-search><span class=secno>5.11.3.14 </span>Link type "<code>search</code>"</a></li>
-       <li><a href=#link-type-stylesheet><span class=secno>5.11.3.15 </span>Link type "<code>stylesheet</code>"</a></li>
-       <li><a href=#link-type-sidebar><span class=secno>5.11.3.16 </span>Link type "<code>sidebar</code>"</a></li>
-       <li><a href=#link-type-tag><span class=secno>5.11.3.17 </span>Link type "<code>tag</code>"</a></li>
-       <li><a href=#hierarchical-link-types><span class=secno>5.11.3.18 </span>Hierarchical link types</a>
+       <li><a href=#link-type-alternate><span class=secno>5.12.3.1 </span>Link type "<code>alternate</code>"</a></li>
+       <li><a href=#link-type-archives><span class=secno>5.12.3.2 </span>Link type "<code>archives</code>"</a></li>
+       <li><a href=#link-type-author><span class=secno>5.12.3.3 </span>Link type "<code>author</code>"</a></li>
+       <li><a href=#link-type-bookmark><span class=secno>5.12.3.4 </span>Link type "<code>bookmark</code>"</a></li>
+       <li><a href=#link-type-external><span class=secno>5.12.3.5 </span>Link type "<code>external</code>"</a></li>
+       <li><a href=#link-type-feed><span class=secno>5.12.3.6 </span>Link type "<code>feed</code>"</a></li>
+       <li><a href=#link-type-help><span class=secno>5.12.3.7 </span>Link type "<code>help</code>"</a></li>
+       <li><a href=#rel-icon><span class=secno>5.12.3.8 </span>Link type "<code>icon</code>"</a></li>
+       <li><a href=#link-type-license><span class=secno>5.12.3.9 </span>Link type "<code>license</code>"</a></li>
+       <li><a href=#link-type-nofollow><span class=secno>5.12.3.10 </span>Link type "<code>nofollow</code>"</a></li>
+       <li><a href=#link-type-noreferrer><span class=secno>5.12.3.11 </span>Link type "<code>noreferrer</code>"</a></li>
+       <li><a href=#link-type-pingback><span class=secno>5.12.3.12 </span>Link type "<code>pingback</code>"</a></li>
+       <li><a href=#link-type-prefetch><span class=secno>5.12.3.13 </span>Link type "<code>prefetch</code>"</a></li>
+       <li><a href=#link-type-search><span class=secno>5.12.3.14 </span>Link type "<code>search</code>"</a></li>
+       <li><a href=#link-type-stylesheet><span class=secno>5.12.3.15 </span>Link type "<code>stylesheet</code>"</a></li>
+       <li><a href=#link-type-sidebar><span class=secno>5.12.3.16 </span>Link type "<code>sidebar</code>"</a></li>
+       <li><a href=#link-type-tag><span class=secno>5.12.3.17 </span>Link type "<code>tag</code>"</a></li>
+       <li><a href=#hierarchical-link-types><span class=secno>5.12.3.18 </span>Hierarchical link types</a>
         <ol>
-         <li><a href=#link-type-index><span class=secno>5.11.3.18.1 </span>Link type "<code>index</code>"</a></li>
-         <li><a href=#link-type-up><span class=secno>5.11.3.18.2 </span>Link type "<code>up</code>"</a></ol></li>
-       <li><a href=#sequential-link-types><span class=secno>5.11.3.19 </span>Sequential link types</a>
+         <li><a href=#link-type-index><span class=secno>5.12.3.18.1 </span>Link type "<code>index</code>"</a></li>
+         <li><a href=#link-type-up><span class=secno>5.12.3.18.2 </span>Link type "<code>up</code>"</a></ol></li>
+       <li><a href=#sequential-link-types><span class=secno>5.12.3.19 </span>Sequential link types</a>
         <ol>
-         <li><a href=#link-type-first><span class=secno>5.11.3.19.1 </span>Link type "<code>first</code>"</a></li>
-         <li><a href=#link-type-last><span class=secno>5.11.3.19.2 </span>Link type "<code>last</code>"</a></li>
-         <li><a href=#link-type-next><span class=secno>5.11.3.19.3 </span>Link type "<code>next</code>"</a></li>
-         <li><a href=#link-type-prev><span class=secno>5.11.3.19.4 </span>Link type "<code>prev</code>"</a></ol></li>
-       <li><a href=#other-link-types><span class=secno>5.11.3.20 </span>Other link types</a></ol></ol></ol></li>
+         <li><a href=#link-type-first><span class=secno>5.12.3.19.1 </span>Link type "<code>first</code>"</a></li>
+         <li><a href=#link-type-last><span class=secno>5.12.3.19.2 </span>Link type "<code>last</code>"</a></li>
+         <li><a href=#link-type-next><span class=secno>5.12.3.19.3 </span>Link type "<code>next</code>"</a></li>
+         <li><a href=#link-type-prev><span class=secno>5.12.3.19.4 </span>Link type "<code>prev</code>"</a></ol></li>
+       <li><a href=#other-link-types><span class=secno>5.12.3.20 </span>Other link types</a></ol></ol></ol></li>
  <li><a href=#editing><span class=secno>6 </span>User Interaction</a>
   <ol>
    <li><a href=#editing-intro><span class=secno>6.1 </span>Introduction</a></li>
@@ -1043,8 +1044,7 @@
   <ol>
    <li><a href=#localization><span class=secno>12.1 </span>Localization</a></li>
    <li><a href=#declarative-3d-scenes><span class=secno>12.2 </span>Declarative 3D scenes</a></li>
-   <li><a href=#timers><span class=secno>12.3 </span>Timers</a></li>
-   <li><a href=#rendering-and-the-dom><span class=secno>12.4 </span>Rendering and the DOM</a></ol></li>
+   <li><a href=#rendering-and-the-dom><span class=secno>12.3 </span>Rendering and the DOM</a></ol></li>
  <li><a class=no-num href=#index>Index</a></li>
  <li><a class=no-num href=#references>References</a></li>
  <li><a class=no-num href=#acknowledgements>Acknowledgements</a></ol>
@@ -42938,9 +42938,270 @@
   </dl></div>
 
 
+  <h3 id=timers><span class=secno>5.6 </span>Timers</h3>
 
-  <h3 id=user-prompts><span class=secno>5.6 </span>User prompts</h3>
+  <p>The <code title=dom-windowtimers-setTimeout><a href=#dom-windowtimers-settimeout>setTimeout()</a></code>
+  and <code title=dom-windowtimers-setInterval><a href=#dom-windowtimers-setinterval>setInterval()</a></code>
+  methods allow authors to schedule timer-based callbacks.</p>
 
+<!-- HereBeDragons is just meant to prevent this from compiling in random WebIDL implementations -->
+<pre class=idl>[HereBeDragons, NoInterfaceObject] interface <dfn id=windowtimers>WindowTimers</dfn> {
+  long <a href=#dom-windowtimers-settimeout title=dom-windowtimers-setTimeout>setTimeout</a>(in any handler, [Optional] in any timeout, [Variadic] in any args);
+  void <a href=#dom-windowtimers-cleartimeout title=dom-windowtimers-clearTimeout>clearTimeout</a>(in long handle);
+  long <a href=#dom-windowtimers-setinterval title=dom-windowtimers-setInterval>setInterval</a>(in any handler, [Optional] in any timeout, [Variadic] in any args);
+  void <a href=#dom-windowtimers-clearinterval title=dom-windowtimers-clearInterval>clearInterval</a>(in long handle);
+};</pre>
+
+  <dl class=domintro><dt><var title="">handle</var> = <var title="">window</var> . <code title=dom-windowtimers-setTimeout><a href=#dom-windowtimers-settimeout>setTimeout</a></code>( <var title="">handler</var> [, <var title="">timeout</var> [, <var title="">arguments</var> ] ] )</dt>
+
+   <dd>
+
+    <p>Schedules a timeout to run <var title="">handler</var> after
+    <var title="">timeout</var> milliseconds. Any <var title="">arguments</var> are passed straight through to the <var title="">handler</var>.</p>
+
+   </dd>
+
+   <dt><var title="">handle</var> = <var title="">window</var> . <code title=dom-windowtimers-setTimeout><a href=#dom-windowtimers-settimeout>setTimeout</a></code>( <var title="">code</var> [, <var title="">timeout</var> ] )</dt>
+
+   <dd>
+
+    <p>Schedules a timeout to compile and run <var title="">code</var>
+    after <var title="">timeout</var> milliseconds.</p>
+
+   </dd>
+
+   <dt><var title="">handle</var> = <var title="">window</var> . <code title=dom-windowtimers-setInterval><a href=#dom-windowtimers-setinterval>setInterval</a></code>( <var title="">handler</var> [, <var title="">timeout</var> [, <var title="">arguments</var> ] ] )</dt>
+
+   <dd>
+
+    <p>Schedules a timeout to run <var title="">handler</var> every
+    <var title="">timeout</var> milliseconds. Any <var title="">arguments</var> are passed straight through to the <var title="">handler</var>.</p>
+
+   </dd>
+
+   <dt><var title="">handle</var> = <var title="">window</var> . <code title=dom-windowtimers-setInterval><a href=#dom-windowtimers-setinterval>setInterval</a></code>( <var title="">code</var> [, <var title="">timeout</var> ] )</dt>
+
+   <dd>
+
+    <p>Schedules a timeout to compile and run <var title="">code</var>
+    every <var title="">timeout</var> milliseconds.</p>
+
+   </dd>
+
+  </dl><p class=note>This API does not guarantee that timers will fire
+  exactly on schedule. Delays due to CPU load, other tasks, etc, are
+  to be expected.</p>
+
+  <div class=impl>
+
+  <p>The <code><a href=#windowtimers>WindowTimers</a></code> interface must be implemented by
+  objects implementing the <code><a href=#window>Window</a></code> object. (It is also
+  implemented by objects implementing the <code>WorkerUtils</code>
+  interface as part of Web Workers.)</p>
+
+  <p>Each object that implements the <code><a href=#windowtimers>WindowTimers</a></code>
+  interface has a <dfn id=list-of-active-timeouts>list of active timeouts</dfn> and a <dfn id=list-of-active-intervals>list
+  of active intervals</dfn>. Each entry in these lists is identified
+  by a number, which must be unique within its list for the lifetime
+  of the object that implements the <code><a href=#windowtimers>WindowTimers</a></code>
+  interface.</p>
+
+  <hr><p>The <dfn id=dom-windowtimers-settimeout title=dom-windowtimers-setTimeout><code>setTimeout()</code></dfn>
+  method must run the following steps:
+
+  <ol><li><p><a href=#get-the-timed-task>Get the timed task</a>, and let <var title="">task</var> be the result.</li>
+
+   <li><p><a href=#get-the-timeout>Get the timeout</a>, and let <var title="">timeout</var> be the result.</li>
+
+   <li><p>If the currently running <a href=#concept-task title=concept-task>task</a> is a task that was created by
+   either the <code title=dom-windowtimers-setTimeout><a href=#dom-windowtimers-settimeout>setTimeout()</a></code> method, and
+   <var title="">timeout</var> is less than 4, then increase <var title="">timeout</var> to 4.</li>
+
+   <li><p>Add an entry to the <a href=#list-of-active-timeouts>list of active timeouts</a>,
+   identified by a user-agent defined integer that is greater than
+   zero.</li>
+
+   <li><p>Return the number identifying the newly added entry in the
+   <a href=#list-of-active-timeouts>list of active timeouts</a>, and then continue running
+   this algorithm asynchronously.</li>
+
+   <li>
+
+    <p>If <var title="">context</var> is a <code><a href=#window>Window</a></code> object,
+    wait until the <code>Document</code> associated with <var title="">context</var> has been <a href=#fully-active>fully active</a> for a
+    further <var title="">timeout</var> milliseconds (not necessarily
+    consecutively).</p>
+
+    <p>Otherwise, if <var title="">context</var> is a
+    <code>WorkerUtils</code> object, wait until <var title="">timeout</var> milliseconds have passed with the worker
+    not suspended (not necessarily consecutively).</p>
+
+    <p>Otherwise, act as described in the specification that defines
+    that the <code><a href=#windowtimers>WindowTimers</a></code> interface is implemented by
+    some other object.</p>
+
+   </li>
+
+   <li><p>Wait until any invocations of this algorithm started before
+   this one whose <var title="">timeout</var> is equal to or less than
+   this one's have completed.</li>
+
+   <li><p>If the entry in the <a href=#list-of-active-timeouts>list of active timeouts</a>
+   that was added in the earlier step has been cleared, then abort
+   this algorithm.</li>
+
+   <li><p><a href=#queue-a-task title="queue a task">Queue</a> the <var title="">task</var> <a href=#concept-task title=concept-task>task</a>.</li>
+
+  </ol><p>The <dfn id=dom-windowtimers-cleartimeout title=dom-windowtimers-clearTimeout><code>clearTimeout()</code></dfn>
+  method must clear the entry identified as <var title="">handle</var>
+  from the <a href=#list-of-active-timeouts>list of active timeouts</a> of the
+  <code><a href=#windowtimers>WindowTimers</a></code> object on which the method was invoked,
+  where <var title="">handle</var> is the argument passed to the
+  method.</p>
+
+  <hr><p>The <dfn id=dom-windowtimers-setinterval title=dom-windowtimers-setInterval><code>setInterval()</code></dfn>
+  method must run the following steps:
+
+  <ol><li><p><a href=#get-the-timed-task>Get the timed task</a>, and let <var title="">task</var> be the result.</li>
+
+   <li><p><a href=#get-the-timeout>Get the timeout</a>, and let <var title="">timeout</var> be the result.</li>
+
+   <li><p>If <var title="">timeout</var> is less than 10, then
+   increase <var title="">timeout</var> to 10.</li> <!-- (but see
+   note below about IE) -->
+
+   <li><p>Add an entry to the <a href=#list-of-active-intervals>list of active intervals</a>,
+   identified by a user-agent defined integer that is greater than
+   zero.</li>
+
+   <li><p>Return the number identifying the newly added entry in the
+   <a href=#list-of-active-intervals>list of active intervals</a>, and then continue running
+   this algorithm asynchronously.</li>
+
+   <!-- Note: IE doesn't actually run intervals with duration zero, it
+   aborts roughly here in the algorithm for them. -->
+
+   <li>
+
+    <p><i>Wait:</i> If <var title="">context</var> is a
+    <code><a href=#window>Window</a></code> object, wait until the <code>Document</code>
+    associated with <var title="">context</var> has been <a href=#fully-active>fully
+    active</a> for a further <var title="">interval</var>
+    milliseconds (not necessarily consecutively).</p>
+
+    <p>Otherwise, if <var title="">context</var> is a
+    <code>WorkerUtils</code> object, wait until <var title="">interval</var> milliseconds have passed with the worker
+    not suspended (not necessarily consecutively).</p>
+
+    <p>Otherwise, act as described in the specification that defines
+    that the <code><a href=#windowtimers>WindowTimers</a></code> interface is implemented by
+    some other object.</p>
+
+   </li>
+
+   <li><p>If the entry in the <a href=#list-of-active-intervals>list of active intervals</a>
+   that was added in the earlier step has been cleared, then abort
+   this algorithm.</li>
+
+   <li><p><a href=#queue-a-task title="queue a task">Queue</a> the <var title="">task</var> <a href=#concept-task title=concept-task>task</a>.</li>
+
+   <li><p>Return to the step labeled <i>wait</i>.</li>
+
+  </ol><p>The <dfn id=dom-windowtimers-clearinterval title=dom-windowtimers-clearInterval><code>clearInterval()</code></dfn>
+  method must clear the entry identified as <var title="">handle</var>
+  from the <a href=#list-of-active-intervals>list of active intervals</a> of the
+  <code><a href=#windowtimers>WindowTimers</a></code> object on which the method was invoked,
+  where <var title="">handle</var> is the argument passed to the
+  method.</p>
+
+  <hr><p>When the above methods are to <dfn id=get-the-timed-task>get the timed task</dfn>, they
+  must run the following steps:</p>
+
+  <ol><li>
+  
+    <p>If the first argument to the method is an object that has an
+    internal [[Call]] method, then return a <a href=#concept-task title=concept-task>task</a> that calls that [[Call]] method
+    with as its arguments the third and subsequent arguments to the
+    method (if any), and aborth these steps.</p>
+
+    <p>Otherwise, continue with the remaining steps.</p>
+ 
+   </li>
+
+   <li><p>Apply the ToString() conversion operator to the first
+   argument to the method, and let <var title="">script source</var>
+   be the result.</li>
+
+   <li><p>Let <var title="">script language</var> be
+   JavaScript.</li>
+
+   <li><p>Let <var title="">context</var> be the object on which the
+   method is implemented (a <code><a href=#window>Window</a></code> or
+   <code>WorkerUtils</code> object).</li>
+
+   <li>
+
+    <p>If <var title="">context</var> is a <code><a href=#window>Window</a></code> object,
+    let <var title="">global object</var> be <var title="">context</var>, let <var title="">browsing context</var>
+    be the <a href=#browsing-context>browsing context</a> with which <var title="">global object</var> is associated, let <var title="">character encoding</var> be the <a href="#document's-character-encoding" title="document's
+    character encoding">character encoding</a> of the
+    <code>Document</code> associated with <var title="">global
+    object</var> (<a href=#sce-not-copy>this is a reference, not a
+    copy</a>), and let <var title="">base URL</var> be the <a href=#document-base-url title="document base URL">base URL</a> of the
+    <code>Document</code> associated with <var title="">global
+    object</var> (<a href=#sbu-not-copy>this is a reference, not a
+    copy</a>).</p>
+
+    <p>Otherwise, if <var title="">context</var> is a
+    <code>WorkerUtils</code> object, let <var title="">global
+    object</var>, <var title="">browsing context</var>, <var title="">character encoding</var>, and <var title="">base
+    URL</var> be the <a href="#script's-global-object">script's global object</a>,
+    <a href="#script's-browsing-context">script's browsing context</a>, <a href="#script's-url-character-encoding">script's URL
+    character encoding</a>, and <a href="#script's-base-url">script's base URL</a>
+    (respectively) of the <a href=#concept-script title=concept-script>script</a>
+    that the <span>run a worker</span> algorithm created when it
+    created <var title="">context</var>.</p>
+
+    <p>Otherwise, act as described in the specification that defines
+    that the <code><a href=#windowtimers>WindowTimers</a></code> interface is implemented by
+    some other object.</p>
+
+   </li>
+
+   <li><p>Return a <a href=#concept-task title=concept-task>task</a> that <a href=#create-a-script title="create a script">creates a script</a> using <var title="">script source</var> as the script source, <var title="">scripting language</var> as the scripting language, <var title="">global object</var> as the global object, <var title="">browsing context</var> as the browsing context, <var title="">character encoding</var> as the character encoding, and
+   <var title="">base URL</var> as the base URL.</li>
+
+  </ol><p>When the above methods are to <dfn id=get-the-timeout>get the timeout</dfn>, they
+  must run the following steps:</p>
+
+  <ol><li><p>Let <var title="">timeout</var> be the second argument to
+   the method, or zero if the argument was omitted.</li>
+
+   <li><p>Apply the ToString() conversion operator to <var title="">timeout</var>, and let <var title="">timeout</var>
+   be the result.</li>
+
+   <li><p>Apply the ToNumber() conversion operator to <var title="">timeout</var>, and let <var title="">timeout</var> be the
+   result.</li>
+
+   <li><p>If <var title="">timeout</var> is not a number (NaN), not
+   finite (Infinity), or negative, let <var title="">timeout</var> be
+   zero.</li>
+
+   <li><p>Round <var title="">timeout</var> down to the nearest
+   integer, and let <var title="">timeout</var> be the
+   result.</li>
+
+   <li><p>Return <var title="">timeout</var>.</li>
+
+  </ol><hr><p>The <a href=#task-source>task source</a> for these tasks is the <dfn id=timer-task-source>timer
+  task source</dfn>.</p>
+
+  </div>
+
+
+
+  <h3 id=user-prompts><span class=secno>5.7 </span>User prompts</h3>
+
   <!--
    v2 ideas:
     * in-window modal dialogs
@@ -42950,7 +43211,7 @@
        - with a solution for the mobile space
   -->
 
-  <h4 id=simple-dialogs><span class=secno>5.6.1 </span>Simple dialogs</h4>
+  <h4 id=simple-dialogs><span class=secno>5.7.1 </span>Simple dialogs</h4>
 
   <dl class=domintro><dt><var title="">window</var> . <code title=dom-alert><a href=#dom-alert>alert</a></code>(<var title="">message</var>)</dt>
    <dd>
@@ -43017,7 +43278,7 @@
   </div>
 
 
-  <h4 id=printing><span class=secno>5.6.2 </span>Printing</h4>
+  <h4 id=printing><span class=secno>5.7.2 </span>Printing</h4>
 
   <dl class=domintro><dt><var title="">window</var> . <code title=dom-print><a href=#dom-print>print</a></code>()</dt>
 
@@ -43111,7 +43372,7 @@
   </ol></div>
 
 
-  <h4 id=dialogs-implemented-using-separate-documents><span class=secno>5.6.3 </span>Dialogs implemented using separate documents</h4>
+  <h4 id=dialogs-implemented-using-separate-documents><span class=secno>5.7.3 </span>Dialogs implemented using separate documents</h4>
 
   <dl class=domintro><dt><var title="">result</var> = <var title="">window</var> . <code title=dom-showModalDialog><a href=#dom-showmodaldialog>showModalDialog</a></code>(<var title="">url</var> [, <var title="">argument</var>] )</dt>
 
@@ -43331,7 +43592,7 @@
 
 
 
-  <h3 id=system-state-and-capabilities><span class=secno>5.7 </span>System state and capabilities</h3>
+  <h3 id=system-state-and-capabilities><span class=secno>5.8 </span>System state and capabilities</h3>
 
   <div class=impl>
 
@@ -43393,7 +43654,7 @@
   </div>
 
 
-  <h4 id=client-identification><span class=secno>5.7.1 </span>Client identification</h4>
+  <h4 id=client-identification><span class=secno>5.8.1 </span>Client identification</h4>
 
   <p>In certain cases, despite the best efforts of the entire
   industry, Web browsers have bugs and limitations that Web authors
@@ -43463,7 +43724,7 @@
   </dl></div>
 
 
-  <h4 id=custom-handlers><span class=secno>5.7.2 </span>Custom protocol and content handlers</h4>
+  <h4 id=custom-handlers><span class=secno>5.8.2 </span>Custom protocol and content handlers</h4>
 
   <p>The <dfn id=dom-navigator-registerprotocolhandler title=dom-navigator-registerProtocolHandler><code>registerProtocolHandler()</code></dfn>
   method allows Web sites to register themselves as possible handlers
@@ -43645,7 +43906,7 @@
 
   <div class=impl>
 
-  <h5 id=security-and-privacy><span class=secno>5.7.2.1 </span>Security and privacy</h5>
+  <h5 id=security-and-privacy><span class=secno>5.8.2.1 </span>Security and privacy</h5>
 
   <p>These mechanisms can introduce a number of concerns, in
   particular privacy concerns.</p>
@@ -43729,7 +43990,7 @@
 
   <div class=impl>
 
-  <h5 id=sample-handler-impl><span class=secno>5.7.2.2 </span>Sample user interface</h5>
+  <h5 id=sample-handler-impl><span class=secno>5.8.2.2 </span>Sample user interface</h5>
 
   <p><em>This section is non-normative.</em></p>
 
@@ -43811,7 +44072,7 @@
 
 
 
-  <h4 id=manually-releasing-the-storage-mutex><span class=secno>5.7.3 </span>Manually releasing the storage mutex</h4>
+  <h4 id=manually-releasing-the-storage-mutex><span class=secno>5.8.3 </span>Manually releasing the storage mutex</h4>
 
   <dl class=domintro><dt><var title="">window</var> . <code title=dom-navigator><a href=#dom-navigator>navigator</a></code> . <code title=dom-navigator-getStorageUpdates><a href=#dom-navigator-getstorageupdates>getStorageUpdates</a></code>()</dt>
 
@@ -43844,9 +44105,9 @@
 
 
 
-  <h3 id=offline><span class=secno>5.8 </span>Offline Web applications</h3>
+  <h3 id=offline><span class=secno>5.9 </span>Offline Web applications</h3>
 
-  <h4 id=introduction-3><span class=secno>5.8.1 </span>Introduction</h4>
+  <h4 id=introduction-3><span class=secno>5.9.1 </span>Introduction</h4>
 
   <p><em>This section is non-normative.</em></p>
 
@@ -43855,7 +44116,7 @@
 
   <div class=impl>
 
-  <h4 id=appcache><span class=secno>5.8.2 </span>Application caches</h4>
+  <h4 id=appcache><span class=secno>5.9.2 </span>Application caches</h4>
 
   <p>An <dfn id=application-cache>application cache</dfn> is a set of cached resources
   consisting of:</p>
@@ -43981,10 +44242,10 @@
   </ul></div>
 
 
-  <h4 id=manifests><span class=secno>5.8.3 </span>The cache manifest syntax</h4>
+  <h4 id=manifests><span class=secno>5.9.3 </span>The cache manifest syntax</h4>
 
 
-  <h5 id=a-sample-manifest><span class=secno>5.8.3.1 </span>A sample manifest</h5>
+  <h5 id=a-sample-manifest><span class=secno>5.9.3.1 </span>A sample manifest</h5>
 
   <p><em>This section is non-normative.</em></p>
 
@@ -44020,7 +44281,7 @@
 style/default.css</pre>
 
 
-  <h5 id=writing-cache-manifests><span class=secno>5.8.3.2 </span>Writing cache manifests</h5>
+  <h5 id=writing-cache-manifests><span class=secno>5.9.3.2 </span>Writing cache manifests</h5>
 
   <p>Manifests must be served using the <code title="">text/cache-manifest</code> MIME type. All resources served
   using the <code title="">text/cache-manifest</code> MIME type must
@@ -44142,7 +44403,7 @@
 
   <div class=impl>
 
-  <h5 id=parsing-cache-manifests><span class=secno>5.8.3.3 </span>Parsing cache manifests</h5>
+  <h5 id=parsing-cache-manifests><span class=secno>5.9.3.3 </span>Parsing cache manifests</h5>
 
   <p>When a user agent is to <dfn id=parse-a-manifest>parse a manifest</dfn>, it means
   that the user agent must run the following steps:</p>
@@ -44381,7 +44642,7 @@
   will be ignored.</p>
 
 
-  <h4 id=updating-an-application-cache><span class=secno>5.8.4 </span>Updating an application cache</h4>
+  <h4 id=updating-an-application-cache><span class=secno>5.9.4 </span>Updating an application cache</h4>
 
   <p>When the user agent is required (by other parts of this
   specification) to start the <dfn id=application-cache-update-process>application cache update
@@ -44988,7 +45249,7 @@
 
 
 
-  <h4 id=matching-a-fallback-namespace><span class=secno>5.8.5 </span>Matching a fallback namespace</h4>
+  <h4 id=matching-a-fallback-namespace><span class=secno>5.9.5 </span>Matching a fallback namespace</h4>
 
   <p>A URL <dfn id=concept-appcache-matches-fallback title=concept-appcache-matches-fallback>matches a
   fallback namespace</dfn> if there exists a <a href=#relevant-application-cache>relevant
@@ -45016,7 +45277,7 @@
   </div>
 
 
-  <h4 id=the-application-cache-selection-algorithm><span class=secno>5.8.6 </span>The application cache selection algorithm</h4>
+  <h4 id=the-application-cache-selection-algorithm><span class=secno>5.9.6 </span>The application cache selection algorithm</h4>
 
   <p>When the <dfn id=concept-appcache-init title=concept-appcache-init>application cache
   selection algorithm</dfn> algorithm is invoked with a
@@ -45100,7 +45361,7 @@
 
    </dd>
 
-  </dl><h4 id=changesToNetworkingModel><span class=secno>5.8.7 </span>Changes to the networking model</h4>
+  </dl><h4 id=changesToNetworkingModel><span class=secno>5.9.7 </span>Changes to the networking model</h4>
 
   <p>When a <a href=#cache-host>cache host</a> is associated with an
   <a href=#application-cache>application cache</a> whose <a href=#concept-appcache-completeness title=concept-appcache-completeness>completeness flag</a> is
@@ -45159,7 +45420,7 @@
 
 
 
-  <h4 id=application-cache-api><span class=secno>5.8.8 </span>Application cache API</h4>
+  <h4 id=application-cache-api><span class=secno>5.9.8 </span>Application cache API</h4>
 
   <pre class=idl>interface <dfn id=applicationcache>ApplicationCache</dfn> {
 
@@ -45364,7 +45625,7 @@
   </table></div>
 
 
-  <h4 id=browser-state><span class=secno>5.8.9 </span>Browser state</h4>
+  <h4 id=browser-state><span class=secno>5.9.9 </span>Browser state</h4>
 
   <dl class=domintro><dt><var title="">window</var> . <code title=dom-navigator><a href=#dom-navigator>navigator</a></code> . <code title=dom-navigator-onLine><a href=#dom-navigator-online>onLine</a></code></dt>
 
@@ -45402,9 +45663,9 @@
 
 
 
-  <h3 id=history><span class=secno>5.9 </span>Session history and navigation</h3>
+  <h3 id=history><span class=secno>5.10 </span>Session history and navigation</h3>
 
-  <h4 id=the-session-history-of-browsing-contexts><span class=secno>5.9.1 </span>The session history of browsing contexts</h4>
+  <h4 id=the-session-history-of-browsing-contexts><span class=secno>5.10.1 </span>The session history of browsing contexts</h4>
 
   <p>The sequence of <code>Document</code>s in a <a href=#browsing-context>browsing
   context</a> is its <dfn id=session-history>session history</dfn>.</p>
@@ -45499,7 +45760,7 @@
   <code>Document</code> is evicted.</p>
 
 
-  <h4 id=the-history-interface><span class=secno>5.9.2 </span>The <code><a href=#history-1>History</a></code> interface</h4>
+  <h4 id=the-history-interface><span class=secno>5.10.2 </span>The <code><a href=#history-1>History</a></code> interface</h4>
 
   <pre class=idl>interface <dfn id=history-1>History</dfn> {
   readonly attribute long <a href=#dom-history-length title=dom-history-length>length</a>;
@@ -45688,7 +45949,7 @@
   </div>
 
 
-  <h4 id=activating-state-object-entries><span class=secno>5.9.3 </span><dfn title="activate the state object">Activating state object entries</dfn></h4>
+  <h4 id=activating-state-object-entries><span class=secno>5.10.3 </span><dfn title="activate the state object">Activating state object entries</dfn></h4>
 
   <div class=impl>
 
@@ -45763,7 +46024,7 @@
 
 
 
-  <h4 id=the-location-interface><span class=secno>5.9.4 </span>The <code><a href=#location>Location</a></code> interface</h4>
+  <h4 id=the-location-interface><span class=secno>5.10.4 </span>The <code><a href=#location>Location</a></code> interface</h4>
 
   <p>Each <code>Document</code> object in a <a href=#browsing-context>browsing
   context</a>'s session history is associated with a unique
@@ -45945,7 +46206,7 @@
 
   <div class=impl>
 
-  <h5 id=security-3><span class=secno>5.9.4.1 </span>Security</h5>
+  <h5 id=security-3><span class=secno>5.10.4.1 </span>Security</h5>
 
   <p>User agents must raise a <code><a href=#security_err>SECURITY_ERR</a></code> exception whenever
   any of the members of a <code><a href=#location>Location</a></code> object are accessed by
@@ -45965,7 +46226,7 @@
 
   <div class=impl>
 
-  <h4 id=history-notes><span class=secno>5.9.5 </span>Implementation notes for session history</h4>
+  <h4 id=history-notes><span class=secno>5.10.5 </span>Implementation notes for session history</h4>
   <!-- don't change the ID without updating multiple internal links -->
 
   <p><em>This section is non-normative.</em></p>
@@ -46004,11 +46265,11 @@
   </div>
 
 
-  <h3 id=browsing-the-web><span class=secno>5.10 </span>Browsing the Web</h3>
+  <h3 id=browsing-the-web><span class=secno>5.11 </span>Browsing the Web</h3>
 
   <div class=impl>
 
-  <h4 id=navigating-across-documents><span class=secno>5.10.1 </span>Navigating across documents</h4>
+  <h4 id=navigating-across-documents><span class=secno>5.11.1 </span>Navigating across documents</h4>
 
   <p>Certain actions cause the <a href=#browsing-context>browsing context</a> to
   <i><a href=#navigate>navigate</a></i> to a new resource. Navigation always involves
@@ -46364,7 +46625,7 @@
   source</a>.</p>
 
 
-  <h4 id=read-html><span class=secno>5.10.2 </span><dfn title=navigate-html>Page load processing model for HTML files</dfn></h4>
+  <h4 id=read-html><span class=secno>5.11.2 </span><dfn title=navigate-html>Page load processing model for HTML files</dfn></h4>
 
   <p>When an HTML document is to be loaded in a <a href=#browsing-context>browsing
   context</a>, the user agent must create a <code>Document</code>
@@ -46396,7 +46657,7 @@
 
 
 
-  <h4 id=read-xml><span class=secno>5.10.3 </span><dfn title=navigate-xml>Page load processing model for XML files</dfn></h4>
+  <h4 id=read-xml><span class=secno>5.11.3 </span><dfn title=navigate-xml>Page load processing model for XML files</dfn></h4>
 
   <p>When faced with displaying an XML file inline, user agents must
   first create a <code>Document</code> object, following the
@@ -46453,7 +46714,7 @@
   <code>Document</code>.</p>
 
 
-  <h4 id=read-text><span class=secno>5.10.4 </span><dfn title=navigate-text>Page load processing model for text files</dfn></h4>
+  <h4 id=read-text><span class=secno>5.11.4 </span><dfn title=navigate-text>Page load processing model for text files</dfn></h4>
 
   <p>When a plain text document is to be loaded in a <a href=#browsing-context>browsing
   context</a>, the user agent should create a <code>Document</code>
@@ -46495,7 +46756,7 @@
   etc.</p>
 
 
-  <h4 id=read-image><span class=secno>5.10.5 </span><dfn title=navigate-image>Page load processing model for images</dfn></h4>
+  <h4 id=read-image><span class=secno>5.11.5 </span><dfn title=navigate-image>Page load processing model for images</dfn></h4>
 
   <p>When an image resource is to be loaded in a <a href=#browsing-context>browsing
   context</a>, the user agent should create a <code>Document</code>
@@ -46528,7 +46789,7 @@
   script, to give the document a <code><a href=#the-title-element>title</a></code>, etc.</p>
 
 
-  <h4 id=read-plugin><span class=secno>5.10.6 </span><dfn title=navigate-plugin>Page load processing model for content that uses plugins</dfn></h4>
+  <h4 id=read-plugin><span class=secno>5.11.6 </span><dfn title=navigate-plugin>Page load processing model for content that uses plugins</dfn></h4>
 
   <p>When a resource that requires an external resource to be rendered
   is to be loaded in a <a href=#browsing-context>browsing context</a>, the user agent
@@ -46565,7 +46826,7 @@
   context</a>, the synthesized <code><a href=#the-embed-element>embed</a></code> element will <a href=#sandboxPluginEmbed>fail to render the content</a>.</p>
 
 
-  <h4 id=read-ua-inline><span class=secno>5.10.7 </span><dfn title=navigate-ua-inline>Page load processing model for inline content that doesn't have a DOM</dfn></h4>
+  <h4 id=read-ua-inline><span class=secno>5.11.7 </span><dfn title=navigate-ua-inline>Page load processing model for inline content that doesn't have a DOM</dfn></h4>
 
   <p>When the user agent is to display a user agent page inline in a
   <a href=#browsing-context>browsing context</a>, the user agent should create a
@@ -46593,7 +46854,7 @@
 
 
 
-  <h4 id=scroll-to-fragid><span class=secno>5.10.8 </span><dfn title=navigate-fragid>Navigating to a fragment identifier</dfn></h4>
+  <h4 id=scroll-to-fragid><span class=secno>5.11.8 </span><dfn title=navigate-fragid>Navigating to a fragment identifier</dfn></h4>
 
   <p>When a user agent is supposed to navigate to a fragment
   identifier, then the user agent must <a href=#queue-a-task>queue a task</a> to
@@ -46668,7 +46929,7 @@
   <i><a href=#target-element>target element</a></i>. <a href=#refsSELECTORS>[SELECTORS]</a></p>
 
 
-  <h4 id=history-traversal><span class=secno>5.10.9 </span>History traversal</h4>
+  <h4 id=history-traversal><span class=secno>5.11.9 </span>History traversal</h4>
 
   <p>When a user agent is required to <dfn id=traverse-the-history>traverse the history</dfn>
   to a <i>specified entry</i>, the user agent must act as
@@ -46765,7 +47026,7 @@
   </ol></div>
 
 
-  <h4 id=unloading-documents><span class=secno>5.10.10 </span>Unloading documents</h4>
+  <h4 id=unloading-documents><span class=secno>5.11.10 </span>Unloading documents</h4>
 
   <div class=impl>
 
@@ -46822,7 +47083,7 @@
    <li><p>If <var title="">salvageable</var> and <var title="">recycle</var> are both false, <a href=#discard-a-document title="discard a
    document">discard the <code>Document</code></a>.</li>
 
-  </ol><h5 id=event-definition><span class=secno>5.10.10.1 </span>Event definition</h5>
+  </ol><h5 id=event-definition><span class=secno>5.11.10.1 </span>Event definition</h5>
 
   </div>
 
@@ -46857,10 +47118,10 @@
 
 
 
-  <h3 id=links><span class=secno>5.11 </span>Links</h3>
+  <h3 id=links><span class=secno>5.12 </span>Links</h3>
 
 
-  <h4 id=hyperlink-elements><span class=secno>5.11.1 </span>Hyperlink elements</h4>
+  <h4 id=hyperlink-elements><span class=secno>5.12.1 </span>Hyperlink elements</h4>
 
   <p>The <code><a href=#the-a-element>a</a></code>, <code><a href=#the-area-element>area</a></code>, and <code><a href=#the-link-element>link</a></code>
   elements can, in certain situations described in the definitions of
@@ -46937,7 +47198,7 @@
 
   <div class=impl>
 
-  <h4 id=following-hyperlinks><span class=secno>5.11.2 </span><dfn>Following hyperlinks</dfn></h4>
+  <h4 id=following-hyperlinks><span class=secno>5.12.2 </span><dfn>Following hyperlinks</dfn></h4>
 
   <p>When a user <em>follows a hyperlink</em>, the user agent must
   <a href=#resolve-a-url title="resolve a url">resolve</a> the <a href=#url>URL</a>
@@ -46995,7 +47256,7 @@
   <a href=#source-browsing-context>source browsing context</a>.</p>
 
 
-  <h5 id=hyperlink-auditing><span class=secno>5.11.2.1 </span><dfn>Hyperlink auditing</dfn></h5>
+  <h5 id=hyperlink-auditing><span class=secno>5.12.2.1 </span><dfn>Hyperlink auditing</dfn></h5>
 
   <p>If an <code><a href=#the-a-element>a</a></code> or <code><a href=#the-area-element>area</a></code> hyperlink element has a
   <code title=attr-hyperlink-ping><a href=#ping>ping</a></code> attribute, and the
@@ -47125,7 +47386,7 @@
 
 
 
-  <h4 id=linkTypes><span class=secno>5.11.3 </span>Link types</h4>
+  <h4 id=linkTypes><span class=secno>5.12.3 </span>Link types</h4>
 
   <p>The following table summarizes the link types that are defined by
   this specification. This table is non-normative; the actual
@@ -47303,7 +47564,7 @@
     -->
 
 
-  <h5 id=link-type-alternate><span class=secno>5.11.3.1 </span>Link type "<dfn title=rel-alternate><code>alternate</code></dfn>"</h5>
+  <h5 id=link-type-alternate><span class=secno>5.12.3.1 </span>Link type "<dfn title=rel-alternate><code>alternate</code></dfn>"</h5>
 
   <p>The <code title=rel-alternate><a href=#link-type-alternate>alternate</a></code> keyword may be
   used with <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
@@ -47368,7 +47629,7 @@
   alternative representations of each other.</p>
 
 
-  <h5 id=link-type-archives><span class=secno>5.11.3.2 </span>Link type "<dfn title=rel-archives><code>archives</code></dfn>"</h5>
+  <h5 id=link-type-archives><span class=secno>5.12.3.2 </span>Link type "<dfn title=rel-archives><code>archives</code></dfn>"</h5>
 
   <p>The <code title=rel-archives><a href=#link-type-archives>archives</a></code> keyword may be
   used with <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
@@ -47390,7 +47651,7 @@
   </div>
 
 
-  <h5 id=link-type-author><span class=secno>5.11.3.3 </span>Link type "<dfn title=rel-author><code>author</code></dfn>"</h5>
+  <h5 id=link-type-author><span class=secno>5.12.3.3 </span>Link type "<dfn title=rel-author><code>author</code></dfn>"</h5>
 
   <p>The <code title=rel-author><a href=#link-type-author>author</a></code> keyword may be
   used with <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
@@ -47419,7 +47680,7 @@
   </div>
 
 
-  <h5 id=link-type-bookmark><span class=secno>5.11.3.4 </span>Link type "<dfn title=rel-bookmark><code>bookmark</code></dfn>"</h5>
+  <h5 id=link-type-bookmark><span class=secno>5.12.3.4 </span>Link type "<dfn title=rel-bookmark><code>bookmark</code></dfn>"</h5>
 
   <p>The <code title=rel-bookmark><a href=#link-type-bookmark>bookmark</a></code> keyword may be
   used with <code><a href=#the-a-element>a</a></code> and <code><a href=#the-area-element>area</a></code> elements.</p>
@@ -47485,7 +47746,7 @@
 -->
 
 
-  <h5 id=link-type-external><span class=secno>5.11.3.5 </span>Link type "<dfn title=rel-external><code>external</code></dfn>"</h5>
+  <h5 id=link-type-external><span class=secno>5.12.3.5 </span>Link type "<dfn title=rel-external><code>external</code></dfn>"</h5>
 
   <p>The <code title=rel-external><a href=#link-type-external>external</a></code> keyword may be
   used with <code><a href=#the-a-element>a</a></code> and <code><a href=#the-area-element>area</a></code> elements.</p>
@@ -47495,7 +47756,7 @@
   that the current document forms a part of.</p>
 
 
-  <h5 id=link-type-feed><span class=secno>5.11.3.6 </span>Link type "<dfn title=rel-feed><code>feed</code></dfn>"</h5>
+  <h5 id=link-type-feed><span class=secno>5.12.3.6 </span>Link type "<dfn title=rel-feed><code>feed</code></dfn>"</h5>
 
   <p>The <code title=rel-feed><a href=#link-type-feed>feed</a></code> keyword may be used with
   <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
@@ -47537,7 +47798,7 @@
   </div>
 
 
-  <h5 id=link-type-help><span class=secno>5.11.3.7 </span>Link type "<dfn title=rel-help><code>help</code></dfn>"</h5>
+  <h5 id=link-type-help><span class=secno>5.12.3.7 </span>Link type "<dfn title=rel-help><code>help</code></dfn>"</h5>
 
   <p>The <code title=rel-help><a href=#link-type-help>help</a></code> keyword may be used with
   <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
@@ -47562,7 +47823,7 @@
   document provides help for the page as a whole.</p>
 
 
-  <h5 id=rel-icon><span class=secno>5.11.3.8 </span>Link type "<dfn title=rel-icon><code>icon</code></dfn>"</h5>
+  <h5 id=rel-icon><span class=secno>5.12.3.8 </span>Link type "<dfn title=rel-icon><code>icon</code></dfn>"</h5>
 
   <p>The <code title=rel-icon><a href=#rel-icon>icon</a></code> keyword may be used with
   <code><a href=#the-link-element>link</a></code> elements, for which it creates an <a href=#external-resource-link title="external resource link">external resource link</a>.</p>
@@ -47688,7 +47949,7 @@
   </div>
 
 
-  <h5 id=link-type-license><span class=secno>5.11.3.9 </span>Link type "<dfn title=rel-license><code>license</code></dfn>"</h5>
+  <h5 id=link-type-license><span class=secno>5.12.3.9 </span>Link type "<dfn title=rel-license><code>license</code></dfn>"</h5>
 
   <p>The <code title=rel-license><a href=#link-type-license>license</a></code> keyword may be used
   with <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
@@ -47707,7 +47968,7 @@
   </div>
 
 
-  <h5 id=link-type-nofollow><span class=secno>5.11.3.10 </span>Link type "<dfn title=rel-nofollow><code>nofollow</code></dfn>"</h5>
+  <h5 id=link-type-nofollow><span class=secno>5.12.3.10 </span>Link type "<dfn title=rel-nofollow><code>nofollow</code></dfn>"</h5>
 
   <p>The <code title=rel-nofollow><a href=#link-type-nofollow>nofollow</a></code> keyword may be
   used with <code><a href=#the-a-element>a</a></code> and <code><a href=#the-area-element>area</a></code> elements.</p>
@@ -47719,7 +47980,7 @@
   affiliated with the two pages.</p>
 
 
-  <h5 id=link-type-noreferrer><span class=secno>5.11.3.11 </span>Link type "<dfn title=rel-noreferrer><code>noreferrer</code></dfn>"</h5>
+  <h5 id=link-type-noreferrer><span class=secno>5.12.3.11 </span>Link type "<dfn title=rel-noreferrer><code>noreferrer</code></dfn>"</h5>
 
   <p>The <code title=rel-noreferrer><a href=#link-type-noreferrer>noreferrer</a></code> keyword may be
   used with <code><a href=#the-a-element>a</a></code> and <code><a href=#the-area-element>area</a></code> elements.</p>
@@ -47741,7 +48002,7 @@
   </div>
 
 
-  <h5 id=link-type-pingback><span class=secno>5.11.3.12 </span>Link type "<dfn title=rel-pingback><code>pingback</code></dfn>"</h5>
+  <h5 id=link-type-pingback><span class=secno>5.12.3.12 </span>Link type "<dfn title=rel-pingback><code>pingback</code></dfn>"</h5>
 
   <p>The <code title=rel-pingback><a href=#link-type-pingback>pingback</a></code> keyword may be
   used with <code><a href=#the-link-element>link</a></code> elements, for which it creates an <a href=#external-resource-link title="external resource link">external resource link</a>.</p>
@@ -47750,7 +48011,7 @@
   specification. <a href=#refsPINGBACK>[PINGBACK]</a></p>
 
 
-  <h5 id=link-type-prefetch><span class=secno>5.11.3.13 </span>Link type "<dfn title=rel-prefetch><code>prefetch</code></dfn>"</h5>
+  <h5 id=link-type-prefetch><span class=secno>5.12.3.13 </span>Link type "<dfn title=rel-prefetch><code>prefetch</code></dfn>"</h5>
 
   <p>The <code title=rel-prefetch><a href=#link-type-prefetch>prefetch</a></code> keyword may be
   used with <code><a href=#the-link-element>link</a></code> elements, for which it creates an <a href=#external-resource-link title="external resource link">external resource link</a>.</p>
@@ -47763,7 +48024,7 @@
   <p>There is no default type for resources given by the <code title=rel-prefetch><a href=#link-type-prefetch>prefetch</a></code> keyword.</p>
 
 
-  <h5 id=link-type-search><span class=secno>5.11.3.14 </span>Link type "<dfn title=rel-search><code>search</code></dfn>"</h5>
+  <h5 id=link-type-search><span class=secno>5.12.3.14 </span>Link type "<dfn title=rel-search><code>search</code></dfn>"</h5>
 
   <p>The <code title=rel-search><a href=#link-type-search>search</a></code> keyword may be used
   with <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
@@ -47780,7 +48041,7 @@
   -->
 
 
-  <h5 id=link-type-stylesheet><span class=secno>5.11.3.15 </span>Link type "<dfn title=rel-stylesheet><code>stylesheet</code></dfn>"</h5>
+  <h5 id=link-type-stylesheet><span class=secno>5.12.3.15 </span>Link type "<dfn title=rel-stylesheet><code>stylesheet</code></dfn>"</h5>
 
   <p>The <code title=rel-stylesheet><a href=#link-type-stylesheet>stylesheet</a></code> keyword may be
   used with <code><a href=#the-link-element>link</a></code> elements, for which it creates an <a href=#external-resource-link title="external resource link">external resource link</a> that
@@ -47807,7 +48068,7 @@
   </div>
 
 
-  <h5 id=link-type-sidebar><span class=secno>5.11.3.16 </span>Link type "<dfn title=rel-sidebar><code>sidebar</code></dfn>"</h5>
+  <h5 id=link-type-sidebar><span class=secno>5.12.3.16 </span>Link type "<dfn title=rel-sidebar><code>sidebar</code></dfn>"</h5>
 
   <p>The <code title=rel-sidebar><a href=#link-type-sidebar>sidebar</a></code> keyword may be used
   with <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
@@ -47821,7 +48082,7 @@
   <p>A <a href=#hyperlink title=hyperlink>hyperlink element</a> with the <code title=rel-sidebar><a href=#link-type-sidebar>sidebar</a></code> keyword specified is a <dfn id=rel-sidebar-hyperlink title=rel-sidebar-hyperlink>sidebar hyperlink</dfn>.</p>
 
 
-  <h5 id=link-type-tag><span class=secno>5.11.3.17 </span>Link type "<dfn title=rel-tag><code>tag</code></dfn>"</h5>
+  <h5 id=link-type-tag><span class=secno>5.12.3.17 </span>Link type "<dfn title=rel-tag><code>tag</code></dfn>"</h5>
 
   <p>The <code title=rel-tag><a href=#link-type-tag>tag</a></code> keyword may be used
   with <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
@@ -47837,7 +48098,7 @@
   the popular tag across a set of pages.</p>
 
 
-  <h5 id=hierarchical-link-types><span class=secno>5.11.3.18 </span>Hierarchical link types</h5>
+  <h5 id=hierarchical-link-types><span class=secno>5.12.3.18 </span>Hierarchical link types</h5>
 
   <p>Some documents form part of a hierarchical structure of
   documents.</p>
@@ -47850,7 +48111,7 @@
   <p>A document may be part of multiple hierarchies.</p>
 
 
-  <h6 id=link-type-index><span class=secno>5.11.3.18.1 </span>Link type "<dfn title=rel-index><code>index</code></dfn>"</h6>
+  <h6 id=link-type-index><span class=secno>5.12.3.18.1 </span>Link type "<dfn title=rel-index><code>index</code></dfn>"</h6>
 
   <p>The <code title=rel-index><a href=#link-type-index>index</a></code> keyword may be used with
   <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
@@ -47870,7 +48131,7 @@
   </div>
 
 
-  <h6 id=link-type-up><span class=secno>5.11.3.18.2 </span>Link type "<dfn title=rel-up><code>up</code></dfn>"</h6>
+  <h6 id=link-type-up><span class=secno>5.12.3.18.2 </span>Link type "<dfn title=rel-up><code>up</code></dfn>"</h6>
 
   <p>The <code title=rel-up><a href=#link-type-up>up</a></code> keyword may be used with
   <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
@@ -47937,7 +48198,7 @@
   interface hides duplicates).</p>
 
 
-  <h5 id=sequential-link-types><span class=secno>5.11.3.19 </span>Sequential link types</h5>
+  <h5 id=sequential-link-types><span class=secno>5.12.3.19 </span>Sequential link types</h5>
 
   <p>Some documents form part of a sequence of documents.</p>
 
@@ -47949,7 +48210,7 @@
   <p>A document may be part of multiple sequences.</p>
 
 
-  <h6 id=link-type-first><span class=secno>5.11.3.19.1 </span>Link type "<dfn title=rel-first><code>first</code></dfn>"</h6>
+  <h6 id=link-type-first><span class=secno>5.12.3.19.1 </span>Link type "<dfn title=rel-first><code>first</code></dfn>"</h6>
 
   <p>The <code title=rel-first><a href=#link-type-first>first</a></code> keyword may be used with
   <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
@@ -47968,7 +48229,7 @@
   </div>
 
 
-  <h6 id=link-type-last><span class=secno>5.11.3.19.2 </span>Link type "<dfn title=rel-last><code>last</code></dfn>"</h6>
+  <h6 id=link-type-last><span class=secno>5.12.3.19.2 </span>Link type "<dfn title=rel-last><code>last</code></dfn>"</h6>
 
   <p>The <code title=rel-last><a href=#link-type-last>last</a></code> keyword may be used with
   <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
@@ -47987,7 +48248,7 @@
   </div>
 
 
-  <h6 id=link-type-next><span class=secno>5.11.3.19.3 </span>Link type "<dfn title=rel-next><code>next</code></dfn>"</h6>
+  <h6 id=link-type-next><span class=secno>5.12.3.19.3 </span>Link type "<dfn title=rel-next><code>next</code></dfn>"</h6>
 
   <p>The <code title=rel-next><a href=#link-type-next>next</a></code> keyword may be used with
   <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
@@ -47998,7 +48259,7 @@
   document that is the next logical document in the sequence.</p>
 
 
-  <h6 id=link-type-prev><span class=secno>5.11.3.19.4 </span>Link type "<dfn title=rel-prev><code>prev</code></dfn>"</h6>
+  <h6 id=link-type-prev><span class=secno>5.12.3.19.4 </span>Link type "<dfn title=rel-prev><code>prev</code></dfn>"</h6>
 
   <p>The <code title=rel-prev><a href=#link-type-prev>prev</a></code> keyword may be used with
   <code><a href=#the-link-element>link</a></code>, <code><a href=#the-a-element>a</a></code>, and <code><a href=#the-area-element>area</a></code>
@@ -48017,7 +48278,7 @@
   </div>
 
 
-  <h5 id=other-link-types><span class=secno>5.11.3.20 </span>Other link types</h5>
+  <h5 id=other-link-types><span class=secno>5.12.3.20 </span>Other link types</h5>
 
   <p>Other than the types defined above, only types defined as
   extensions in the <a href=http://wiki.whatwg.org/wiki/RelExtensions>WHATWG Wiki
@@ -64503,89 +64764,10 @@
 
 
 
-  <h3 id=timers><span class=secno>12.3 </span>Timers</h3>
 
-  <p class=XXX>This section is expected to be moved to its own
-  specification in due course. It needs a lot of work to actually make
-  it into a semi-decent spec.</p>
 
-  <p>Objects that implement the <code><a href=#window>Window</a></code> interface must
-  also implement the <code><a href=#windowtimers>WindowTimers</a></code> interface:</p>
+  <h3 id=rendering-and-the-dom><span class=secno>12.3 </span>Rendering and the DOM</h3>
 
-<pre class=idl>[NoInterfaceObject, ImplementedOn=<a href=#window>Window</a>] interface <dfn id=windowtimers>WindowTimers</dfn> {
-  // timers<!-- XXX use [Variadic], [Optional] from WebIDL -->
-  long <a href=#dom-windowtimers-settimeout title=dom-windowtimers-setTimeout>setTimeout</a>(in <a href=#timeouthandler>TimeoutHandler</a> handler, in long timeout);
-  long <a href=#dom-windowtimers-settimeout title=dom-windowtimers-setTimeout>setTimeout</a>(in <a href=#timeouthandler>TimeoutHandler</a> handler, in long timeout, <var title="">arguments...</var>);
-  long <a href=#dom-windowtimers-settimeout title=dom-windowtimers-setTimeout>setTimeout</a>(in DOMString code, in long timeout);
-  long <a href=#dom-windowtimers-settimeout title=dom-windowtimers-setTimeout>setTimeout</a>(in DOMString code, in long timeout, in DOMString language);
-  void <a href=#dom-windowtimers-cleartimeout title=dom-windowtimers-clearTimeout>clearTimeout</a>(in long handle);
-  long <a href=#dom-windowtimers-setinterval title=dom-windowtimers-setInterval>setInterval</a>(in <a href=#timeouthandler>TimeoutHandler</a> handler, in long timeout);
-  long <a href=#dom-windowtimers-setinterval title=dom-windowtimers-setInterval>setInterval</a>(in <a href=#timeouthandler>TimeoutHandler</a> handler, in long timeout, <var title="">arguments...</var>);
-  long <a href=#dom-windowtimers-setinterval title=dom-windowtimers-setInterval>setInterval</a>(in DOMString code, in long timeout);
-  long <a href=#dom-windowtimers-setinterval title=dom-windowtimers-setInterval>setInterval</a>(in DOMString code, in long timeout, in DOMString language);
-  void <a href=#dom-windowtimers-clearinterval title=dom-windowtimers-clearInterval>clearInterval</a>(in long handle);
-};
-
-[Callback=FunctionOnly, NoInterfaceObject]
-interface <dfn id=timeouthandler>TimeoutHandler</dfn> {
-  void <span title=dom-TimeoutHandler-handleEvent>handleEvent</span>([Variadic] in any args);
-};</pre>
-
-  <p>The <code title=dom-windowtimers-setTimeout><a href=#dom-windowtimers-settimeout>setTimeout</a></code>
-  and <code title=dom-windowtimers-setInterval><a href=#dom-windowtimers-setinterval>setInterval</a></code>
-  methods allow authors to schedule timer-based events.</p>
-
-  <p>The <dfn id=dom-windowtimers-settimeout title=dom-windowtimers-setTimeout><code>setTimeout(<var title="">handler</var>, <var title="">timeout</var>[, <var title="">arguments...</var>])</code></dfn> method takes a reference
-  to a <code><a href=#timeouthandler>TimeoutHandler</a></code> object and a length of time in
-  milliseconds. It must return a handle to the timeout created, and
-  then asynchronously wait <var title="">timeout</var> milliseconds
-  and then <a href=#queue-a-task>queue a task</a> to invoke
-  <code>handleEvent()</code> on the <var title="">handler</var>
-  object. If any <var title="">arguments...</var> were provided, they
-  must be passed to the <var title="">handler</var> as arguments to
-  the <code>handleEvent()</code> function.</p>
-
-  <p>Alternatively, <dfn title=""><code>setTimeout(<var title="">code</var>, <var title="">timeout</var>[, <var title="">language</var>])</code></dfn> may be used. This variant
-  takes a string instead of a <code><a href=#timeouthandler>TimeoutHandler</a></code>
-  object. <span class=XXX>define the actual requirements for
-  this method, as with the previous one.</span> That string must be
-  parsed using the specified <var title="">language</var> (defaulting
-  to JavaScript if the third argument is omitted) and executed in the
-  scope of the <a href=#browsing-context>browsing context</a> associated with the
-  <code><a href=#window>Window</a></code> object on which the <code title=setTimeout>setTimeout()</code> method was invoked.</p>
-
-  <p class=XXX>Need to define <var title="">language</var> values;
-  need to define that the <a href=#concept-script title=concept-script>script</a>
-  corresponding to the <var title="">code</var> argument is created
-  before the timer is set up, so that the rule on pausing the ticker,
-  below, makes sense.</p>
-
-  <p>The <dfn id=dom-windowtimers-setinterval title=dom-windowtimers-setInterval><code>setInterval(...)</code></dfn>
-  variants must work in the same way as the <code>setTimeout</code>
-  variants except that if <var title="">timeout</var> is a value
-  greater than zero, the <a href=#concept-task title=concept-task>task</a> that
-  invokes the <var title="">handler</var> or <code><a href=#the-code-element>code</a></code> must be
-  <a href=#queue-a-task title="queue a task">queued</a> again every <var title="">timeout</var> milliseconds, not just the once.</p> <!-- so
-  setInterval(x) and setInterval(x, 0) are equivalent to setTimeout(x)
-  and setTimeout(x, 0) respectively -->
-
-  <p>The <dfn id=dom-windowtimers-cleartimeout title=dom-windowtimers-clearTimeout><code>clearTimeout()</code></dfn>
-  and <dfn id=dom-windowtimers-clearinterval title=dom-windowtimers-clearInterval><code>clearInterval()</code></dfn>
-  methods take one integer (the value returned by <code title=dom-windowtimers-setTimeout><a href=#dom-windowtimers-settimeout>setTimeout()</a></code> and <code title=dom-windowtimers-setInterval><a href=#dom-windowtimers-setinterval>setInterval()</a></code>
-  respectively) and must cancel the specified timeout. When called
-  with a value that does not correspond to an active timeout or
-  interval, the methods must return without doing anything.</p>
-
-  <p>For both <code title=dom-windowtimers-setTimeout><a href=#dom-windowtimers-settimeout>setTimeout()</a></code> and <code title=dom-windowtimers-setInterval><a href=#dom-windowtimers-setinterval>setInterval()</a></code>, the clock
-  upon which the timers are based must only tick while the
-  <code>Document</code> of the <a href="#script's-global-object" title="script's global
-  object">global object</a> of their callbacks is <a href=#fully-active>fully
-  active</a>.</p>
-
-
-
-  <h3 id=rendering-and-the-dom><span class=secno>12.4 </span>Rendering and the DOM</h3>
-
   <p class=XXX>This section is expected to be moved to its own
   specification in due course. It needs a lot of work to actually make
   it into a semi-decent spec.</p>

Modified: source
===================================================================
--- source	2009-05-03 07:59:56 UTC (rev 3067)
+++ source	2009-05-04 06:10:31 UTC (rev 3068)
@@ -48535,7 +48535,332 @@
   </div>
 
 
+  <h3 id="timers">Timers</h3>
 
+  <p>The <code title="dom-windowtimers-setTimeout">setTimeout()</code>
+  and <code title="dom-windowtimers-setInterval">setInterval()</code>
+  methods allow authors to schedule timer-based callbacks.</p>
+
+<!-- HereBeDragons is just meant to prevent this from compiling in random WebIDL implementations -->
+<pre class="idl">[HereBeDragons, NoInterfaceObject] interface <dfn>WindowTimers</dfn> {
+  long <span title="dom-windowtimers-setTimeout">setTimeout</span>(in any handler, [Optional] in any timeout, [Variadic] in any args);
+  void <span title="dom-windowtimers-clearTimeout">clearTimeout</span>(in long handle);
+  long <span title="dom-windowtimers-setInterval">setInterval</span>(in any handler, [Optional] in any timeout, [Variadic] in any args);
+  void <span title="dom-windowtimers-clearInterval">clearInterval</span>(in long handle);
+};</pre>
+
+  <dl class="domintro">
+
+   <dt><var title="">handle</var> = <var title="">window</var> . <code title="dom-windowtimers-setTimeout">setTimeout</code>( <var title="">handler</var> [, <var title="">timeout</var> [, <var title="">arguments</var> ] ] )</dt>
+
+   <dd>
+
+    <p>Schedules a timeout to run <var title="">handler</var> after
+    <var title="">timeout</var> milliseconds. Any <var
+    title="">arguments</var> are passed straight through to the <var
+    title="">handler</var>.</p>
+
+   </dd>
+
+   <dt><var title="">handle</var> = <var title="">window</var> . <code title="dom-windowtimers-setTimeout">setTimeout</code>( <var title="">code</var> [, <var title="">timeout</var> ] )</dt>
+
+   <dd>
+
+    <p>Schedules a timeout to compile and run <var title="">code</var>
+    after <var title="">timeout</var> milliseconds.</p>
+
+   </dd>
+
+   <dt><var title="">handle</var> = <var title="">window</var> . <code title="dom-windowtimers-setInterval">setInterval</code>( <var title="">handler</var> [, <var title="">timeout</var> [, <var title="">arguments</var> ] ] )</dt>
+
+   <dd>
+
+    <p>Schedules a timeout to run <var title="">handler</var> every
+    <var title="">timeout</var> milliseconds. Any <var
+    title="">arguments</var> are passed straight through to the <var
+    title="">handler</var>.</p>
+
+   </dd>
+
+   <dt><var title="">handle</var> = <var title="">window</var> . <code title="dom-windowtimers-setInterval">setInterval</code>( <var title="">code</var> [, <var title="">timeout</var> ] )</dt>
+
+   <dd>
+
+    <p>Schedules a timeout to compile and run <var title="">code</var>
+    every <var title="">timeout</var> milliseconds.</p>
+
+   </dd>
+
+  </dl>
+
+  <p class="note">This API does not guarantee that timers will fire
+  exactly on schedule. Delays due to CPU load, other tasks, etc, are
+  to be expected.</p>
+
+  <div class="impl">
+
+  <p>The <code>WindowTimers</code> interface must be implemented by
+  objects implementing the <code>Window</code> object. (It is also
+  implemented by objects implementing the <code>WorkerUtils</code>
+  interface as part of Web Workers.)</p>
+
+  <p>Each object that implements the <code>WindowTimers</code>
+  interface has a <dfn>list of active timeouts</dfn> and a <dfn>list
+  of active intervals</dfn>. Each entry in these lists is identified
+  by a number, which must be unique within its list for the lifetime
+  of the object that implements the <code>WindowTimers</code>
+  interface.</p>
+
+  <hr>
+
+  <p>The <dfn
+  title="dom-windowtimers-setTimeout"><code>setTimeout()</code></dfn>
+  method must run the following steps:
+
+  <ol>
+
+   <li><p><span>Get the timed task</span>, and let <var
+   title="">task</var> be the result.</p></li>
+
+   <li><p><span>Get the timeout</span>, and let <var
+   title="">timeout</var> be the result.</p></li>
+
+   <li><p>If the currently running <span
+   title="concept-task">task</span> is a task that was created by
+   either the <code
+   title="dom-windowtimers-setTimeout">setTimeout()</code> method, and
+   <var title="">timeout</var> is less than 4, then increase <var
+   title="">timeout</var> to 4.</p></li>
+
+   <li><p>Add an entry to the <span>list of active timeouts</span>,
+   identified by a user-agent defined integer that is greater than
+   zero.</p></li>
+
+   <li><p>Return the number identifying the newly added entry in the
+   <span>list of active timeouts</span>, and then continue running
+   this algorithm asynchronously.</p></li>
+
+   <li>
+
+    <p>If <var title="">context</var> is a <code>Window</code> object,
+    wait until the <code>Document</code> associated with <var
+    title="">context</var> has been <span>fully active</span> for a
+    further <var title="">timeout</var> milliseconds (not necessarily
+    consecutively).</p>
+
+    <p>Otherwise, if <var title="">context</var> is a
+    <code>WorkerUtils</code> object, wait until <var
+    title="">timeout</var> milliseconds have passed with the worker
+    not suspended (not necessarily consecutively).</p>
+
+    <p>Otherwise, act as described in the specification that defines
+    that the <code>WindowTimers</code> interface is implemented by
+    some other object.</p>
+
+   </li>
+
+   <li><p>Wait until any invocations of this algorithm started before
+   this one whose <var title="">timeout</var> is equal to or less than
+   this one's have completed.</p></li>
+
+   <li><p>If the entry in the <span>list of active timeouts</span>
+   that was added in the earlier step has been cleared, then abort
+   this algorithm.</p></li>
+
+   <li><p><span title="queue a task">Queue</span> the <var
+   title="">task</var> <span
+   title="concept-task">task</span>.</p></li>
+
+  </ol>
+
+  <p>The <dfn
+  title="dom-windowtimers-clearTimeout"><code>clearTimeout()</code></dfn>
+  method must clear the entry identified as <var title="">handle</var>
+  from the <span>list of active timeouts</span> of the
+  <code>WindowTimers</code> object on which the method was invoked,
+  where <var title="">handle</var> is the argument passed to the
+  method.</p>
+
+  <hr>
+
+  <p>The <dfn
+  title="dom-windowtimers-setInterval"><code>setInterval()</code></dfn>
+  method must run the following steps:
+
+  <ol>
+
+   <li><p><span>Get the timed task</span>, and let <var
+   title="">task</var> be the result.</p></li>
+
+   <li><p><span>Get the timeout</span>, and let <var
+   title="">timeout</var> be the result.</p></li>
+
+   <li><p>If <var title="">timeout</var> is less than 10, then
+   increase <var title="">timeout</var> to 10.</p></li> <!-- (but see
+   note below about IE) -->
+
+   <li><p>Add an entry to the <span>list of active intervals</span>,
+   identified by a user-agent defined integer that is greater than
+   zero.</p></li>
+
+   <li><p>Return the number identifying the newly added entry in the
+   <span>list of active intervals</span>, and then continue running
+   this algorithm asynchronously.</p></li>
+
+   <!-- Note: IE doesn't actually run intervals with duration zero, it
+   aborts roughly here in the algorithm for them. -->
+
+   <li>
+
+    <p><i>Wait:</i> If <var title="">context</var> is a
+    <code>Window</code> object, wait until the <code>Document</code>
+    associated with <var title="">context</var> has been <span>fully
+    active</span> for a further <var title="">interval</var>
+    milliseconds (not necessarily consecutively).</p>
+
+    <p>Otherwise, if <var title="">context</var> is a
+    <code>WorkerUtils</code> object, wait until <var
+    title="">interval</var> milliseconds have passed with the worker
+    not suspended (not necessarily consecutively).</p>
+
+    <p>Otherwise, act as described in the specification that defines
+    that the <code>WindowTimers</code> interface is implemented by
+    some other object.</p>
+
+   </li>
+
+   <li><p>If the entry in the <span>list of active intervals</span>
+   that was added in the earlier step has been cleared, then abort
+   this algorithm.</p></li>
+
+   <li><p><span title="queue a task">Queue</span> the <var
+   title="">task</var> <span
+   title="concept-task">task</span>.</p></li>
+
+   <li><p>Return to the step labeled <i>wait</i>.</p></li>
+
+  </ol>
+
+  <p>The <dfn
+  title="dom-windowtimers-clearInterval"><code>clearInterval()</code></dfn>
+  method must clear the entry identified as <var title="">handle</var>
+  from the <span>list of active intervals</span> of the
+  <code>WindowTimers</code> object on which the method was invoked,
+  where <var title="">handle</var> is the argument passed to the
+  method.</p>
+
+  <hr>
+
+  <p>When the above methods are to <dfn>get the timed task</dfn>, they
+  must run the following steps:</p>
+
+  <ol>
+
+   <li>
+  
+    <p>If the first argument to the method is an object that has an
+    internal [[Call]] method, then return a <span
+    title="concept-task">task</span> that calls that [[Call]] method
+    with as its arguments the third and subsequent arguments to the
+    method (if any), and aborth these steps.</p>
+
+    <p>Otherwise, continue with the remaining steps.</p>
+ 
+   </li>
+
+   <li><p>Apply the ToString() conversion operator to the first
+   argument to the method, and let <var title="">script source</var>
+   be the result.</p></li>
+
+   <li><p>Let <var title="">script language</var> be
+   JavaScript.</p></li>
+
+   <li><p>Let <var title="">context</var> be the object on which the
+   method is implemented (a <code>Window</code> or
+   <code>WorkerUtils</code> object).</p></li>
+
+   <li>
+
+    <p>If <var title="">context</var> is a <code>Window</code> object,
+    let <var title="">global object</var> be <var
+    title="">context</var>, let <var title="">browsing context</var>
+    be the <span>browsing context</span> with which <var
+    title="">global object</var> is associated, let <var
+    title="">character encoding</var> be the <span title="document's
+    character encoding">character encoding</span> of the
+    <code>Document</code> associated with <var title="">global
+    object</var> (<a href="#sce-not-copy">this is a reference, not a
+    copy</a>), and let <var title="">base URL</var> be the <span
+    title="document base URL">base URL</span> of the
+    <code>Document</code> associated with <var title="">global
+    object</var> (<a href="#sbu-not-copy">this is a reference, not a
+    copy</a>).</p>
+
+    <p>Otherwise, if <var title="">context</var> is a
+    <code>WorkerUtils</code> object, let <var title="">global
+    object</var>, <var title="">browsing context</var>, <var
+    title="">character encoding</var>, and <var title="">base
+    URL</var> be the <span>script's global object</span>,
+    <span>script's browsing context</span>, <span>script's URL
+    character encoding</span>, and <span>script's base URL</span>
+    (respectively) of the <span title="concept-script">script</span>
+    that the <span>run a worker</span> algorithm created when it
+    created <var title="">context</var>.</p>
+
+    <p>Otherwise, act as described in the specification that defines
+    that the <code>WindowTimers</code> interface is implemented by
+    some other object.</p>
+
+   </li>
+
+   <li><p>Return a <span title="concept-task">task</span> that <span
+   title="create a script">creates a script</span> using <var
+   title="">script source</var> as the script source, <var
+   title="">scripting language</var> as the scripting language, <var
+   title="">global object</var> as the global object, <var
+   title="">browsing context</var> as the browsing context, <var
+   title="">character encoding</var> as the character encoding, and
+   <var title="">base URL</var> as the base URL.</p></li>
+
+  </ol>
+
+  <p>When the above methods are to <dfn>get the timeout</dfn>, they
+  must run the following steps:</p>
+
+  <ol>
+
+   <li><p>Let <var title="">timeout</var> be the second argument to
+   the method, or zero if the argument was omitted.</p></li>
+
+   <li><p>Apply the ToString() conversion operator to <var
+   title="">timeout</var>, and let <var title="">timeout</var>
+   be the result.</p></li>
+
+   <li><p>Apply the ToNumber() conversion operator to <var
+   title="">timeout</var>, and let <var title="">timeout</var> be the
+   result.</p></li>
+
+   <li><p>If <var title="">timeout</var> is not a number (NaN), not
+   finite (Infinity), or negative, let <var title="">timeout</var> be
+   zero.</p></li>
+
+   <li><p>Round <var title="">timeout</var> down to the nearest
+   integer, and let <var title="">timeout</var> be the
+   result.</p></li>
+
+   <li><p>Return <var title="">timeout</var>.</p></li>
+
+  </ol>
+
+  <hr>
+
+  <p>The <span>task source</span> for these tasks is the <dfn>timer
+  task source</dfn>.</p>
+
+  </div>
+
+
+
   <h3>User prompts</h3>
 
   <!--
@@ -75676,101 +76001,8 @@
 
 
 
-  <h3 id="timers">Timers</h3>
 
-  <p class="XXX">This section is expected to be moved to its own
-  specification in due course. It needs a lot of work to actually make
-  it into a semi-decent spec.</p>
 
-  <p>Objects that implement the <code>Window</code> interface must
-  also implement the <code>WindowTimers</code> interface:</p>
-
-<pre class="idl">[NoInterfaceObject, ImplementedOn=<span>Window</span>] interface <dfn>WindowTimers</dfn> {
-  // timers<!-- XXX use [Variadic], [Optional] from WebIDL -->
-  long <span title="dom-windowtimers-setTimeout">setTimeout</span>(in <span>TimeoutHandler</span> handler, in long timeout);
-  long <span title="dom-windowtimers-setTimeout">setTimeout</span>(in <span>TimeoutHandler</span> handler, in long timeout, <var title="">arguments...</var>);
-  long <span title="dom-windowtimers-setTimeout">setTimeout</span>(in DOMString code, in long timeout);
-  long <span title="dom-windowtimers-setTimeout">setTimeout</span>(in DOMString code, in long timeout, in DOMString language);
-  void <span title="dom-windowtimers-clearTimeout">clearTimeout</span>(in long handle);
-  long <span title="dom-windowtimers-setInterval">setInterval</span>(in <span>TimeoutHandler</span> handler, in long timeout);
-  long <span title="dom-windowtimers-setInterval">setInterval</span>(in <span>TimeoutHandler</span> handler, in long timeout, <var title="">arguments...</var>);
-  long <span title="dom-windowtimers-setInterval">setInterval</span>(in DOMString code, in long timeout);
-  long <span title="dom-windowtimers-setInterval">setInterval</span>(in DOMString code, in long timeout, in DOMString language);
-  void <span title="dom-windowtimers-clearInterval">clearInterval</span>(in long handle);
-};
-
-[Callback=FunctionOnly, NoInterfaceObject]
-interface <dfn>TimeoutHandler</dfn> {
-  void <span title="dom-TimeoutHandler-handleEvent">handleEvent</span>([Variadic] in any args);
-};</pre>
-
-  <p>The <code title="dom-windowtimers-setTimeout">setTimeout</code>
-  and <code title="dom-windowtimers-setInterval">setInterval</code>
-  methods allow authors to schedule timer-based events.</p>
-
-  <p>The <dfn
-  title="dom-windowtimers-setTimeout"><code>setTimeout(<var
-  title="">handler</var>, <var title="">timeout</var>[, <var
-  title="">arguments...</var>])</code></dfn> method takes a reference
-  to a <code>TimeoutHandler</code> object and a length of time in
-  milliseconds. It must return a handle to the timeout created, and
-  then asynchronously wait <var title="">timeout</var> milliseconds
-  and then <span>queue a task</span> to invoke
-  <code>handleEvent()</code> on the <var title="">handler</var>
-  object. If any <var title="">arguments...</var> were provided, they
-  must be passed to the <var title="">handler</var> as arguments to
-  the <code>handleEvent()</code> function.</p>
-
-  <p>Alternatively, <dfn title=""><code>setTimeout(<var
-  title="">code</var>, <var title="">timeout</var>[, <var
-  title="">language</var>])</code></dfn> may be used. This variant
-  takes a string instead of a <code>TimeoutHandler</code>
-  object. <span class="XXX">define the actual requirements for
-  this method, as with the previous one.</span> That string must be
-  parsed using the specified <var title="">language</var> (defaulting
-  to JavaScript if the third argument is omitted) and executed in the
-  scope of the <span>browsing context</span> associated with the
-  <code>Window</code> object on which the <code
-  title="setTimeout">setTimeout()</code> method was invoked.</p>
-
-  <p class="XXX">Need to define <var title="">language</var> values;
-  need to define that the <span title="concept-script">script</span>
-  corresponding to the <var title="">code</var> argument is created
-  before the timer is set up, so that the rule on pausing the ticker,
-  below, makes sense.</p>
-
-  <p>The <dfn
-  title="dom-windowtimers-setInterval"><code>setInterval(...)</code></dfn>
-  variants must work in the same way as the <code>setTimeout</code>
-  variants except that if <var title="">timeout</var> is a value
-  greater than zero, the <span title="concept-task">task</span> that
-  invokes the <var title="">handler</var> or <code>code</code> must be
-  <span title="queue a task">queued</span> again every <var
-  title="">timeout</var> milliseconds, not just the once.</p> <!-- so
-  setInterval(x) and setInterval(x, 0) are equivalent to setTimeout(x)
-  and setTimeout(x, 0) respectively -->
-
-  <p>The <dfn
-  title="dom-windowtimers-clearTimeout"><code>clearTimeout()</code></dfn>
-  and <dfn
-  title="dom-windowtimers-clearInterval"><code>clearInterval()</code></dfn>
-  methods take one integer (the value returned by <code
-  title="dom-windowtimers-setTimeout">setTimeout()</code> and <code
-  title="dom-windowtimers-setInterval">setInterval()</code>
-  respectively) and must cancel the specified timeout. When called
-  with a value that does not correspond to an active timeout or
-  interval, the methods must return without doing anything.</p>
-
-  <p>For both <code
-  title="dom-windowtimers-setTimeout">setTimeout()</code> and <code
-  title="dom-windowtimers-setInterval">setInterval()</code>, the clock
-  upon which the timers are based must only tick while the
-  <code>Document</code> of the <span title="script's global
-  object">global object</span> of their callbacks is <span>fully
-  active</span>.</p>
-
-
-
   <h3>Rendering and the DOM</h3>
 
   <p class="XXX">This section is expected to be moved to its own




More information about the Commit-Watchers mailing list