[html5] r1461 - /

whatwg at whatwg.org whatwg at whatwg.org
Fri Apr 18 16:44:33 PDT 2008


Author: ianh
Date: 2008-04-18 16:44:32 -0700 (Fri, 18 Apr 2008)
New Revision: 1461

Modified:
   index
   source
Log:
[] (0) Define document.readyState

Modified: index
===================================================================
--- index	2008-04-18 22:34:05 UTC (rev 1460)
+++ index	2008-04-18 23:44:32 UTC (rev 1461)
@@ -2601,6 +2601,7 @@
            attribute DOMString <a href="#charset0" title=dom-document-charset>charset</a>;
   readonly attribute DOMString <a href="#characterset" title=dom-document-characterSet>characterSet</a>;
   readonly attribute DOMString <a href="#defaultcharset" title=dom-document-defaultCharset>defaultCharset</a>;
+  readonly attribute DOMString <a href="#readystate" title=dom-document-readyState>readyState</a>;
 
   // <a href="#dom-tree0">DOM tree accessors</a>
            attribute DOMString <a href="#document.title" title=dom-document-title>title</a>;
@@ -2645,7 +2646,6 @@
   DOMString <a href="#querycommandvalue" title=dom-document-queryCommandValue>queryCommandValue</a>(in DOMString commandId);
   <a href="#selection1">Selection</a> <a href="#getselection0" title=dom-document-getSelection>getSelection</a>();
 <!-- XXX we're not done here.
- readonly attribute DOMString readyState;
  readonly attribute HTMLCollection scripts;
 -->
 };</pre>
@@ -2835,6 +2835,22 @@
    with the user's current geographical location, or any arbitrary encoding
    name.
 
+  <p>Each document has a <dfn id=current>current document readiness</dfn>.
+   When a <code>Document</code> object is created, it must have its <a
+   href="#current">current document readiness</a> set to the string
+   "loading". Various algorithms during page loading affect this value. When
+   the value is set, the user agent must <a href="#firing2">fire a simple
+   event</a> called <code
+   title=event-readystatechanged>readystatechanged</code> at the
+   <code>Document</code> object.</p>
+  <!-- XXX define
+  document.onreadystatechange -->
+
+  <p>The <dfn id=readystate
+   title=dom-document-readyState><code>readyState</code></dfn> DOM attribute
+   must, on getting, return the <a href="#current">current document
+   readiness</a>.
+
   <h3 id=elements><span class=secno>2.2 </span>Elements</h3>
 
   <p>The nodes representing <a href="#html-elements">HTML elements</a> in the
@@ -3876,7 +3892,7 @@
     <ol>
      <li>Remove all the entries in the <a href="#browsing0">browsing
       context</a>'s <a href="#session">session history</a> after the <a
-      href="#current0">current entry</a> in its <code>Document</code>'s
+      href="#current1">current entry</a> in its <code>Document</code>'s
       <code><a href="#history1">History</a></code> object
 
      <li>Remove any earlier entries that share the same <code>Document</code>
@@ -14289,19 +14305,19 @@
 
   <p>When a <code><a href="#video1">video</a></code> element is <a
    href="#actively">actively playing</a>, it represents the frame of video at
-   the continuously increasing <a href="#current" title="current playback
-   position">"current" position</a>. When the <a href="#current">current
+   the continuously increasing <a href="#current0" title="current playback
+   position">"current" position</a>. When the <a href="#current0">current
    playback position</a> changes such that the last frame rendered is no
-   longer the frame corresponding to the <a href="#current">current playback
+   longer the frame corresponding to the <a href="#current0">current playback
    position</a> in the video, the new frame must be rendered. Similarly, any
    audio associated with the video must, if played, be played synchronised
-   with the <a href="#current">current playback position</a>, at the
+   with the <a href="#current0">current playback position</a>, at the
    specified <a href="#volume" title=dom-media-volume>volume</a> with the
    specified <a href="#muted" title=dom-media-muted>mute state</a>.
 
   <p>When a <code><a href="#video1">video</a></code> element is <a
    href="#paused" title=dom-media-paused>paused</a>, the element represents
-   the frame of video corresponding to the <a href="#current" title="current
+   the frame of video corresponding to the <a href="#current0" title="current
    playback position">current playback position</a>, or, if that is not
    available yet (e.g. because the video is seeking or buffering), the last
    rendered frame of video.
@@ -14474,9 +14490,9 @@
 
   <p>When an <code><a href="#audio1">audio</a></code> element is <a
    href="#actively">actively playing</a>, it must have its audio data played
-   synchronised with the <a href="#current">current playback position</a>, at
-   the specified <a href="#volume" title=dom-media-volume>volume</a> with the
-   specified <a href="#muted" title=dom-media-muted>mute state</a>.
+   synchronised with the <a href="#current0">current playback position</a>,
+   at the specified <a href="#volume" title=dom-media-volume>volume</a> with
+   the specified <a href="#muted" title=dom-media-muted>mute state</a>.
 
   <p>When an <code><a href="#audio1">audio</a></code> element is not <a
    href="#actively">actively playing</a>, audio must not play for the
@@ -14521,7 +14537,7 @@
   const unsigned short <a href="#canshowcurrentframe" title=dom-media-CAN_SHOW_CURRENT_FRAME>CAN_SHOW_CURRENT_FRAME</a> = 1;
   const unsigned short <a href="#canplay" title=dom-media-CAN_PLAY>CAN_PLAY</a> = 2;
   const unsigned short <a href="#canplaythrough" title=dom-media-CAN_PLAY_THROUGH>CAN_PLAY_THROUGH</a> = 3;
-  readonly attribute unsigned short <a href="#readystate" title=dom-media-readyState>readyState</a>;
+  readonly attribute unsigned short <a href="#readystate0" title=dom-media-readyState>readyState</a>;
   readonly attribute boolean <a href="#seeking0" title=dom-media-seeking>seeking</a>;
 
   // playback state
@@ -14875,7 +14891,7 @@
      title="">events</var> list-->.
 
      <li>If <code title=dom-media-readyState><a
-      href="#readystate">readyState</a></code> is not set to <code
+      href="#readystate0">readyState</a></code> is not set to <code
       title=dom-media-DATA_UNAVAILABLE><a
       href="#dataunavailable">DATA_UNAVAILABLE</a></code>, it must be set to
       that state<!-- and the user agent must add <code
@@ -14891,7 +14907,7 @@
      <li>If <code title=dom-media-seeking><a
       href="#seeking0">seeking</a></code> is true, it must be set to false.
 
-     <li>The <a href="#current">current playback position</a> must be set to
+     <li>The <a href="#current0">current playback position</a> must be set to
       0.
 
      <li>The <code title=dom-media-currentLoop><a
@@ -15115,7 +15131,7 @@
 
       <ol>
        <li>
-        <p>The <a href="#current">current playback position</a> must be set
+        <p>The <a href="#current0">current playback position</a> must be set
          to the <var><a href="#effective">effective start</a></var>.
 
        <li>
@@ -15161,7 +15177,7 @@
 
        <li>
         <p>The <code title=dom-media-readyState><a
-         href="#readystate">readyState</a></code> attribute must change to
+         href="#readystate0">readyState</a></code> attribute must change to
          <code title=dom-media-CAN_SHOW_CURRENT_FRAME><a
          href="#canshowcurrentframe">CAN_SHOW_CURRENT_FRAME</a></code>.
 
@@ -15244,12 +15260,12 @@
    href="#media5">media element</a>.
 
   <p><a href="#media5" title="media element">Media elements</a> have a <dfn
-   id=current>current playback position</dfn>, which must initially be zero.
+   id=current0>current playback position</dfn>, which must initially be zero.
    The current position is a time.
 
   <p>The <dfn id=currenttime
    title=dom-media-currentTime><code>currentTime</code></dfn> attribute must,
-   on getting, return the <a href="#current">current playback position</a>,
+   on getting, return the <a href="#current0">current playback position</a>,
    expressed in seconds. On setting, the user agent must <a href="#seek"
    title=dom-media-seek>seek</a> to the new value (which might raise an
    exception).
@@ -15382,7 +15398,7 @@
    <li>
     <p>If the <code title=dom-media-currentLoop><a
      href="#currentloop">currentLoop</a></code> is zero, and the <a
-     href="#current">current playback position</a> is before the <var><a
+     href="#current0">current playback position</a> is before the <var><a
      href="#effective">effective start</a></var>, the user agent must <a
      href="#seek" title=dom-media-seek>seek</a> to the <var><a
      href="#effective">effective start</a></var>.
@@ -15390,7 +15406,7 @@
    <li>
     <p>If the <code title=dom-media-currentLoop><a
      href="#currentloop">currentLoop</a></code> is greater than zero, and the
-     <a href="#current">current playback position</a> is before the <var><a
+     <a href="#current0">current playback position</a> is before the <var><a
      href="#effective0">effective loop start</a></var>, the user agent must
      <a href="#seek" title=dom-media-seek>seek</a> to the <var><a
      href="#effective0">effective loop start</a></var>.
@@ -15400,7 +15416,7 @@
      href="#currentloop">currentLoop</a></code> is less than <span><code
      title=dom-media-playCount><a
      href="#playcount0">playCount</a></code>-1</span>, and the <a
-     href="#current">current playback position</a> is after the <var><a
+     href="#current0">current playback position</a> is after the <var><a
      href="#effective1">effective loop end</a></var>, the user agent must <a
      href="#seek" title=dom-media-seek>seek</a> to the <var><a
      href="#effective0">effective loop start</a></var>, and increase <code
@@ -15412,7 +15428,7 @@
      href="#currentloop">currentLoop</a></code> is equal to <span><code
      title=dom-media-playCount><a
      href="#playcount0">playCount</a></code>-1</span>, and the <a
-     href="#current">current playback position</a> is after the <var><a
+     href="#current0">current playback position</a> is after the <var><a
      href="#effective2">effective end</a></var>, the user agent must <a
      href="#seek" title=dom-media-seek>seek</a> to the <var><a
      href="#effective2">effective end</a></var> and then the looping will
@@ -15423,7 +15439,7 @@
 
   <p><a href="#media5" title="media element">Media elements</a> have a
    <em>ready state</em>, which describes to what degree they are ready to be
-   rendered at the <a href="#current">current playback position</a>. The
+   rendered at the <a href="#current0">current playback position</a>. The
    possible values are as follows; the ready state of a media element at any
    particular time is the greatest value describing the state of the element:
 
@@ -15432,7 +15448,7 @@
     title=dom-media-DATA_UNAVAILABLE><code>DATA_UNAVAILABLE</code></dfn>
     (numeric value 0)
 
-   <dd>No data for the <a href="#current">current playback position</a> is
+   <dd>No data for the <a href="#current0">current playback position</a> is
     available. <a href="#media5" title="media element">Media elements</a>
     whose <code title=dom-media-networkState><a
     href="#networkstate">networkState</a></code> attribute is less than <code
@@ -15445,42 +15461,42 @@
     title=dom-media-CAN_SHOW_CURRENT_FRAME><code>CAN_SHOW_CURRENT_FRAME</code></dfn>
     (numeric value 1)
 
-   <dd>Data for the immediate <a href="#current">current playback
+   <dd>Data for the immediate <a href="#current0">current playback
     position</a> is available, but not enough data is available that the user
-    agent could successfully advance the <a href="#current">current playback
+    agent could successfully advance the <a href="#current0">current playback
     position</a> at all without immediately reverting to the <code
     title=dom-media-DATA_UNAVAILABLE><a
     href="#dataunavailable">DATA_UNAVAILABLE</a></code> state. In video, this
     corresponds to the user agent having data from the current frame, but not
     the next frame. In audio, this corresponds to the user agent only having
-    audio up to the <a href="#current">current playback position</a>, but no
+    audio up to the <a href="#current0">current playback position</a>, but no
     further.
 
    <dt><dfn id=canplay title=dom-media-CAN_PLAY><code>CAN_PLAY</code></dfn>
     (numeric value 2)
 
-   <dd>Data for the immediate <a href="#current">current playback
+   <dd>Data for the immediate <a href="#current0">current playback
     position</a> is available, as well as enough data for the user agent to
-    advance the <a href="#current">current playback position</a> at least a
+    advance the <a href="#current0">current playback position</a> at least a
     little without immediately reverting to the <code
     title=dom-media-DATA_UNAVAILABLE><a
     href="#dataunavailable">DATA_UNAVAILABLE</a></code> state. In video, this
     corresponds to the user agent having data for the current frame and the
     next frame. In audio, this corresponds ot the user agent having data
-    beyond the <a href="#current">current playback position</a>.
+    beyond the <a href="#current0">current playback position</a>.
 
    <dt><dfn id=canplaythrough
     title=dom-media-CAN_PLAY_THROUGH><code>CAN_PLAY_THROUGH</code></dfn>
     (numeric value 3)
 
-   <dd>Data for the immediate <a href="#current">current playback
+   <dd>Data for the immediate <a href="#current0">current playback
     position</a> is available, as well as enough data for the user agent to
-    advance the <a href="#current">current playback position</a> at least a
+    advance the <a href="#current0">current playback position</a> at least a
     little without immediately reverting to the <code
     title=dom-media-DATA_UNAVAILABLE><a
     href="#dataunavailable">DATA_UNAVAILABLE</a></code> state, and, in
     addition, the user agent estimates that data is being downloaded at a
-    rate where the <a href="#current">current playback position</a>, if it
+    rate where the <a href="#current0">current playback position</a>, if it
     were to advance at the rate given by the <code
     title=dom-media-defaultPlaybackRate><a
     href="#defaultplaybackrate">defaultPlaybackRate</a></code> attribute,
@@ -15566,7 +15582,7 @@
    is reached as part of the <code title=dom-media-load><a
    href="#load">load()</a></code> method's processing.
 
-  <p>The <dfn id=readystate
+  <p>The <dfn id=readystate0
    title=dom-media-readyState><code>readyState</code></dfn> DOM attribute
    must, on getting, return the value described above that describes the
    current ready state of the <a href="#media5">media element</a>.
@@ -15593,7 +15609,7 @@
    id=actively>actively playing</dfn> when its <code
    title=dom-media-paused><a href="#paused">paused</a></code> attribute is
    false, the <code title=dom-media-readyState><a
-   href="#readystate">readyState</a></code> attribute is either <code
+   href="#readystate0">readyState</a></code> attribute is either <code
    title=dom-media-CAN_PLAY><a href="#canplay">CAN_PLAY</a></code> or <code
    title=dom-media-CAN_PLAY_THROUGH><a
    href="#canplaythrough">CAN_PLAY_THROUGH</a></code>, the element has not <a
@@ -15607,7 +15623,7 @@
    href="#networkstate">networkState</a></code> attribute is <code
    title=dom-media-LOADED_METADATA><a
    href="#loadedmetadata">LOADED_METADATA</a></code> or greater, the <a
-   href="#current">current playback position</a> is equal to the <var><a
+   href="#current0">current playback position</a> is equal to the <var><a
    href="#effective2">effective end</a></var> of the <a href="#media8">media
    resource</a>, and the <code title=dom-media-currentLoop><a
    href="#currentloop">currentLoop</a></code> attribute is equal to
@@ -15623,13 +15639,13 @@
    agent <a href="#non-fatal-media-error">encounters a non-fatal error</a>
    during the processing of the <a href="#media7">media data</a>, and due to
    that error, is not able to play the content at the <a
-   href="#current">current playback position</a>.
+   href="#current0">current playback position</a>.
 
   <p>A <a href="#media5">media element</a> is said to have <dfn
    id=paused0>paused for user interaction</dfn> when its <code
    title=dom-media-paused><a href="#paused">paused</a></code> attribute is
    false, the <code title=dom-media-readyState><a
-   href="#readystate">readyState</a></code> attribute is either <code
+   href="#readystate0">readyState</a></code> attribute is either <code
    title=dom-media-CAN_PLAY><a href="#canplay">CAN_PLAY</a></code> or <code
    title=dom-media-CAN_PLAY_THROUGH><a
    href="#canplaythrough">CAN_PLAY_THROUGH</a></code> and the user agent has
@@ -15645,7 +15661,7 @@
    title=dom-ownerDocument>owner <code>Document</code></span><!-- XXX
   xref -->
    is an <a href="#active">active document</a>, its <a
-   href="#current">current playback position</a> must increase monotonically
+   href="#current0">current playback position</a> must increase monotonically
    at <code title=dom-media-playbackRate><a
    href="#playbackrate">playbackRate</a></code> units of media time per unit
    time of wall clock time. If this value is not 1, the user agent may apply
@@ -15657,12 +15673,12 @@
    element</a> could play in a non-linear fashion. If this happens, the user
    agent must act as if the algorithm for <a href="#seek"
    title=dom-media-seek>seeking</a> was used whenever the <a
-   href="#current">current playback position</a> changes in a discontinuous
+   href="#current0">current playback position</a> changes in a discontinuous
    fashion (so that the relevant events fire).
 
   <p>When a <a href="#media5">media element</a> that is <a
    href="#actively">actively playing</a> stops playing because its <code
-   title=dom-media-readyState><a href="#readystate">readyState</a></code>
+   title=dom-media-readyState><a href="#readystate0">readyState</a></code>
    attribute changes to a value lower than <code title=dom-media-CAN_PLAY><a
    href="#canplay">CAN_PLAY</a></code>, without the element having <a
    href="#ended">ended playback</a>, or playback having <a
@@ -15685,7 +15701,7 @@
    href="#currentloop">currentLoop</a></code> is less than <span><code
    title=dom-media-playCount><a
    href="#playcount0">playCount</a></code>-1</span> and the <a
-   href="#current">current playback position</a> reaches the <var><a
+   href="#current0">current playback position</a> reaches the <var><a
    href="#effective1">effective loop end</a></var>, then the user agent must
    <a href="#seek" title=dom-media-seek>seek</a> to the <var><a
    href="#effective0">effective loop start</a></var>, increase <code
@@ -15697,7 +15713,7 @@
    href="#currentloop">currentLoop</a></code> is equal to the <span><code
    title=dom-media-playCount><a
    href="#playcount0">playCount</a></code>-1</span> and the <a
-   href="#current">current playback position</a> reaches the <var><a
+   href="#current0">current playback position</a> reaches the <var><a
    href="#effective2">effective end</a></var>, then the user agent must
    follow these steps:
 
@@ -15929,7 +15945,7 @@
      of a DOM attribute), and abort these steps.
 
    <li>
-    <p>The <a href="#current">current playback position</a> must be set to
+    <p>The <a href="#current0">current playback position</a> must be set to
      the given <var title="">new playback position</var>.
 
    <li>
@@ -15994,13 +16010,13 @@
 
    <dt>An "enter" callback
 
-   <dd>A callback that is called when the <a href="#current">current playback
-    position</a> enters the range.
+   <dd>A callback that is called when the <a href="#current0">current
+    playback position</a> enters the range.
 
    <dt>An "exit" callback
 
-   <dd>A callback that is called when the <a href="#current">current playback
-    position</a> exits the range.
+   <dd>A callback that is called when the <a href="#current0">current
+    playback position</a> exits the range.
 
    <dt>An "active" boolean
 
@@ -16020,7 +16036,7 @@
    boolean with the same value as <var title="">pauseOnExit</var>, the
    "enter" callback <var title="">enterCallback</var>, the "exit" callback
    <var title="">exitCallback</var>, and an "active" boolean that is true if
-   the <a href="#current">current playback position</a> is equal to or
+   the <a href="#current0">current playback position</a> is equal to or
    greater than the start time and less than the end time, and false
    otherwise.
 
@@ -16031,10 +16047,10 @@
    href="#media5">media element</a> which have the class name <var
    title="">className</var>.
 
-  <p>When the <a href="#current">current playback position</a> of a <a
+  <p>When the <a href="#current0">current playback position</a> of a <a
    href="#media5">media element</a> changes (e.g. due to playback or
    seeking), the user agent must run the following steps. If the <a
-   href="#current">current playback position</a> changes while the steps are
+   href="#current0">current playback position</a> changes while the steps are
    running, then the user agent must wait for the steps to complete, and then
    must immediately rerun the steps. (These steps are thus run as often as
    possible or needed — if one iteration takes a long time, this can
@@ -16047,8 +16063,8 @@
      href="#cue-ranges0" title="cue range">cue ranges</a>, initialised to
      contain all the <a href="#cue-ranges0" title="cue range">cue ranges</a>
      of the <a href="#media5">media element</a> whose start times are less
-     than or equal to the <a href="#current">current playback position</a>
-     and whose end times are greater than the <a href="#current">current
+     than or equal to the <a href="#current0">current playback position</a>
+     and whose end times are greater than the <a href="#current0">current
      playback position</a>, in the order they were added to the element.
 
    <li>
@@ -16426,7 +16442,7 @@
       the user agent expects that frame to become available in due course.
 
      <td><code title=dom-media-readyState><a
-      href="#readystate">readyState</a></code> is either <code
+      href="#readystate0">readyState</a></code> is either <code
       title=dom-media-DATA_UNAVAILABLE><a
       href="#dataunavailable">DATA_UNAVAILABLE</a></code> or <code
       title=dom-media-CAN_SHOW_CURRENT_FRAME><a
@@ -16434,7 +16450,7 @@
       <code title=dom-media-paused><a href="#paused">paused</a></code> is
       false. Either <code title=dom-media-seeking><a
       href="#seeking0">seeking</a></code> is true, or the <a
-      href="#current">current playback position</a> is not contained in any
+      href="#current0">current playback position</a> is not contained in any
       of the ranges in <code title=dom-media-buffered><a
       href="#buffered">buffered</a></code>. It is possible for playback to
       stop for two other reasons without <code title=dom-media-paused><a
@@ -16449,7 +16465,7 @@
 
      <td><code>Event</code>
 
-     <td>The <a href="#current">current playback position</a> changed in an
+     <td>The <a href="#current0">current playback position</a> changed in an
       interesting way, for example discontinuously.
 
      <td>
@@ -16474,11 +16490,11 @@
      <td><code>Event</code>
 
      <td>The user agent cannot render the data at the <a
-      href="#current">current playback position</a> because data for the
+      href="#current0">current playback position</a> because data for the
       current frame is not immediately available.
 
      <td>The <code title=dom-media-readyState><a
-      href="#readystate">readyState</a></code> attribute is newly equal to
+      href="#readystate0">readyState</a></code> attribute is newly equal to
       <code title=DATA_UNAVAILABLE>DATA_UNAVAILABLE</code>.
 
     <tr>
@@ -16488,11 +16504,11 @@
      <td><code>Event</code>
 
      <td>The user agent cannot render the data after the <a
-      href="#current">current playback position</a> because data for the next
-      frame is not immediately available.
+      href="#current0">current playback position</a> because data for the
+      next frame is not immediately available.
 
      <td>The <code title=dom-media-readyState><a
-      href="#readystate">readyState</a></code> attribute is newly equal to
+      href="#readystate0">readyState</a></code> attribute is newly equal to
       <code title=dom-media-CAN_SHOW_CURRENT_FRAME><a
       href="#canshowcurrentframe">CAN_SHOW_CURRENT_FRAME</a></code>.
 
@@ -16508,7 +16524,7 @@
       buffering of content.
 
      <td>The <code title=dom-media-readyState><a
-      href="#readystate">readyState</a></code> attribute is newly equal to
+      href="#readystate0">readyState</a></code> attribute is newly equal to
       <code title=dom-media-CAN_PLAY><a href="#canplay">CAN_PLAY</a></code>.
 
     <tr>
@@ -16523,7 +16539,7 @@
       further buffering.
 
      <td>The <code title=dom-media-readyState><a
-      href="#readystate">readyState</a></code> attribute is newly equal to
+      href="#readystate0">readyState</a></code> attribute is newly equal to
       <code title=dom-media-CAN_PLAY_THROUGH><a
       href="#canplaythrough">CAN_PLAY_THROUGH</a></code>.
 
@@ -29460,9 +29476,9 @@
    activated.
 
   <p>At any point, one of the entries in the session history is the <dfn
-   id=current0>current entry</dfn>. This is the entry representing the <a
+   id=current1>current entry</dfn>. This is the entry representing the <a
    href="#active">active document</a> of the <a href="#browsing0">browsing
-   context</a>. The <a href="#current0">current entry</a> is usually an entry
+   context</a>. The <a href="#current1">current entry</a> is usually an entry
    for the <a href="#href5" title=dom-location-href>location</a> of the
    <code>Document</code>. However, it can also be one of the entries for <a
    href="#state" title="state object">state objects</a> added to the history
@@ -29480,7 +29496,7 @@
    contiguous by definition.
 
   <p>User agents may <dfn id=discard>discard</dfn> the DOMs of entries other
-   than the <a href="#current0">current entry</a> that are not referenced
+   than the <a href="#current1">current entry</a> that are not referenced
    from any script, reloading the pages afresh when the user or script
    navigates back to such pages. This specification does not specify when
    user agents should discard pages' DOMs and when they should cache them.
@@ -29534,7 +29550,7 @@
    title="">delta</var>)</code></dfn> method causes the UA to move the number
    of steps specified by <var title="">delta</var> in the session history.
 
-  <p>If the index of the <a href="#current0">current entry</a> plus <var
+  <p>If the index of the <a href="#current1">current entry</a> plus <var
    title="">delta</var> is less than zero or greater than or equal to the <a
    href="#length7" title=dom-history-length>number of items in the session
    history</a>, then the user agent must do nothing.
@@ -29547,7 +29563,7 @@
    href="#browsing0">browsing context</a> to <a href="#traverse">traverse the
    history</a> to the specified entry, as described below. The <dfn
    id=specified>specified entry</dfn> is the one whose index equals the index
-   of the <a href="#current0">current entry</a> plus <var
+   of the <a href="#current1">current entry</a> plus <var
    title="">delta</var>.
 
   <p>When a user agent is required to <dfn id=traverse>traverse the
@@ -29565,7 +29581,7 @@
      <code>Document</code> object and so this step gets skipped.
 
    <li>
-    <p>If appropriate, update the <a href="#current0">current entry</a> in
+    <p>If appropriate, update the <a href="#current1">current entry</a> in
      the <a href="#browsing0">browsing context</a>'s <code>Document</code>
      object's <code><a href="#history1">History</a></code> object to reflect
      any state that the user agent wishes to persist.</p>
@@ -29575,7 +29591,7 @@
 
    <li>
     <p>If the <a href="#specified">specified entry</a> has a different
-     <code>Document</code> object than the <a href="#current0">current
+     <code>Document</code> object than the <a href="#current1">current
      entry</a> then the user agent must run the following substeps:</p>
 
     <ol>
@@ -29590,7 +29606,7 @@
       context</a>), and the <a href="#origin0">origin</a> of the
       <code>Document</code> of the <a href="#specified">specified entry</a>
       is not the same as the <a href="#origin0">origin</a> of the
-      <code>Document</code> of the <a href="#current0">current entry</a>,
+      <code>Document</code> of the <a href="#current1">current entry</a>,
       then the following sub-sub-steps must be run:
       <ol>
        <li>The current <a href="#browsing1">browsing context name</a> must be
@@ -29598,7 +29614,7 @@
         <code>Document</code> objects with the same <a
         href="#origin0">origin</a> as the <a href="#active">active
         document</a> <em>and</em> that are contiguous with the <a
-        href="#current0">current entry</a>.
+        href="#current1">current entry</a>.
 
        <li id=resetBCName>The browsing context's <a
         href="#browsing1">browsing context name</a> must be unset.
@@ -29640,7 +29656,7 @@
      then the user agent must iterate through every entry between that <a
      href="#last-activated">last activated entry</a> and the <a
      href="#specified">specified entry</a>, starting with the entry closest
-     to the <a href="#current0">current entry</a>, and ending with the one
+     to the <a href="#current1">current entry</a>, and ending with the one
      closest to the <a href="#specified">specified entry</a>. For each entry,
      if the entry is a state object, the user agent must <a
      href="#activating0">activate the state object</a>.
@@ -29653,7 +29669,7 @@
 
    <li>
     <p>If the <a href="#specified">specified entry</a> has a URI that differs
-     from the <a href="#current0">current entry</a>'s only by its fragment
+     from the <a href="#current1">current entry</a>'s only by its fragment
      identifier, and the two share the same <code>Document</code> object,
      then <a href="#firing2">fire a simple event</a> with the name
      <code>hashchanged</code> at <a href="#the-body1">the <code>body</code>
@@ -29666,7 +29682,7 @@
      values of form fields, etc.
 
    <li>
-    <p>The <a href="#current0">current entry</a> is now the <a
+    <p>The <a href="#current1">current entry</a> is now the <a
      href="#specified">specified entry</a>.
   </ol>
 
@@ -29734,16 +29750,16 @@
   <p>If the third argument passes its verification step, or if the third
    argument was omitted, then the user agent must remove from the <a
    href="#session">session history</a> any entries for that
-   <code>Document</code> from the entry after the <a href="#current0">current
+   <code>Document</code> from the entry after the <a href="#current1">current
    entry</a> up to the last entry in the session history that references the
    same <code>Document</code> object, if any. If the <a
-   href="#current0">current entry</a> is the last entry in the session
-   history, or if there are no entries after the <a href="#current0">current
+   href="#current1">current entry</a> is the last entry in the session
+   history, or if there are no entries after the <a href="#current1">current
    entry</a> that reference the same <code>Document</code> object, then no
    entries are removed.
 
   <p>Then, the user agent must add a state object entry to the session
-   history, after the <a href="#current0">current entry</a>, with the
+   history, after the <a href="#current1">current entry</a>, with the
    specified <var title="">data</var> as the state object, the given <var
    title="">title</var> as the title, and, if the third argument is present,
    the given <var title="">url</var> as the URI of the entry.
@@ -29752,7 +29768,7 @@
    href="#last-activated">last activated entry</a> for the
    <code>Document</code>.
 
-  <p>Finally, the user agent must update the <a href="#current0">current
+  <p>Finally, the user agent must update the <a href="#current1">current
    entry</a> to be the this newly added entry.
 
   <p class=note>The <var title="">title</var> is purely advisory. User agents
@@ -29775,8 +29791,8 @@
    <code>Document</code> object up to the last entry that references that
    same <code>Document</code> object, if any.
 
-  <p>Then, if the <a href="#current0">current entry</a> was removed in the
-   previous step, the <a href="#current0">current entry</a> must be set to
+  <p>Then, if the <a href="#current1">current entry</a> was removed in the
+   previous step, the <a href="#current1">current entry</a> must be set to
    the last entry for that <code>Document</code> object in the session
    history.
 
@@ -29851,7 +29867,7 @@
 
   <p><code><a href="#location2">Location</a></code> objects provide a
    representation of the URI of their document, and allow the <a
-   href="#current0">current entry</a> of the <a href="#browsing0">browsing
+   href="#current1">current entry</a> of the <a href="#browsing0">browsing
    context</a>'s session history to be changed, by adding or replacing
    entries in the <code title=dom-history><a
    href="#history0">history</a></code> object.
@@ -30238,7 +30254,7 @@
      <dd>
       <ol>
        <li>
-        <p>Remove all the entries after the <a href="#current0">current
+        <p>Remove all the entries after the <a href="#current1">current
          entry</a> in the <a href="#browsing0">browsing context</a>'s
          <code>Document</code> object's <code><a
          href="#history1">History</a></code> object.</p>
@@ -30258,7 +30274,7 @@
        <li>
         <p>If the navigation was initiated with <dfn
          id=replacement>replacement enabled</dfn>, remove the entry
-         immediately before the new <a href="#current0">current entry</a> in
+         immediately before the new <a href="#current1">current entry</a> in
          the session history.
       </ol>
     </dl>
@@ -30368,7 +30384,7 @@
   <p>The rules for how to convert the bytes of the plain text document into
    actual characters are defined in RFC 2046, RFC 2646, and subsequent
    versions thereof. <a href="#refsRFC2046">[RFC2046]</a> <a
-   href="#refsRFC2046">[RFC2646]</a>
+   href="#refsRFC2646">[RFC2646]</a>
 
   <p>The <a href="#character1">document's character encoding</a> must be set
    to the character encoding used to decode the document.
@@ -34667,13 +34683,13 @@
       <code>effectAllowed</code> value</a>
 
      <td>Reject <a href="#immediate">immediate user selection</a> as
-      potential <a href="#current1" title="current target element">target
+      potential <a href="#current2" title="current target element">target
       element</a>
 
     <tr>
      <td><dfn id=dragleave title=event-dragleave><code>dragleave</code></dfn>
 
-     <td><a href="#current1" title="current target element">Previous target
+     <td><a href="#current2" title="current target element">Previous target
       element</a>
 
      <td>&#x2713; Bubbles
@@ -34691,7 +34707,7 @@
     <tr>
      <td><dfn id=dragover title=event-dragover><code>dragover</code></dfn>
 
-     <td><a href="#current1">Current target element</a>
+     <td><a href="#current2">Current target element</a>
 
      <td>&#x2713; Bubbles
 
@@ -34704,12 +34720,12 @@
      <td><a href="#dropEffect-initialisation">Based on
       <code>effectAllowed</code> value</a>
 
-     <td>Reset the <a href="#current2">current drag operation</a> to "none"
+     <td>Reset the <a href="#current3">current drag operation</a> to "none"
 
     <tr>
      <td><dfn id=drop title=event-drop><code>drop</code></dfn>
 
-     <td><a href="#current1">Current target element</a>
+     <td><a href="#current2">Current target element</a>
 
      <td>&#x2713; Bubbles
 
@@ -34720,7 +34736,7 @@
 
      <td><a href="#effectAllowed-initialisation">Same as last event</a>
 
-     <td><a href="#current2">Current drag operation</a>
+     <td><a href="#current3">Current drag operation</a>
 
      <td>Varies
 
@@ -34737,7 +34753,7 @@
 
      <td><a href="#effectAllowed-initialisation">Same as last event</a>
 
-     <td><a href="#current2">Current drag operation</a>
+     <td><a href="#current3">Current drag operation</a>
 
      <td>Varies
   </table>
@@ -34766,7 +34782,7 @@
    href="#drag">drag</a></code>, and <code title=event-dragleave><a
    href="#dragleave">dragleave</a></code> events (except when stated
    otherwise in the algorithms given in the sections below), to the value
-   corresponding to the <a href="#current2">current drag operation</a> for
+   corresponding to the <a href="#current3">current drag operation</a> for
    <code title=event-drop><a href="#drop">drop</a></code> and <code
    title=event-dragend><a href="#dragend">dragend</a></code> events, and to a
    value based on the <code title=dom-DataTransfer-effectAllowed><a
@@ -34960,23 +34976,23 @@
    selection</dfn>. (Only elements can be selected by the user; other nodes
    must not be made available as drop targets.) However, the <a
    href="#immediate">immediate user selection</a> is not necessarily the <dfn
-   id=current1>current target element</dfn>, which is the element currently
+   id=current2>current target element</dfn>, which is the element currently
    selected for the drop part of the drag-and-drop operation. The <a
    href="#immediate">immediate user selection</a> changes as the user selects
    different elements (either by pointing at them with a pointing device, or
-   by selecting them in some other way). The <a href="#current1">current
+   by selecting them in some other way). The <a href="#current2">current
    target element</a> changes when the <a href="#immediate">immediate user
    selection</a> changes, based on the results of event handlers in the
    document, as described below.
 
-  <p>Both the <a href="#current1">current target element</a> and the <a
+  <p>Both the <a href="#current2">current target element</a> and the <a
    href="#immediate">immediate user selection</a> can be null, which means no
    target element is selected. They can also both be elements in other
    (DOM-based) documents, or other (non-Web) programs altogether. (For
    example, a user could drag text to a word-processor.) The <a
-   href="#current1">current target element</a> is initially null.
+   href="#current2">current target element</a> is initially null.
 
-  <p>In addition, there is also a <dfn id=current2>current drag
+  <p>In addition, there is also a <dfn id=current3>current drag
    operation</dfn>, which can take on the values "none", "copy", "link", and
    "move". Initially it has the value "none". It is updated by the user agent
    as described in the steps below.
@@ -34992,7 +35008,7 @@
     <p>First, the user agent must fire a <code title=event-drag><a
      href="#drag">drag</a></code> event at the <a href="#source1">source
      node</a>. If this event is canceled, the user agent must set the <a
-     href="#current2">current drag operation</a> to none (no drag operation).</p>
+     href="#current3">current drag operation</a> to none (no drag operation).</p>
 
    <li>
     <p>Next, if the <code title=event-drag><a href="#drag">drag</a></code>
@@ -35006,15 +35022,15 @@
        href="#immediate">immediate user selection</a> than during the last
        iteration (or if this is the first iteration), and if this <a
        href="#immediate">immediate user selection</a> is not the same as the
-       <a href="#current1">current target element</a>, then the <a
-       href="#current1">current target element</a> must be updated, as
+       <a href="#current2">current target element</a>, then the <a
+       href="#current2">current target element</a> must be updated, as
        follows:</p>
 
       <ol>
        <li>
         <p>If the new <a href="#immediate">immediate user selection</a> is
          null, or is in a non-DOM document or application, then set the <a
-         href="#current1">current target element</a> to the same value.</p>
+         href="#current2">current target element</a> to the same value.</p>
 
        <li>
         <p>Otherwise, the user agent must fire a <code
@@ -35022,42 +35038,42 @@
          event at the <a href="#immediate">immediate user selection</a>.</p>
 
        <li>
-        <p>If the event is canceled, then the <a href="#current1">current
+        <p>If the event is canceled, then the <a href="#current2">current
          target element</a> must be set to the <a href="#immediate">immediate
          user selection</a>.</p>
 
        <li>
-        <p>Otherwise, if the <a href="#current1">current target element</a>
+        <p>Otherwise, if the <a href="#current2">current target element</a>
          is not <a href="#the-body1">the body element</a>, the user agent
          must fire a <code title=event-dragenter><a
          href="#dragenter">dragenter</a></code> event at <a
          href="#the-body1">the body element</a>, and the <a
-         href="#current1">current target element</a> must be set to <a
+         href="#current2">current target element</a> must be set to <a
          href="#the-body1">the body element</a>, regardless of whether that
          event was canceled or not. (If <a href="#the-body1">the body
-         element</a> is null, then the <a href="#current1">current target
+         element</a> is null, then the <a href="#current2">current target
          element</a> would be set to null too in this case, it wouldn't be
          set to the <code>Document</code> object.)</p>
       </ol>
 
      <li>
-      <p>If the previous step caused the <a href="#current1">current target
+      <p>If the previous step caused the <a href="#current2">current target
        element</a> to change, and if the previous target element was not null
        or a part of a non-DOM document, the user agent must fire a <code
        title=event-dragleave><a href="#dragleave">dragleave</a></code> event
        at the previous target element.</p>
 
      <li>
-      <p>If the <a href="#current1">current target element</a> is a DOM
+      <p>If the <a href="#current2">current target element</a> is a DOM
        element, the user agent must fire a <code title=event-dragover><a
        href="#dragover">dragover</a></code> event at this <a
-       href="#current1">current target element</a>.</p>
+       href="#current2">current target element</a>.</p>
 
       <p>If the <code title=event-dragover><a
        href="#dragover">dragover</a></code> event is canceled, the <a
-       href="#current2">current drag operation</a> must be reset to "none".</p>
+       href="#current3">current drag operation</a> must be reset to "none".</p>
 
-      <p>Otherwise, the <a href="#current2">current drag operation</a> must
+      <p>Otherwise, the <a href="#current3">current drag operation</a> must
        be set based on the values the <code
        title=dom-DataTransfer-effectAllowed><a
        href="#effectallowed">effectAllowed</a></code> and <code
@@ -35115,7 +35131,7 @@
       <p>Then, regardless of whether the <code title=event-dragover><a
        href="#dragover">dragover</a></code> event was canceled or not, the
        drag feedback (e.g. the mouse cursor) must be updated to match the <a
-       href="#current2">current drag operation</a>, as follows:</p>
+       href="#current3">current drag operation</a>, as follows:</p>
 
       <table>
        <thead>
@@ -35148,10 +35164,10 @@
       </table>
 
      <li>
-      <p>Otherwise, if the <a href="#current1">current target element</a> is
+      <p>Otherwise, if the <a href="#current2">current target element</a> is
        not a DOM element, the user agent must use platform-specific
        mechanisms to determine what drag operation is being performed (none,
-       copy, link, or move). This sets the <em><a href="#current2">current
+       copy, link, or move). This sets the <em><a href="#current3">current
        drag operation</a></em>.</p>
     </ol>
 
@@ -35164,11 +35180,11 @@
 
     <ol>
      <li>
-      <p>If the <a href="#current2">current drag operation</a> is none (no
+      <p>If the <a href="#current3">current drag operation</a> is none (no
        drag operation), or, if the user ended the drag-and-drop operation by
        canceling it (e.g. by hitting the <kbd>Escape</kbd> key), or if the <a
-       href="#current1">current target element</a> is null, then the drag
-       operation failed. If the <a href="#current1">current target
+       href="#current2">current target element</a> is null, then the drag
+       operation failed. If the <a href="#current2">current target
        element</a> is a DOM element, the user agent must fire a <code
        title=event-dragleave><a href="#dragleave">dragleave</a></code> event
        at it; otherwise, if it is not null, it must use platform-specific
@@ -35176,7 +35192,7 @@
 
      <li>
       <p>Otherwise, the drag operation was as success. If the <a
-       href="#current1">current target element</a> is a DOM element, the user
+       href="#current2">current target element</a> is a DOM element, the user
        agent must fire a <code title=event-drop><a
        href="#drop">drop</a></code> event at it; otherwise, it must use
        platform-specific conventions for indicating a drop.</p>
@@ -35186,14 +35202,14 @@
        href="#dropeffect">dropEffect</a></code> attribute of the event's
        <code title=dom-DragEvent-dataTransfer><a
        href="#datatransfer">dataTransfer</a></code> object must be given the
-       value representing the <a href="#current2">current drag operation</a>
+       value representing the <a href="#current3">current drag operation</a>
        (<code title="">copy</code>, <code title="">link</code>, or <code
        title="">move</code>), and the object must be set up so that the <code
        title=dom-DataTransfer-getData><a href="#getdata">getData()</a></code>
        method will return the data that was added during the <code
        title=event-dragstart><a href="#dragstart">dragstart</a></code> event.</p>
 
-      <p>If the event is canceled, the <a href="#current2">current drag
+      <p>If the event is canceled, the <a href="#current3">current drag
        operation</a> must be set to the value of the <code
        title=dom-DataTransfer-dropEffect><a
        href="#dropeffect">dropEffect</a></code> attribute of the event's
@@ -35206,7 +35222,7 @@
        as follows:</p>
 
       <dl class=switch>
-       <dt>If the <a href="#current1">current target element</a> is a text
+       <dt>If the <a href="#current2">current target element</a> is a text
         field (e.g. <code>textarea</code>, or an <code>input</code> element
         with <code title="">type="text"</code><!--XXX xref-->)
 
@@ -35218,7 +35234,7 @@
 
        <dt>Otherwise
 
-       <dd>Reset the <a href="#current2">current drag operation</a> to
+       <dd>Reset the <a href="#current3">current drag operation</a> to
         "none".
       </dl>
 
@@ -35230,10 +35246,10 @@
        href="#dropeffect">dropEffect</a></code> attribute of the event's
        <code title=dom-DragEvent-dataTransfer><a
        href="#datatransfer">dataTransfer</a></code> object being set to the
-       value corresponding to the <a href="#current2">current drag
+       value corresponding to the <a href="#current3">current drag
        operation</a>.</p>
 
-      <p class=note>The <a href="#current2">current drag operation</a> can
+      <p class=note>The <a href="#current3">current drag operation</a> can
        change during the processing of the <code title=event-drop><a
        href="#drop">drop</a></code> event, if one was fired.</p>
 
@@ -35241,22 +35257,22 @@
        user agent must act as follows:</p>
 
       <dl class=switch>
-       <dt>If the <a href="#current1">current target element</a> is a text
+       <dt>If the <a href="#current2">current target element</a> is a text
         field (e.g. <code>textarea</code>, or an <code>input</code> element
         with <code title="">type="text"</code><!--XXX xref-->), and a <code
         title=event-drop><a href="#drop">drop</a></code> event was fired in
-        the previous step, and the <a href="#current2">current drag
+        the previous step, and the <a href="#current3">current drag
         operation</a> is "move", and the source of the drag-and-drop
         operation is a selection in the DOM
 
        <dd>The user agent should delete the range representing the dragged
         selection from the DOM.
 
-       <dt>If the <a href="#current1">current target element</a> is a text
+       <dt>If the <a href="#current2">current target element</a> is a text
         field (e.g. <code>textarea</code>, or an <code>input</code> element
         with <code title="">type="text"</code><!--XXX xref-->), and a <code
         title=event-drop><a href="#drop">drop</a></code> event was fired in
-        the previous step, and the <a href="#current2">current drag
+        the previous step, and the <a href="#current3">current drag
         operation</a> is "move", and the source of the drag-and-drop
         operation is a selection in a text field
 
@@ -35538,7 +35554,7 @@
    href="#undo-transaction">undo transaction history</a>.
 
   <p>The <a href="#undo-transaction">undo transaction history</a> has a <dfn
-   id=current3 title="undo position">current position</dfn>. This is the
+   id=current4 title="undo position">current position</dfn>. This is the
    position between two entries in the <a href="#undo-transaction">undo
    transaction history</a>'s list where the previous entry represents what
    needs to happen if the user invokes the "undo" command (the "undo" side,
@@ -35548,12 +35564,12 @@
   <p>The <dfn id=position0
    title=dom-UndoManager-position><code>position</code></dfn> attribute must
    return the index of the <a href="#undo-object">undo object</a> entry
-   nearest to the <a href="#current3">undo position</a>, on the "redo" side.
+   nearest to the <a href="#current4">undo position</a>, on the "redo" side.
    If there are no <a href="#undo-object">undo object</a> entries on the
    "redo" side, then the attribute must return the same as the <code
    title=dom-UndoManager-length><a href="#length10">length</a></code>
    attribute. If there are no <a href="#undo-object">undo object</a> entries
-   on the "undo" side of the <a href="#current3">undo position</a>, the <code
+   on the "undo" side of the <a href="#current4">undo position</a>, the <code
    title=dom-UndoManager-position><a href="#position0">position</a></code>
    attribute returns zero.
 
@@ -35572,17 +35588,17 @@
    behavior depends on the current state. Normally, it must insert the <var
    title="">data</var> object passed as an argument into the <a
    href="#undo-transaction">undo transaction history</a> immediately before
-   the <a href="#current3">undo position</a>, optionally remembering the
+   the <a href="#current4">undo position</a>, optionally remembering the
    given <var title="">title</var> to use in the UI. If the method is called
    <a href="#undo-moving0" title=do-undo>during an undo operation</a>,
    however, the object must instead be added immediately <em>after</em> the
-   <a href="#current3">undo position</a>.
+   <a href="#current4">undo position</a>.
 
   <p>If the method is called and there is neither <a href="#undo-moving0"
    title=do-undo>an undo operation in progress</a> nor <a
    href="#redo-moving0" title=do-redo>a redo operation in progress</a> then
    any entries in the <a href="#undo-transaction">undo transaction
-   history</a> after the <a href="#current3">undo position</a> must be
+   history</a> after the <a href="#current4">undo position</a> must be
    removed (as if <code title=dom-UndoManager-clearRedo><a
    href="#clearredo">clearRedo()</a></code> had been called).
 
@@ -35605,14 +35621,14 @@
   <p>The <dfn id=clearundo
    title=dom-UndoManager-clearUndo><code>clearUndo()</code></dfn> method must
    remove all entries in the <a href="#undo-transaction">undo transaction
-   history</a> before the <a href="#current3">undo position</a>, be they <a
+   history</a> before the <a href="#current4">undo position</a>, be they <a
    href="#dom-changes">DOM changes</a> entries or <a href="#undo-object">undo
    object</a> entries.
 
   <p>The <dfn id=clearredo
    title=dom-UndoManager-clearRedo><code>clearRedo()</code></dfn> method must
    remove all entries in the <a href="#undo-transaction">undo transaction
-   history</a> after the <a href="#current3">undo position</a>, be they <a
+   history</a> after the <a href="#current4">undo position</a>, be they <a
    href="#dom-changes">DOM changes</a> entries or <a href="#undo-object">undo
    object</a> entries.
 
@@ -35629,18 +35645,18 @@
    <code title=command-undo><a href="#undo1">undo</a></code> command, the
    user agent must perform an undo operation.
 
-  <p>If the <a href="#current3">undo position</a> is at the start of the <a
+  <p>If the <a href="#current4">undo position</a> is at the start of the <a
    href="#undo-transaction">undo transaction history</a>, then the user agent
    must do nothing.
 
-  <p>If the entry immediately before the <a href="#current3">undo
+  <p>If the entry immediately before the <a href="#current4">undo
    position</a> is a <a href="#dom-changes">DOM changes</a> entry, then the
    user agent must remove that <a href="#dom-changes">DOM changes</a> entry,
    reverse the DOM changes that were listed in that entry, and, if the
    changes were reversed with no problems, add a new <a
    href="#dom-changes">DOM changes</a> entry (consisting of the opposite of
    those DOM changes) to the <a href="#undo-transaction">undo transaction
-   history</a> on the other side of the <a href="#current3">undo
+   history</a> on the other side of the <a href="#current4">undo
    position</a>.
 
   <p>If the DOM changes cannot be undone (e.g. because the DOM state is no
@@ -35648,7 +35664,7 @@
    user agent must simply remove the <a href="#dom-changes">DOM changes</a>
    entry, without doing anything else.
 
-  <p>If the entry immediately before the <a href="#current3">undo
+  <p>If the entry immediately before the <a href="#current4">undo
    position</a> is an <a href="#undo-object">undo object</a> entry, then the
    user agent must first remove that <a href="#undo-object">undo object</a>
    entry from the <a href="#undo-transaction">undo transaction history</a>,
@@ -35675,25 +35691,25 @@
    title=do-undo>undo operation</a>, but the full definition is included here
    for completeness.
 
-  <p>If the <a href="#current3">undo position</a> is at the end of the <a
+  <p>If the <a href="#current4">undo position</a> is at the end of the <a
    href="#undo-transaction">undo transaction history</a>, then the user agent
    must do nothing.
 
-  <p>If the entry immediately after the <a href="#current3">undo position</a>
+  <p>If the entry immediately after the <a href="#current4">undo position</a>
    is a <a href="#dom-changes">DOM changes</a> entry, then the user agent
    must remove that <a href="#dom-changes">DOM changes</a> entry, reverse the
    DOM changes that were listed in that entry, and, if the changes were
    reversed with no problems, add a new <a href="#dom-changes">DOM
    changes</a> entry (consisting of the opposite of those DOM changes) to the
    <a href="#undo-transaction">undo transaction history</a> on the other side
-   of the <a href="#current3">undo position</a>.
+   of the <a href="#current4">undo position</a>.
 
   <p>If the DOM changes cannot be redone (e.g. because the DOM state is no
    longer consistent with the changes represented in the entry), then the
    user agent must simply remove the <a href="#dom-changes">DOM changes</a>
    entry, without doing anything else.
 
-  <p>If the entry immediately after the <a href="#current3">undo position</a>
+  <p>If the entry immediately after the <a href="#current4">undo position</a>
    is an <a href="#undo-object">undo object</a> entry, then the user agent
    must first remove that <a href="#undo-object">undo object</a> entry from
    the <a href="#undo-transaction">undo transaction history</a>, and then
@@ -36473,12 +36489,12 @@
    <dd><strong>Action:</strong> The user agent must <a href="#redo-moving0"
     title=do-redo>move forward one step</a> in its <a
     href="#undo-transaction">undo transaction history</a>, restoring the
-    associated state. If the <a href="#current3">undo position</a> is at the
+    associated state. If the <a href="#current4">undo position</a> is at the
     end of the <a href="#undo-transaction">undo transaction history</a>, the
     user agent must do nothing. See the <a href="#undo-history">undo
     history</a>.
 
-   <dd><strong>Enabled When:</strong> The <a href="#current3">undo
+   <dd><strong>Enabled When:</strong> The <a href="#current4">undo
     position</a> is not at the end of the <a href="#undo-transaction">undo
     transaction history</a>.
 
@@ -36554,12 +36570,12 @@
    <dd><strong>Action:</strong> The user agent must <a href="#undo-moving0"
     title=do-undo>move back one step</a> in its <a
     href="#undo-transaction">undo transaction history</a>, restoring the
-    associated state. If the <a href="#current3">undo position</a> is at the
+    associated state. If the <a href="#current4">undo position</a> is at the
     start of the <a href="#undo-transaction">undo transaction history</a>,
     the user agent must do nothing. See the <a href="#undo-history">undo
     history</a>.
 
-   <dd><strong>Enabled When:</strong> The <a href="#current3">undo
+   <dd><strong>Enabled When:</strong> The <a href="#current4">undo
     position</a> is not at the start of the <a href="#undo-transaction">undo
     transaction history</a>.
 
@@ -37204,7 +37220,7 @@
   <pre class=idl>interface <dfn id=connection0>Connection</dfn> {
   readonly attribute DOMString <a href="#network1" title=dom-Connection-network>network</a>;
   readonly attribute DOMString <a href="#peer" title=dom-Connection-peer>peer</a>;
-  readonly attribute int <a href="#readystate0" title=dom-Connection-readyState>readyState</a>;
+  readonly attribute int <a href="#readystate1" title=dom-Connection-readyState>readyState</a>;
            attribute EventListener <a href="#onopen" title=dom-Connection-onopen>onopen</a>;
            attribute EventListener <a href="#onread" title=dom-Connection-onread>onread</a>;
            attribute EventListener <a href="#onclose" title=dom-Connection-onclose>onclose</a>;
@@ -37236,7 +37252,7 @@
    connection is established, after which point it must keep the same value
    for the lifetime of the object.
 
-  <p>The <dfn id=readystate0
+  <p>The <dfn id=readystate1
    title=dom-Connection-readyState><code>readyState</code></dfn> attribute
    represents the state of the connection. When the object is created it must
    be set to 0. It can have the following values:
@@ -37257,7 +37273,7 @@
 
   <p id=openConnection>Once a connection is established, the <code
    title=dom-Connection-readyState><a
-   href="#readystate0">readyState</a></code> attribute's value must be
+   href="#readystate1">readyState</a></code> attribute's value must be
    changed to 1, and the <code title=event-connection-open><a
    href="#open3">open</a></code> event must be fired on the <code><a
    href="#connection0">Connection</a></code> object.
@@ -37270,7 +37286,7 @@
 
   <p id=closeConnection>When the connection is closed, the <code
    title=dom-Connection-readyState><a
-   href="#readystate0">readyState</a></code> attribute's value must be
+   href="#readystate1">readyState</a></code> attribute's value must be
    changed to 2, and the <code title=event-connection-close><a
    href="#close0">close</a></code> event must be fired on the <code><a
    href="#connection0">Connection</a></code> object.
@@ -37298,7 +37314,7 @@
    closed, it must do nothing. Closing the connection causes a <code
    title=event-connection-close><a href="#close0">close</a></code> event to
    be fired and the <code title=dom-Connection-readyState><a
-   href="#readystate0">readyState</a></code> attribute's value to change, as
+   href="#readystate1">readyState</a></code> attribute's value to change, as
    <a href="#closeConnection">described above</a>.
 
   <h4 id=connection><span class=secno>6.3.3 </span>Connection Events</h4>
@@ -39822,15 +39838,15 @@
   <p>The <code><a href="#html">html</a></code> node, however it is created,
    is the topmost node of the stack. It never gets popped off the stack.
 
-  <p>The <dfn id=current4>current node</dfn> is the bottommost node in this
+  <p>The <dfn id=current5>current node</dfn> is the bottommost node in this
    stack.
 
-  <p>The <dfn id=current5>current table</dfn> is the last <code><a
+  <p>The <dfn id=current6>current table</dfn> is the last <code><a
    href="#table">table</a></code> element in the <a href="#stack">stack of
    open elements</a>, if there is one. If there is no <code><a
    href="#table">table</a></code> element in the <a href="#stack">stack of
    open elements</a> (<a href="#fragment">fragment case</a>), then the <a
-   href="#current5">current table</a> is the first element in the <a
+   href="#current6">current table</a> is the first element in the <a
    href="#stack">stack of open elements</a> (the <code><a
    href="#html">html</a></code> element).
 
@@ -39924,7 +39940,7 @@
   <ol>
    <li>
     <p>Initialise <var title="">node</var> to be the <a
-     href="#current4">current node</a> (the bottommost node of the stack).
+     href="#current5">current node</a> (the bottommost node of the stack).
 
    <li>
     <p>If <var title="">node</var> is the target node, terminate in a match
@@ -40032,9 +40048,9 @@
    <li>Perform a shallow clone of the element <var title="">entry</var> to
     obtain <var title="">clone</var>. <a href="#refsDOM3CORE">[DOM3CORE]</a>
 
-   <li>Append <var title="">clone</var> to the <a href="#current4">current
+   <li>Append <var title="">clone</var> to the <a href="#current5">current
     node</a> and push it onto the <a href="#stack">stack of open elements</a>
-    so that it is the new <a href="#current4">current node</a>.
+    so that it is the new <a href="#current5">current node</a>.
 
    <li>Replace the entry for <var title="">entry</var> in the list with an
     entry for <var title="">clone</var>.
@@ -40873,7 +40889,7 @@
 
     <p>Otherwise, if the <span>insertion mode</span> is "<a
      href="#in-foreign" title="insertion mode: in foreign content">in foreign
-     content</a>" and the <a href="#current4">current node</a> is not an
+     content</a>" and the <a href="#current5">current node</a> is not an
      element in the <a href="#html-namespace0">HTML namespace</a> and the
      next seven characters are a
      <span>case-sensitive</span><!-- XXX xref, ascii
@@ -41983,22 +41999,22 @@
    element</dfn> for a token, the UA must first <a href="#create">create an
    element for the token</a> in the <a href="#html-namespace0">HTML
    namespace</a>, and then append this node to the <a
-   href="#current4">current node</a>, and push it onto the <a
+   href="#current5">current node</a>, and push it onto the <a
    href="#stack">stack of open elements</a> so that it is the new <a
-   href="#current4">current node</a>.
+   href="#current5">current node</a>.
 
   <p>The steps below may also require that the UA insert an HTML element in a
    particular place, in which case the UA must follow the same steps except
    that it must insert or append the new node in the location specified
-   insead of appending it to the <a href="#current4">current node</a>. (This
+   insead of appending it to the <a href="#current5">current node</a>. (This
    happens in particular during the parsing of tables with invalid content.)
 
   <p>When the steps below require the UA to <dfn id=insert1>insert a foreign
    element</dfn> for a token, the UA must first <a href="#create">create an
    element for the token</a> in the given namespace, and then append this
-   node to the <a href="#current4">current node</a>, and push it onto the <a
+   node to the <a href="#current5">current node</a>, and push it onto the <a
    href="#stack">stack of open elements</a> so that it is the new <a
-   href="#current4">current node</a>. If the newly created element has an
+   href="#current5">current node</a>. If the newly created element has an
    <code title="">xmlns</code> attribute in the <a href="#xmlns">XMLNS
    namespace</a> whose value is not exactly the same as the element's
    namespace, that is a <a href="#parse1">parse error</a>.</p>
@@ -42223,7 +42239,7 @@
     <p><a href="#create">Create an element for the token</a>.
 
    <li>
-    <p>Append the new element to the <a href="#current4">current node</a>.
+    <p>Append the new element to the <a href="#current5">current node</a>.
 
    <li>
     <p>If the algorithm that was invoked is the <a href="#generic">generic
@@ -42257,11 +42273,11 @@
    implied end tags</h5>
 
   <p>When the steps below require the UA to <dfn id=generate>generate implied
-   end tags</dfn>, then, while the <a href="#current4">current node</a> is a
+   end tags</dfn>, then, while the <a href="#current5">current node</a> is a
    <code><a href="#dd">dd</a></code> element, a <code><a
    href="#dt">dt</a></code> element, an <code><a href="#li">li</a></code>
    element, or a <code><a href="#p">p</a></code> element, the UA must pop the
-   <a href="#current4">current node</a> off the <a href="#stack">stack of
+   <a href="#current5">current node</a> off the <a href="#stack">stack of
    open elements</a>.
 
   <p>If a step requires the UA to generate implied end tags but lists an
@@ -42682,7 +42698,7 @@
    <dt>A comment token
 
    <dd>
-    <p>Append a <code>Comment</code> node to the <a href="#current4">current
+    <p>Append a <code>Comment</code> node to the <a href="#current5">current
      node</a> with the <code title="">data</code> attribute set to the data
      given in the comment token.</p>
 
@@ -42749,12 +42765,12 @@
 
    <dd>
     <p><a href="#insert" title="insert a character">Insert the character</a>
-     into the <a href="#current4">current node</a>.</p>
+     into the <a href="#current5">current node</a>.</p>
 
    <dt>A comment token
 
    <dd>
-    <p>Append a <code>Comment</code> node to the <a href="#current4">current
+    <p>Append a <code>Comment</code> node to the <a href="#current5">current
      node</a> with the <code title="">data</code> attribute set to the data
      given in the comment token.</p>
 
@@ -42774,7 +42790,7 @@
 
    <dd>
     <p><a href="#insert0">Insert an HTML element</a> for the token.
-     Immediately pop the <a href="#current4">current node</a> off the <a
+     Immediately pop the <a href="#current5">current node</a> off the <a
      href="#stack">stack of open elements</a>.</p>
 
     <p><a href="#acknowledged" title="acknowledge self-closing
@@ -42785,7 +42801,7 @@
 
    <dd>
     <p><a href="#insert0">Insert an HTML element</a> for the token.
-     Immediately pop the <a href="#current4">current node</a> off the <a
+     Immediately pop the <a href="#current5">current node</a> off the <a
      href="#stack">stack of open elements</a>.</p>
 
     <p><a href="#acknowledged" title="acknowledge self-closing
@@ -42887,7 +42903,7 @@
      href="#insertion">insertion point</a> be just before the <a
      href="#next-input">next input character</a>.</p>
 
-    <p>Append the new element to the <a href="#current4">current node</a>. <a
+    <p>Append the new element to the <a href="#current5">current node</a>. <a
      href="#running0" title="running a script">Special processing occurs when
      a <code>script</code> element is inserted into a document</a> that might
      cause some script to execute, which might cause <a
@@ -42955,7 +42971,7 @@
    <dt>An end tag whose tag name is "head"
 
    <dd>
-    <p>Pop the <a href="#current4">current node</a> (which will be the
+    <p>Pop the <a href="#current5">current node</a> (which will be the
      <code><a href="#head">head</a></code> element) off the <a
      href="#stack">stack of open elements</a>.</p>
 
@@ -43010,10 +43026,10 @@
    <dt>An end tag whose tag name is "noscript"
 
    <dd>
-    <p>Pop the <a href="#current4">current node</a> (which will be a <code><a
+    <p>Pop the <a href="#current5">current node</a> (which will be a <code><a
      href="#noscript">noscript</a></code> element) from the <a
      href="#stack">stack of open elements</a>; the new <a
-     href="#current4">current node</a> will be a <code><a
+     href="#current5">current node</a> will be a <code><a
      href="#head">head</a></code> element.</p>
 
     <p>Switch the <span>insertion mode</span> to "<a href="#in-head"
@@ -43065,12 +43081,12 @@
 
    <dd>
     <p><a href="#insert" title="insert a character">Insert the character</a>
-     into the <a href="#current4">current node</a>.</p>
+     into the <a href="#current5">current node</a>.</p>
 
    <dt>A comment token
 
    <dd>
-    <p>Append a <code>Comment</code> node to the <a href="#current4">current
+    <p>Append a <code>Comment</code> node to the <a href="#current5">current
      node</a> with the <code title="">data</code> attribute set to the data
      given in the comment token.</p>
 
@@ -43116,7 +43132,7 @@
      href="#in-head" title="insertion mode: in head">in head</a>"
      <span>insertion mode</span>.</p>
 
-    <p>Pop the <a href="#current4">current node</a> (which will be the node
+    <p>Pop the <a href="#current5">current node</a> (which will be the node
      pointed to by the <a href="#head-element"><code title="">head</code>
      element pointer</a>) off the <a href="#stack">stack of open
      elements</a>.</p>
@@ -43143,12 +43159,12 @@
      if any.</p>
 
     <p><a href="#insert" title="insert a character">Insert the token's
-     character</a> into the <a href="#current4">current node</a>.</p>
+     character</a> into the <a href="#current5">current node</a>.</p>
 
    <dt>A comment token
 
    <dd>
-    <p>Append a <code>Comment</code> node to the <a href="#current4">current
+    <p>Append a <code>Comment</code> node to the <a href="#current5">current
      node</a> with the <code title="">data</code> attribute set to the data
      given in the comment token.</p>
 
@@ -43319,11 +43335,11 @@
     <ol>
      <li>
       <p>Initialise <var title="">node</var> to be the <a
-       href="#current4">current node</a> (the bottommost node of the stack).
+       href="#current5">current node</a> (the bottommost node of the stack).
 
      <li>
       <p>If <var title="">node</var> is an <code><a href="#li">li</a></code>
-       element, then pop all the nodes from the <a href="#current4">current
+       element, then pop all the nodes from the <a href="#current5">current
        node</a> up to <var title="">node</var>, including <var
        title="">node</var>, then stop this algorithm. If more than one node
        is popped, then this is a <a href="#parse1">parse error</a>.
@@ -43364,12 +43380,12 @@
     <ol>
      <li>
       <p>Initialise <var title="">node</var> to be the <a
-       href="#current4">current node</a> (the bottommost node of the stack).
+       href="#current5">current node</a> (the bottommost node of the stack).
 
      <li>
       <p>If <var title="">node</var> is a <code><a href="#dd">dd</a></code>
        or <code><a href="#dt">dt</a></code> element, then pop all the nodes
-       from the <a href="#current4">current node</a> up to <var
+       from the <a href="#current5">current node</a> up to <var
        title="">node</var>, including <var title="">node</var>, then stop
        this algorithm. If more than one node is popped, then this is a <a
        href="#parse1">parse error</a>.
@@ -43432,7 +43448,7 @@
       <p><a href="#generate">Generate implied end tags</a>.
 
      <li>
-      <p>If the <a href="#current4">current node</a> is not an element with
+      <p>If the <a href="#current5">current node</a> is not an element with
        the same tag name as that of the token, then this is a <a
        href="#parse1">parse error</a>.
 
@@ -43460,7 +43476,7 @@
       <p><a href="#generate">Generate implied end tags</a>.
 
      <li>
-      <p>If the <a href="#current4">current node</a> is not an element with
+      <p>If the <a href="#current5">current node</a> is not an element with
        the same tag name as that of the token, then this is a <a
        href="#parse1">parse error</a>.
 
@@ -43473,7 +43489,7 @@
    <dt>An end tag whose tag name is "p"
 
    <dd>
-    <p>If the <a href="#current4">current node</a> is not a <code><a
+    <p>If the <a href="#current5">current node</a> is not a <code><a
      href="#p">p</a></code> element, then this is a <a href="#parse1">parse
      error</a>.</p>
 
@@ -43502,7 +43518,7 @@
        elements with the same tag name as the token.
 
      <li>
-      <p>If the <a href="#current4">current node</a> is not an element with
+      <p>If the <a href="#current5">current node</a> is not an element with
        the same tag name as that of the token, then this is a <a
        href="#parse1">parse error</a>.
 
@@ -43531,7 +43547,7 @@
       <p><a href="#generate">Generate implied end tags</a>.
 
      <li>
-      <p>If the <a href="#current4">current node</a> is not an element with
+      <p>If the <a href="#current5">current node</a> is not an element with
        the same tag name as that of the token, then this is a <a
        href="#parse1">parse error</a>.
 
@@ -43638,7 +43654,7 @@
       <p>Otherwise, there is a <var title="">formatting element</var> and
        that element is in <a href="#stack" title="stack of open elements">the
        stack</a> and is <a href="#have-an" title="has an element in scope">in
-       scope</a>. If the element is not the <a href="#current4">current
+       scope</a>. If the element is not the <a href="#current5">current
        node</a>, this is a <a href="#parse1">parse error</a>. In any case,
        proceed with the algorithm as written in the following steps.</p>
 
@@ -43653,7 +43669,7 @@
       <p>If there is no <var title="">furthest block</var>, then the UA must
        skip the subsequent steps and instead just pop all the nodes from the
        bottom of the <a href="#stack">stack of open elements</a>, from the <a
-       href="#current4">current node</a> up to and including the <var
+       href="#current5">current node</a> up to and including the <var
        title="">formatting element</var>, and remove the <var
        title="">formatting element</var> from the <a href="#list-of4">list of
        active formatting elements</a>.
@@ -43831,7 +43847,7 @@
       <p><a href="#generate">Generate implied end tags</a>.
 
      <li>
-      <p>If the <a href="#current4">current node</a> is not an element with
+      <p>If the <a href="#current5">current node</a> is not an element with
        the same tag name as that of the token, then this is a <a
        href="#parse1">parse error</a>.
 
@@ -43873,7 +43889,7 @@
      if any.</p>
 
     <p><a href="#insert0">Insert an HTML element</a> for the token.
-     Immediately pop the <a href="#current4">current node</a> off the <a
+     Immediately pop the <a href="#current5">current node</a> off the <a
      href="#stack">stack of open elements</a>.</p>
 
     <p><a href="#acknowledged" title="acknowledge self-closing
@@ -43889,7 +43905,7 @@
      href="#p">p</a></code> had been seen.</p>
     <!-- XXX quirks: don't do this -->
     <p><a href="#insert0">Insert an HTML element</a> for the token.
-     Immediately pop the <a href="#current4">current node</a> off the <a
+     Immediately pop the <a href="#current5">current node</a> off the <a
      href="#stack">stack of open elements</a>.</p>
 
     <p><a href="#acknowledged" title="acknowledge self-closing
@@ -43913,7 +43929,7 @@
      if any.</p>
 
     <p><a href="#insert0">Insert an HTML element</a> for the token.
-     Immediately pop the <a href="#current4">current node</a> off the <a
+     Immediately pop the <a href="#current5">current node</a> off the <a
      href="#stack">stack of open elements</a>.</p>
 
     <p><a href="#acknowledged" title="acknowledge self-closing
@@ -43994,7 +44010,7 @@
    <dd>
     <p><a href="#create">Create an element for the token</a>, in the <a
      href="#html-namespace0">HTML namespace</a>. Append the new element to
-     the <a href="#current4">current node</a>.</p>
+     the <a href="#current5">current node</a>.</p>
 
     <p>If the <a href="#form-element"><code title="">form</code> element
      pointer</a> is not null, then <span>associate</span><!--XXX xref! -->
@@ -44076,7 +44092,7 @@
      <a href="#mathml0">MathML namespace</a>.</p>
 
     <p>If the token has its <i>self-closing flag</i> set, pop the <a
-     href="#current4">current node</a> off the <a href="#stack">stack of open
+     href="#current5">current node</a> off the <a href="#stack">stack of open
      elements</a> and <a href="#acknowledged" title="acknowledge self-closing
      flag">acknowledge the token's <i>self-closing flag</i></a>.</p>
 
@@ -44157,7 +44173,7 @@
     <ol>
      <li>
       <p>Initialise <var title="">node</var> to be the <a
-       href="#current4">current node</a> (the bottommost node of the stack).
+       href="#current5">current node</a> (the bottommost node of the stack).
 
      <li>
       <p>If <var title="">node</var> has the same tag name as the end tag
@@ -44169,11 +44185,11 @@
 
        <li>
         <p>If the tag name of the end tag token does not match the tag name
-         of the <a href="#current4">current node</a>, this is a <a
+         of the <a href="#current5">current node</a>, this is a <a
          href="#parse1">parse error</a>.
 
        <li>
-        <p>Pop all the nodes from the <a href="#current4">current node</a> up
+        <p>Pop all the nodes from the <a href="#current5">current node</a> up
          to <var title="">node</var>, including <var title="">node</var>,
          then stop this algorithm.
       </ol>
@@ -44208,17 +44224,17 @@
     <!--U+000D CARRIAGE RETURN (CR),--> or U+0020 SPACE
 
    <dd>
-    <p>If the <a href="#current5">current table</a> is <a
+    <p>If the <a href="#current6">current table</a> is <a
      href="#tainted">tainted</a>, then act as described in the "anything
      else" entry below.</p>
 
     <p>Otherwise, <a href="#insert" title="insert a character">insert the
-     character</a> into the <a href="#current4">current node</a>.</p>
+     character</a> into the <a href="#current5">current node</a>.</p>
 
    <dt>A comment token
 
    <dd>
-    <p>Append a <code>Comment</code> node to the <a href="#current4">current
+    <p>Append a <code>Comment</code> node to the <a href="#current5">current
      node</a> with the <code title="">data</code> attribute set to the data
      given in the comment token.</p>
 
@@ -44307,7 +44323,7 @@
    <dt>A start tag whose tag name is one of: "style", "script"
 
    <dd>
-    <p>If the <a href="#current5">current table</a> is <a
+    <p>If the <a href="#current6">current table</a> is <a
      href="#tainted">tainted</a> then act as described in the "anything else"
      entry below.</p>
 
@@ -44321,7 +44337,7 @@
     <p>If the token does not have an attribute with the name "type", or if it
      does, but that attribute's value is not a case-insensitive
      <!-- XXX ASCII --> match for the string "hidden", or, if the <a
-     href="#current5">current table</a> is <a href="#tainted">tainted</a>,
+     href="#current6">current table</a> is <a href="#tainted">tainted</a>,
      then: act as described in the "anything else" entry below.</p>
 
     <p>Otherwise:</p>
@@ -44343,11 +44359,11 @@
    <dt>An end-of-file token
 
    <dd>
-    <p>If the <a href="#current4">current node</a> is not the root <code><a
+    <p>If the <a href="#current5">current node</a> is not the root <code><a
      href="#html">html</a></code> element, then this is a <a
      href="#parse1">parse error.</a>.</p>
 
-    <p class=note>It can only be the <a href="#current4">current node</a> in
+    <p class=note>It can only be the <a href="#current5">current node</a> in
      the <a href="#fragment">fragment case</a>.</p>
 
     <p><a href="#stops">Stop parsing.</a></p>
@@ -44360,18 +44376,18 @@
      title="insertion mode: in body">in body</a>" <span>insertion
      mode</span>, with the following exception:</p>
 
-    <p>If the <a href="#current4">current node</a> is a <code><a
+    <p>If the <a href="#current5">current node</a> is a <code><a
      href="#table">table</a></code>, <code><a href="#tbody">tbody</a></code>,
      <code><a href="#tfoot0">tfoot</a></code>, <code><a
      href="#thead0">thead</a></code>, or <code><a href="#tr">tr</a></code>
      element, then, whenever a node would be inserted into the <a
-     href="#current4">current node</a>, it must instead be inserted into the
+     href="#current5">current node</a>, it must instead be inserted into the
      <i><a href="#foster">foster parent element</a></i>, and the <a
-     href="#current5">current table</a> must be marked as <dfn
-     id=tainted>tainted</dfn>. (Once the <a href="#current5">current
+     href="#current6">current table</a> must be marked as <dfn
+     id=tainted>tainted</dfn>. (Once the <a href="#current6">current
      table</a> has been <a href="#tainted">tainted</a>, whitespace characters
      are inserted into the <i><a href="#foster">foster parent element</a></i>
-     instead of the <a href="#current4">current node</a>.)</p>
+     instead of the <a href="#current5">current node</a>.)</p>
 
     <p>The <dfn id=foster>foster parent element</dfn> is the parent element
      of the last <code><a href="#table">table</a></code> element in the <a
@@ -44402,12 +44418,12 @@
 
   <p>When the steps above require the UA to <dfn id=clear1>clear the stack
    back to a table context</dfn>, it means that the UA must, while the <a
-   href="#current4">current node</a> is not a <code><a
+   href="#current5">current node</a> is not a <code><a
    href="#table">table</a></code> element or an <code><a
    href="#html">html</a></code> element, pop elements from the <a
    href="#stack">stack of open elements</a>.
 
-  <p class=note>The <a href="#current4">current node</a> being an <code><a
+  <p class=note>The <a href="#current5">current node</a> being an <code><a
    href="#html">html</a></code> element after this process is a <a
    href="#fragment">fragment case</a>.
 
@@ -44433,7 +44449,7 @@
 
     <p><a href="#generate">Generate implied end tags</a>.</p>
 
-    <p>Now, if the <a href="#current4">current node</a> is not a <code><a
+    <p>Now, if the <a href="#current5">current node</a> is not a <code><a
      href="#caption0">caption</a></code> element, then this is a <a
      href="#parse1">parse error</a>.</p>
 
@@ -44489,12 +44505,12 @@
 
    <dd>
     <p><a href="#insert" title="insert a character">Insert the character</a>
-     into the <a href="#current4">current node</a>.</p>
+     into the <a href="#current5">current node</a>.</p>
 
    <dt>A comment token
 
    <dd>
-    <p>Append a <code>Comment</code> node to the <a href="#current4">current
+    <p>Append a <code>Comment</code> node to the <a href="#current5">current
      node</a> with the <code title="">data</code> attribute set to the data
      given in the comment token.</p>
 
@@ -44514,7 +44530,7 @@
 
    <dd>
     <p><a href="#insert0">Insert an HTML element</a> for the token.
-     Immediately pop the <a href="#current4">current node</a> off the <a
+     Immediately pop the <a href="#current5">current node</a> off the <a
      href="#stack">stack of open elements</a>.</p>
 
     <p><a href="#acknowledged" title="acknowledge self-closing
@@ -44524,12 +44540,12 @@
    <dt>An end tag whose tag name is "colgroup"
 
    <dd>
-    <p>If the <a href="#current4">current node</a> is the root <code><a
+    <p>If the <a href="#current5">current node</a> is the root <code><a
      href="#html">html</a></code> element, then this is a <a
      href="#parse1">parse error</a>, ignore the token. (<a
      href="#fragment">fragment case</a>)</p>
 
-    <p>Otherwise, pop the <a href="#current4">current node</a> (which will be
+    <p>Otherwise, pop the <a href="#current5">current node</a> (which will be
      a <code><a href="#colgroup">colgroup</a></code> element) from the <a
      href="#stack">stack of open elements</a>. Switch the <span>insertion
      mode</span> to "<a href="#in-table" title="insertion mode: in table">in
@@ -44543,7 +44559,7 @@
    <dt>An end-of-file token
 
    <dd>
-    <p>If the <a href="#current4">current node</a> is the root <code><a
+    <p>If the <a href="#current5">current node</a> is the root <code><a
      href="#html">html</a></code> element, then <a href="#stops">stop
      parsing</a>. (<a href="#fragment">fragment case</a>)</p>
 
@@ -44597,7 +44613,7 @@
     <p><a href="#clear2">Clear the stack back to a table body context</a>.
      (See below.)</p>
 
-    <p>Pop the <a href="#current4">current node</a> from the <a
+    <p>Pop the <a href="#current5">current node</a> from the <a
      href="#stack">stack of open elements</a>. Switch the <span>insertion
      mode</span> to "<a href="#in-table" title="insertion mode: in table">in
      table</a>".</p>
@@ -44620,7 +44636,7 @@
      (See below.)</p>
 
     <p>Act as if an end tag with the same tag name as the <a
-     href="#current4">current node</a> ("tbody", "tfoot", or "thead") had
+     href="#current5">current node</a> ("tbody", "tfoot", or "thead") had
      been seen, then reprocess the current token.</p>
 
    <dt>An end tag whose tag name is one of: "body", "caption", "col",
@@ -44639,13 +44655,13 @@
 
   <p>When the steps above require the UA to <dfn id=clear2>clear the stack
    back to a table body context</dfn>, it means that the UA must, while the
-   <a href="#current4">current node</a> is not a <code><a
+   <a href="#current5">current node</a> is not a <code><a
    href="#tbody">tbody</a></code>, <code><a href="#tfoot0">tfoot</a></code>,
    <code><a href="#thead0">thead</a></code>, or <code><a
    href="#html">html</a></code> element, pop elements from the <a
    href="#stack">stack of open elements</a>.
 
-  <p class=note>The <a href="#current4">current node</a> being an <code><a
+  <p class=note>The <a href="#current5">current node</a> being an <code><a
    href="#html">html</a></code> element after this process is a <a
    href="#fragment">fragment case</a>.
 
@@ -44684,7 +44700,7 @@
     <p><a href="#clear3">Clear the stack back to a table row context</a>.
      (See below.)</p>
 
-    <p>Pop the <a href="#current4">current node</a> (which will be a <code><a
+    <p>Pop the <a href="#current5">current node</a> (which will be a <code><a
      href="#tr">tr</a></code> element) from the <a href="#stack">stack of
      open elements</a>. Switch the <span>insertion mode</span> to "<a
      href="#in-table0" title="insertion mode: in table body">in table
@@ -44729,12 +44745,12 @@
 
   <p>When the steps above require the UA to <dfn id=clear3>clear the stack
    back to a table row context</dfn>, it means that the UA must, while the <a
-   href="#current4">current node</a> is not a <code><a
+   href="#current5">current node</a> is not a <code><a
    href="#tr">tr</a></code> element or an <code><a
    href="#html">html</a></code> element, pop elements from the <a
    href="#stack">stack of open elements</a>.
 
-  <p class=note>The <a href="#current4">current node</a> being an <code><a
+  <p class=note>The <a href="#current5">current node</a> being an <code><a
    href="#html">html</a></code> element after this process is a <a
    href="#fragment">fragment case</a>.
 
@@ -44759,7 +44775,7 @@
 
     <p><a href="#generate">Generate implied end tags</a>.</p>
 
-    <p>Now, if the <a href="#current4">current node</a> is not an element
+    <p>Now, if the <a href="#current5">current node</a> is not an element
      with the same tag name as the token, then this is a <a
      href="#parse1">parse error</a>.</p>
 
@@ -44771,7 +44787,7 @@
 
     <p>Switch the <span>insertion mode</span> to "<a href="#in-row"
      title="insertion mode: in row">in row</a>". (The <a
-     href="#current4">current node</a> will be a <code><a
+     href="#current5">current node</a> will be a <code><a
      href="#tr">tr</a></code> element at this point.)</p>
 
    <dt>A start tag whose tag name is one of: "caption", "col", "colgroup",
@@ -44852,12 +44868,12 @@
 
    <dd>
     <p><a href="#insert" title="insert a character">Insert the token's
-     character</a> into the <a href="#current4">current node</a>.</p>
+     character</a> into the <a href="#current5">current node</a>.</p>
 
    <dt>A comment token
 
    <dd>
-    <p>Append a <code>Comment</code> node to the <a href="#current4">current
+    <p>Append a <code>Comment</code> node to the <a href="#current5">current
      node</a> with the <code title="">data</code> attribute set to the data
      given in the comment token.</p>
 
@@ -44876,7 +44892,7 @@
    <dt>A start tag whose tag name is "option"
 
    <dd>
-    <p>If the <a href="#current4">current node</a> is an <code>option</code>
+    <p>If the <a href="#current5">current node</a> is an <code>option</code>
      element, act as if an end tag with the tag name "option" had been seen.</p>
 
     <p><a href="#insert0">Insert an HTML element</a> for the token.</p>
@@ -44884,10 +44900,10 @@
    <dt>A start tag whose tag name is "optgroup"
 
    <dd>
-    <p>If the <a href="#current4">current node</a> is an <code>option</code>
+    <p>If the <a href="#current5">current node</a> is an <code>option</code>
      element, act as if an end tag with the tag name "option" had been seen.</p>
 
-    <p>If the <a href="#current4">current node</a> is an
+    <p>If the <a href="#current5">current node</a> is an
      <code>optgroup</code> element, act as if an end tag with the tag name
      "optgroup" had been seen.</p>
 
@@ -44896,13 +44912,13 @@
    <dt>An end tag whose tag name is "optgroup"
 
    <dd>
-    <p>First, if the <a href="#current4">current node</a> is an
+    <p>First, if the <a href="#current5">current node</a> is an
      <code>option</code> element, and the node immediately before it in the
      <a href="#stack">stack of open elements</a> is an <code>optgroup</code>
      element, then act as if an end tag with the tag name "option" had been
      seen.</p>
 
-    <p>If the <a href="#current4">current node</a> is an
+    <p>If the <a href="#current5">current node</a> is an
      <code>optgroup</code> element, then pop that node from the <a
      href="#stack">stack of open elements</a>. Otherwise, this is a <a
      href="#parse1">parse error</a>, ignore the token.</p>
@@ -44910,7 +44926,7 @@
    <dt>An end tag whose tag name is "option"
 
    <dd>
-    <p>If the <a href="#current4">current node</a> is an <code>option</code>
+    <p>If the <a href="#current5">current node</a> is an <code>option</code>
      element, then pop that node from the <a href="#stack">stack of open
      elements</a>. Otherwise, this is a <a href="#parse1">parse error</a>,
      ignore the token.</p>
@@ -44946,11 +44962,11 @@
    <dt>An end-of-file token
 
    <dd>
-    <p>If the <a href="#current4">current node</a> is not the root <code><a
+    <p>If the <a href="#current5">current node</a> is not the root <code><a
      href="#html">html</a></code> element, then this is a <a
      href="#parse1">parse error.</a>.</p>
 
-    <p class=note>It can only be the <a href="#current4">current node</a> in
+    <p class=note>It can only be the <a href="#current5">current node</a> in
      the <a href="#fragment">fragment case</a>.</p>
 
     <p><a href="#stops">Stop parsing.</a></p>
@@ -45010,12 +45026,12 @@
 
    <dd>
     <p><a href="#insert" title="insert a character">Insert the token's
-     character</a> into the <a href="#current4">current node</a>.</p>
+     character</a> into the <a href="#current5">current node</a>.</p>
 
    <dt>A comment token
 
    <dd>
-    <p>Append a <code>Comment</code> node to the <a href="#current4">current
+    <p>Append a <code>Comment</code> node to the <a href="#current5">current
      node</a> with the <code title="">data</code> attribute set to the data
      given in the comment token.</p>
 
@@ -45025,23 +45041,23 @@
     <p><a href="#parse1">Parse error</a>. Ignore the token.</p>
 
    <dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if
-    the <a href="#current4">current node</a> is an <code title="">mi</code>
+    the <a href="#current5">current node</a> is an <code title="">mi</code>
     element in the <a href="#mathml0">MathML namespace</a>.
 
    <dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if
-    the <a href="#current4">current node</a> is an <code title="">mo</code>
+    the <a href="#current5">current node</a> is an <code title="">mo</code>
     element in the <a href="#mathml0">MathML namespace</a>.
 
    <dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if
-    the <a href="#current4">current node</a> is an <code title="">mn</code>
+    the <a href="#current5">current node</a> is an <code title="">mn</code>
     element in the <a href="#mathml0">MathML namespace</a>.
 
    <dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if
-    the <a href="#current4">current node</a> is an <code title="">ms</code>
+    the <a href="#current5">current node</a> is an <code title="">ms</code>
     element in the <a href="#mathml0">MathML namespace</a>.
 
    <dt>A start tag whose tag name is neither "mglyph" nor "malignmark", if
-    the <a href="#current4">current node</a> is an <code
+    the <a href="#current5">current node</a> is an <code
     title="">mtext</code> element in the <a href="#mathml0">MathML
     namespace</a>.</dt>
    <!--XXXSVG
@@ -45051,7 +45067,7 @@
    <dt>A start tag, if the <span>current node</span> is a <code title="">title</code> element in the <span>SVG namespace</span>.</dt>
 -->
 
-   <dt>A start tag, if the <a href="#current4">current node</a> is an element
+   <dt>A start tag, if the <a href="#current5">current node</a> is an element
     in the <a href="#html-namespace0">HTML namespace</a>.
 
    <dt>An end tag
@@ -45081,7 +45097,7 @@
     <p><a href="#parse1">Parse error</a>.</p>
 
     <p>Pop elements from the <a href="#stack">stack of open elements</a>
-     until the <a href="#current4">current node</a> is in the <a
+     until the <a href="#current5">current node</a> is in the <a
      href="#html-namespace0">HTML namespace</a>.</p>
 
     <p>Switch the <span>insertion mode</span> to the <a
@@ -45151,10 +45167,10 @@
      fixes the use of namespaced attributes, in particular XLink in SVG.)</p>
 
     <p><a href="#insert1">Insert a foreign element</a> for the token, in the
-     same namespace as the <a href="#current4">current node</a>.</p>
+     same namespace as the <a href="#current5">current node</a>.</p>
 
     <p>If the token has its <i>self-closing flag</i> set, pop the <a
-     href="#current4">current node</a> off the <a href="#stack">stack of open
+     href="#current5">current node</a> off the <a href="#stack">stack of open
      elements</a> and <a href="#acknowledged" title="acknowledge self-closing
      flag">acknowledge the token's <i>self-closing flag</i></a>.</p>
   </dl>
@@ -45238,12 +45254,12 @@
 
    <dd>
     <p><a href="#insert" title="insert a character">Insert the character</a>
-     into the <a href="#current4">current node</a>.</p>
+     into the <a href="#current5">current node</a>.</p>
 
    <dt>A comment token
 
    <dd>
-    <p>Append a <code>Comment</code> node to the <a href="#current4">current
+    <p>Append a <code>Comment</code> node to the <a href="#current5">current
      node</a> with the <code title="">data</code> attribute set to the data
      given in the comment token.</p>
 
@@ -45267,17 +45283,17 @@
    <dt>An end tag whose tag name is "frameset"
 
    <dd>
-    <p>If the <a href="#current4">current node</a> is the root <code><a
+    <p>If the <a href="#current5">current node</a> is the root <code><a
      href="#html">html</a></code> element, then this is a <a
      href="#parse1">parse error</a>; ignore the token. (<a
      href="#fragment">fragment case</a>)</p>
 
-    <p>Otherwise, pop the <a href="#current4">current node</a> from the <a
+    <p>Otherwise, pop the <a href="#current5">current node</a> from the <a
      href="#stack">stack of open elements</a>.</p>
 
     <p>If the parser was <em>not</em> originally created as part of the <a
      href="#html-fragment0">HTML fragment parsing algorithm</a> (<a
-     href="#fragment">fragment case</a>), and the <a href="#current4">current
+     href="#fragment">fragment case</a>), and the <a href="#current5">current
      node</a> is no longer a <code>frameset</code> element, then switch the
      <span>insertion mode</span> to "<a href="#after6" title="insertion mode:
      after frameset">after frameset</a>".</p>
@@ -45286,7 +45302,7 @@
 
    <dd>
     <p><a href="#insert0">Insert an HTML element</a> for the token.
-     Immediately pop the <a href="#current4">current node</a> off the <a
+     Immediately pop the <a href="#current5">current node</a> off the <a
      href="#stack">stack of open elements</a>.</p>
 
     <p><a href="#acknowledged" title="acknowledge self-closing
@@ -45303,11 +45319,11 @@
    <dt>An end-of-file token
 
    <dd>
-    <p>If the <a href="#current4">current node</a> is not the root <code><a
+    <p>If the <a href="#current5">current node</a> is not the root <code><a
      href="#html">html</a></code> element, then this is a <a
      href="#parse1">parse error.</a>.</p>
 
-    <p class=note>It can only be the <a href="#current4">current node</a> in
+    <p class=note>It can only be the <a href="#current5">current node</a> in
      the <a href="#fragment">fragment case</a>.</p>
 
     <p><a href="#stops">Stop parsing.</a></p>
@@ -45334,12 +45350,12 @@
 
    <dd>
     <p><a href="#insert" title="insert a character">Insert the character</a>
-     into the <a href="#current4">current node</a>.</p>
+     into the <a href="#current5">current node</a>.</p>
 
    <dt>A comment token
 
    <dd>
-    <p>Append a <code>Comment</code> node to the <a href="#current4">current
+    <p>Append a <code>Comment</code> node to the <a href="#current5">current
      node</a> with the <code title="">data</code> attribute set to the data
      given in the comment token.</p>
 
@@ -45468,14 +45484,12 @@
    parsing</dfn> the document, the user agent must follow the steps in this
    section.
 
-  <p>First, <!--the user agent must <span title="fire a DOMContentLoaded
-  event">fire a <code
-  title="event-DOMContentLoaded">DOMContentLoaded</code> event</span>
-  at <span>the <code>body</code> element</span>.</p>
+  <p>First, the <a href="#current">current document readiness</a> must be set
+   to "interactive".
 
-  <p>Then, -->the
-   rules for <a href="#when-a">when a script completes loading</a> start
-   applying (script execution is no longer managed by the parser).
+  <p>Then, the rules for <a href="#when-a">when a script completes
+   loading</a> start applying (script execution is no longer managed by the
+   parser).
 
   <p>If any of the scripts in the <a href="#list-of1">list of scripts that
    will execute as soon as possible</a> have <span>completed
@@ -45501,9 +45515,11 @@
    <code>Document</code>.
 
   <p>Once everything that <dfn id=delays title="delay the load event">delays
-   the load event</dfn> has completed, the user agent must <a href="#firing4"
-   title="fire a load event">fire a <code title=event-load>load</code>
-   event</a> at <a href="#the-body1">the <code>body</code> element</a>.</p>
+   the load event</dfn> has completed, the user agent must set the <a
+   href="#current">current document readiness</a> to "complete", and then <a
+   href="#firing4" title="fire a load event">fire a <code
+   title=event-load>load</code> event</a> at <a href="#the-body1">the
+   <code>body</code> element</a>.</p>
   <!-- XXX make sure things "delay the load event" -->
 
   <p class=big-issue>delaying the load event for things like image loads
@@ -48552,7 +48568,8 @@
   <h2 class=no-num id=references>References</h2>
 
   <p class=big-issue>This section will be written in a future
-   draft.<!--XXX-->
+   draft.<!--XXX--></p>
+  <!-- XXX check that #refsRFC([0-9]+) is always for [RFC\1] -->
 
   <h2 class=no-num id=acknowledgements>Acknowledgements</h2>
   <!-- ACKS -->

Modified: source
===================================================================
--- source	2008-04-18 22:34:05 UTC (rev 1460)
+++ source	2008-04-18 23:44:32 UTC (rev 1461)
@@ -907,6 +907,7 @@
            attribute DOMString <span title="dom-document-charset">charset</span>;
   readonly attribute DOMString <span title="dom-document-characterSet">characterSet</span>;
   readonly attribute DOMString <span title="dom-document-defaultCharset">defaultCharset</span>;
+  readonly attribute DOMString <span title="dom-document-readyState">readyState</span>;
 
   // <span>DOM tree accessors</span>
            attribute DOMString <span title="dom-document-title">title</span>;
@@ -951,7 +952,6 @@
   DOMString <span title="dom-document-queryCommandValue">queryCommandValue</span>(in DOMString commandId);
   <span>Selection</span> <span title="dom-document-getSelection">getSelection</span>();
 <!-- XXX we're not done here.
- readonly attribute DOMString readyState;
  readonly attribute HTMLCollection scripts;
 -->
 };</pre>
@@ -1155,8 +1155,23 @@
   encoding associated with the user's current geographical location,
   or any arbitrary encoding name.</p>
 
+  <p>Each document has a <dfn>current document readiness</dfn>. When a
+  <code>Document</code> object is created, it must have its
+  <span>current document readiness</span> set to the string
+  "loading". Various algorithms during page loading affect this
+  value. When the value is set, the user agent must <span>fire a
+  simple event</span> called <code
+  title="event-readystatechanged">readystatechanged</code> at the
+  <code>Document</code> object.</p> <!-- XXX define
+  document.onreadystatechange -->
 
+  <p>The <dfn
+  title="dom-document-readyState"><code>readyState</code></dfn> DOM
+  attribute must, on getting, return the <span>current document
+  readiness</span>.</p>
 
+
+
   <h3>Elements</h3>
 
   <p>The nodes representing <span>HTML elements</span> in the DOM must
@@ -28133,7 +28148,7 @@
   <p>The rules for how to convert the bytes of the plain text document
   into actual characters are defined in RFC 2046, RFC 2646, and
   subsequent versions thereof. <a href="#refsRFC2046">[RFC2046]</a> <a
-  href="#refsRFC2046">[RFC2646]</a></p>
+  href="#refsRFC2646">[RFC2646]</a></p>
 
   <p>The <span>document's character encoding</span> must be set to the
   character encoding used to decode the document.</p>
@@ -42686,14 +42701,12 @@
   the document, the user agent must follow the steps in this
   section.</p>
 
-  <p>First, <!--the user agent must <span title="fire a DOMContentLoaded
-  event">fire a <code
-  title="event-DOMContentLoaded">DOMContentLoaded</code> event</span>
-  at <span>the <code>body</code> element</span>.</p>
+  <p>First, the <span>current document readiness</span> must be set to
+  "interactive".</p>
 
-  <p>Then, -->the rules for <span>when a script completes
-  loading</span> start applying (script execution is no longer managed
-  by the parser).</p>
+  <p>Then, the rules for <span>when a script completes loading</span>
+  start applying (script execution is no longer managed by the
+  parser).</p>
 
   <p>If any of the scripts in the <span>list of scripts that will
   execute as soon as possible</span> have <span>completed
@@ -42718,8 +42731,9 @@
   <code>Document</code>.</p>
 
   <p>Once everything that <dfn title="delay the load event">delays the
-  load event</dfn> has completed, the user agent must <span
-  title="fire a load event">fire a <code
+  load event</dfn> has completed, the user agent must set the
+  <span>current document readiness</span> to "complete", and then
+  <span title="fire a load event">fire a <code
   title="event-load">load</code> event</span> at <span>the
   <code>body</code> element</span>.</p>
 
@@ -43709,6 +43723,7 @@
   <p class="big-issue">This section will be written in a future
   draft.<!--XXX--></p>
 
+  <!-- XXX check that #refsRFC([0-9]+) is always for [RFC\1] -->
 
 
   <h2 class="no-num">Acknowledgements</h2> <!-- ACKS -->




More information about the Commit-Watchers mailing list