[html5] r6550 - [giow] (0) Revert r6543 and instead move onreadystatechange to be only on Docume [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Sep 9 15:44:22 PDT 2011


Author: ianh
Date: 2011-09-09 15:44:20 -0700 (Fri, 09 Sep 2011)
New Revision: 6550

Modified:
   complete.html
   index
   source
Log:
[giow] (0) Revert r6543 and instead move onreadystatechange to be only on Document.
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=13965

Modified: complete.html
===================================================================
--- complete.html	2011-09-09 19:56:48 UTC (rev 6549)
+++ complete.html	2011-09-09 22:44:20 UTC (rev 6550)
@@ -9288,7 +9288,6 @@
            attribute <a href=#function>Function</a>? <a href=#handler-onplaying title=handler-onplaying>onplaying</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onprogress title=handler-onprogress>onprogress</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onratechange title=handler-onratechange>onratechange</a>;
-           attribute <a href=#function>Function</a>? <a href=#handler-onreadystatechange title=handler-onreadystatechange>onreadystatechange</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onreset title=handler-onreset>onreset</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onscroll title=handler-onscroll>onscroll</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onseeked title=handler-onseeked>onseeked</a>;
@@ -9301,6 +9300,9 @@
            attribute <a href=#function>Function</a>? <a href=#handler-ontimeupdate title=handler-ontimeupdate>ontimeupdate</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onvolumechange title=handler-onvolumechange>onvolumechange</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onwaiting title=handler-onwaiting>onwaiting</a>;
+
+  // special <a href=#event-handler-idl-attributes>event handler IDL attributes</a> that only apply to Document objects
+           attribute <a href=#function>Function</a>? <a href=#handler-onreadystatechange title=handler-onreadystatechange>onreadystatechange</a>;
 };
 <a href=#document>Document</a> implements <a href=#htmldocument>HTMLDocument</a>;</pre>
 
@@ -10321,7 +10323,6 @@
            attribute <a href=#function>Function</a>? <a href=#handler-onplaying title=handler-onplaying>onplaying</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onprogress title=handler-onprogress>onprogress</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onratechange title=handler-onratechange>onratechange</a>;
-           attribute <a href=#function>Function</a>? <a href=#handler-onreadystatechange title=handler-onreadystatechange>onreadystatechange</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onreset title=handler-onreset>onreset</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onscroll title=handler-onscroll>onscroll</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onseeked title=handler-onseeked>onseeked</a>;
@@ -10425,7 +10426,6 @@
    <li><code title=handler-onplaying><a href=#handler-onplaying>onplaying</a></code></li>
    <li><code title=handler-onprogress><a href=#handler-onprogress>onprogress</a></code></li>
    <li><code title=handler-onratechange><a href=#handler-onratechange>onratechange</a></code></li>
-   <li><code title=handler-onreadystatechange><a href=#handler-onreadystatechange>onreadystatechange</a></code></li>
    <li><code title=handler-onreset><a href=#handler-onreset>onreset</a></code></li>
    <li><code title=handler-onscroll><a href=#handler-onscroll>onscroll</a></code>*</li>
    <li><code title=handler-onseeked><a href=#handler-onseeked>onseeked</a></code></li>
@@ -15220,8 +15220,6 @@
            attribute DOMString <a href=#dom-script-type title=dom-script-type>type</a>;
            attribute DOMString <a href=#dom-script-charset title=dom-script-charset>charset</a>;
            attribute DOMString <a href=#dom-script-text title=dom-script-text>text</a>;
-
-  readonly attribute DOMString <a href=#dom-script-readystate title=dom-script-readyState>readyState</a>;
 };</pre>
    </dd>
   </dl><p>The <code><a href=#the-script-element>script</a></code> element allows authors to include dynamic
@@ -15346,38 +15344,6 @@
   <a href=#parser-inserted>"parser-inserted"</a>, to let the parser know when to
   execute the script.</p>
 
-  <p>The fifth is the <dfn id=concept-script-state title=concept-script-state>current
-  status</dfn> of the script. This is a string. When the element is
-  created, if the user agent does not intend to prefetch the script
-  (i.e. the script, if any, will only be obtained once the
-  <a href=#prepare-a-script>prepare a script</a> algorithm requires it to be fetched),
-  then the <a href=#concept-script-state title=concept-script-state>current status</a>
-  must be set to "<code title="">loaded</code>". If the user agent
-  <em>does</em> intend to prefetch the script (if any), <a href=#scriptPrefetch>as allowed</a> in the <a href=#prepare-a-script>prepare a
-  script</a> algorithm below, the <a href=#concept-script-state title=concept-script-state>current status</a> must be set to
-  "<code title="">uninitialized</code>" when the element is created.
-  When the user agent begins to prefetch the script, it must set the
-  <a href=#concept-script-state title=concept-script-state>current status</a> to "<code title="">loading</code>". Once the script is fetched, the user agent
-  must <a href=#queue-a-task>queue a task</a> that, if the <a href=#prepare-a-script>prepare a
-  script</a> algorithm has still not started and the fetched script
-  is still the appropriate script, sets the <a href=#concept-script-state title=concept-script-state>current status</a> to "<code title="">loaded</code>" and <a href=#fire-a-simple-event title="fire a simple event">fires
-  a simple event</a> named <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> at the
-  element. If the script to be loaded changes while the script is
-  being prefetched, then the user agent must prefetch the new script
-  (if any), without changing the <a href=#concept-script-state title=concept-script-state>current status</a>. If no script is
-  ever successfully fetched (e.g. because the element is an inline
-  script) then the transition to "<code title="">loaded</code>" is
-  skipped, and so the <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> event does
-  not fire for this transition (it still fires when the <a href=#concept-script-state title=concept-script-state>current status</a> is set to "<code title="">complete</code>" later, however). If the script to be
-  loaded changes after a script has been successfully prefetched, the
-  user agent may prefetch the new script but must not change the <a href=#concept-script-state title=concept-script-state>current status</a> or fire any
-  events as a result. If the user agent changes its mind and decides
-  to not bother prefetching the script after all, the user agent must
-  <a href=#queue-a-task>queue a task</a> that, if the <a href=#prepare-a-script>prepare a
-  script</a> algorithm has still not started, sets the <a href=#concept-script-state title=concept-script-state>current status</a> to "<code title="">loaded</code>" and <a href=#fire-a-simple-event title="fire a simple event">fires
-  a simple event</a> named <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> at the
-  element.</p>
-
   <p>The last few pieces of state are <dfn id="the-script-block's-type"><var>the script block's
   type</var></dfn>, <dfn id="the-script-block's-character-encoding"><var>the script block's character
   encoding</var></dfn>, and <dfn id="the-script-block's-fallback-character-encoding"><var>the script block's fallback
@@ -15611,31 +15577,10 @@
     user agent must act as if it had received an empty HTTP 400
     response.</p>
 
-    <p>If the <a href=#concept-script-state title=concept-script-state>current status</a>
-    of the element at this stage is still "<code title="">uninitialized</code>" (meaning that the user agent
-    intended to prefetch the script as described in the next
-    paragraph, but the <a href=#prepare-a-script>prepare a script</a> algorithm was
-    started before it had a chance to do so), then, if a
-    <a href=#fetch>fetch</a> attempt was started in this step, the user
-    agent must set the <a href=#concept-script-state title=concept-script-state>current
-    status</a> to "<code title="">loading</code>" <!--and
-    <span>queue a task</span> to <span>fire a simple event</span>
-    named <code title="event-readystatechange">readystatechange</code>
-    at the element-->. <!--(If the fetching is started as part of a
-    prefetch, then no <code
-    title="event-readystatechange">readystatechange</code> is fired
-    when <span title="concept-script-state">current status</span> is
-    set to "<code title="">loading</code>".)--></p> <!-- commented out
-    text is what IE does, but IE actually does stuff even more
-    complicated than that which I haven't tried to match exactly here
-    since it's just arcane -->
-
-    <p id=scriptPrefetch>For performance reasons, user agents may
-    start fetching the script as soon as the attribute is set,
-    instead, in the hope that the element will be inserted into the
-    document (user agents that do this have <a href=#concept-script-state title=concept-script-state>requirements</a> relating to what
-    events are to be fired during the process). Either way, once the
-    element is <a href=#insert-an-element-into-a-document title="insert an element into a
+    <p>For performance reasons, user agents may start fetching the
+    script as soon as the attribute is set, instead, in the hope that
+    the element will be inserted into the document. Either way, once
+    the element is <a href=#insert-an-element-into-a-document title="insert an element into a
     document">inserted into the document</a>, the load must have
     started. If the UA performs such prefetching, but the element is
     never inserted in the document, or the <code title=attr-script-src><a href=#attr-script-src>src</a></code> attribute is dynamically
@@ -15819,18 +15764,6 @@
 
   <ol><li>
 
-    <p>If the <a href=#concept-script-state title=concept-script-state>current status</a>
-    of the element at this stage is "<code title="">loading</code>"
-    (meaning that the user agent intended to <a href=#scriptPrefetch>prefetch the script</a> as allowed by the
-    <a href=#prepare-a-script>prepare a script</a> algorithm, but the fetch was not
-    completed before that algorithm was started), then the user agent
-    must set the <a href=#concept-script-state title=concept-script-state>current
-    status</a> to "<code title="">loaded</code>".</p>
-
-   </li>
-
-   <li>
-
     <p>If the element is flagged as <a href=#parser-inserted>"parser-inserted"</a>,
     but the element's <code><a href=#document>Document</a></code> is not the
     <code><a href=#document>Document</a></code> of the parser that created the element, then
@@ -15845,21 +15778,9 @@
     <dl class=switch><dt>If the load resulted in an error (for example a DNS error, or
      an HTTP 404 error)</dt>
 
-     <dd>
+     <dd><p>Executing the script block must just consist of <a href=#fire-a-simple-event title="fire a simple event">firing a simple event</a> named
+     <code title=event-error>error</code> at the element.</dd>
 
-      <p>Executing the script block must consist of running the following steps:</p>
-
-      <ol><li><p>Set the <a href=#concept-script-state title=concept-script-state>current
-       status</a> to "<code title="">complete</code>".</li>
-
-       <li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> at the
-       element.</li>
-
-       <li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-error>error</code> at the element.</li>
-
-      </ol></dd>
-
-
      <dt>If the load was successful</dt>
 
      <!-- SCRIPT EXEC -->
@@ -15989,9 +15910,6 @@
 
        </li>
 
-       <li><p>Set the <a href=#concept-script-state title=concept-script-state>current
-       status</a> to "<code title="">interactive</code>".</li>
-
        <li>
 
         <p><a href=#create-a-script-from-a-node title="create a script from a node">Create a
@@ -16012,12 +15930,6 @@
 
        </li>
 
-       <li><p>Set the <a href=#concept-script-state title=concept-script-state>current
-       status</a> to "<code title="">complete</code>".</li>
-
-       <li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> at the
-       element.</li>
-
        <li>
 
         <p>If the script is from an external file, <a href=#fire-a-simple-event>fire a simple
@@ -16064,51 +15976,6 @@
 
    </dd>
 
-
-   <dt><var title="">script</var> . <code title=dom-script-readyState><a href=#dom-script-readystate>readyState</a></code></dt>
-
-   <dd>
-
-    <p>Returns the current state of the element. The value is one of
-    the following:</p>
-
-    <dl><dt>"<code title="">uninitialized</code>"</dt>
-
-     <dd><p>The script file, if any, has not yet been loaded, but the
-     user agent will try to prefetch it as soon as possible (e.g. as
-     soon as the <code title=attr-script-src><a href=#attr-script-src>src</a></code> attribute is
-     set).</dd>
-
-
-     <dt>"<code title="">loading</code>"</dt>
-
-     <dd><p>A script file is being downloaded in a user agent that
-     supports prefetching scripts.</dd>
-
-
-     <dt>"<code title="">loaded</code>"</dt>
-
-     <dd><p>Either a script file is loaded and ready to be executed,
-     or the script file is not loaded but the user agent does not
-     intend to prefetch the script file anyway, and will merely fetch
-     it when it is to be executed. If the element started in the <code title="">uninitialized</code>" state and the script has not yet
-     begun to be executed, then a <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> event is
-     fired when the state changes to this value.</dd>
-
-
-     <dt>"<code title="">interactive</code>"</dt>
-
-     <dd><p>The script is running.</dd>
-
-
-     <dt>"<code title="">complete</code>"</dt>
-
-     <dd><p>The script has been executed (or it failed). A <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> event is
-     fired when the state changes to this value, just before the
-     corresponding <code title=event-load>load</code> or <code title=event-error>error</code> event.</dd>
-
-    </dl></dd>
-
   </dl><div class=impl>
 
   <p>The IDL attribute <dfn id=dom-script-text title=dom-script-text><code>text</code></dfn> must return a
@@ -16118,10 +15985,6 @@
   tree order. On setting, it must act the same way as the
   <code><a href=#textcontent>textContent</a></code> IDL attribute.</p>
 
-  <p>The IDL attribute <dfn id=dom-script-readystate title=dom-script-readyState><code>readyState</code></dfn> must
-  return the element's <a href=#concept-script-state title=concept-script-state>current
-  status</a>.</p>
-
   </div>
 
   <p class=note>When inserted using the <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> method,
@@ -62103,7 +61966,6 @@
            attribute <a href=#function>Function</a>? <a href=#handler-window-onpopstate title=handler-window-onpopstate>onpopstate</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onprogress title=handler-onprogress>onprogress</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onratechange title=handler-onratechange>onratechange</a>;
-           attribute <a href=#function>Function</a>? <a href=#handler-onreadystatechange title=handler-onreadystatechange>onreadystatechange</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onreset title=handler-onreset>onreset</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-window-onresize title=handler-window-onresize>onresize</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onscroll title=handler-onscroll>onscroll</a>;
@@ -68943,10 +68805,10 @@
 
   <p>The following are the <a href=#event-handlers>event handlers</a> (and their
   corresponding <a href=#event-handler-event-type title="event handler event type">event handler
-  event types</a>) <span class=impl>that must be</span> supported by all <a href=#html-elements>HTML
-  elements</a>, as both content attributes and IDL attributes, and
-  on <code><a href=#document>Document</a></code> and <code><a href=#window>Window</a></code> objects, as IDL
-  attributes.</p>
+  event types</a>) <span class=impl>that must be</span> supported
+  by all <a href=#html-elements>HTML elements</a>, as both content attributes and
+  IDL attributes, and on <code><a href=#document>Document</a></code> and <code><a href=#window>Window</a></code>
+  objects, as IDL attributes.</p>
 
   <table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
    <tbody><tr><td><dfn id=handler-onabort title=handler-onabort><code>onabort</code></dfn> <td> <code title=event-abort>abort</code>
@@ -68986,7 +68848,6 @@
     <tr><td><dfn id=handler-onplaying title=handler-onplaying><code>onplaying</code></dfn> <td> <code title=event-media-playing><a href=#event-media-playing>playing</a></code>
     <tr><td><dfn id=handler-onprogress title=handler-onprogress><code>onprogress</code></dfn> <td> <code title=event-media-progress><a href=#event-media-progress>progress</a></code>
     <tr><td><dfn id=handler-onratechange title=handler-onratechange><code>onratechange</code></dfn> <td> <code title=event-media-ratechange><a href=#event-media-ratechange>ratechange</a></code>
-    <tr><td><dfn id=handler-onreadystatechange title=handler-onreadystatechange><code>onreadystatechange</code></dfn> <td> <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code>
     <tr><td><dfn id=handler-onreset title=handler-onreset><code>onreset</code></dfn> <td> <code title=event-reset>reset</code>
     <tr><td><dfn id=handler-onseeked title=handler-onseeked><code>onseeked</code></dfn> <td> <code title=event-media-seeked><a href=#event-media-seeked>seeked</a></code>
     <tr><td><dfn id=handler-onseeking title=handler-onseeking><code>onseeking</code></dfn> <td> <code title=event-media-seeking><a href=#event-media-seeking>seeking</a></code>
@@ -69007,10 +68868,10 @@
 <!--<tr><td><dfn title="handler-onselectstart"><code>onselectstart</code></dfn> <td> <code title="event-selectstart">selectstart</code>--> <!-- widely used -->
   </table><hr><p>The following are the <a href=#event-handlers>event handlers</a> (and their
   corresponding <a href=#event-handler-event-type title="event handler event type">event handler
-  event types</a>) <span class=impl>that must be</span> supported by all <a href=#html-elements>HTML
-  elements</a> other than <code><a href=#the-body-element>body</a></code>, as both content
-  attributes and IDL attributes, and on <code><a href=#document>Document</a></code> objects,
-  as IDL attributes:</p>
+  event types</a>) <span class=impl>that must be</span> supported
+  by all <a href=#html-elements>HTML elements</a> other than <code><a href=#the-body-element>body</a></code>, as
+  both content attributes and IDL attributes, and on
+  <code><a href=#document>Document</a></code> objects, as IDL attributes:</p>
 
   <table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
    <tbody><tr><td><dfn id=handler-onblur title=handler-onblur><code>onblur</code></dfn> <td> <code title=event-blur>blur</code> <!-- widely used -->
@@ -69020,10 +68881,11 @@
     <tr><td><dfn id=handler-onscroll title=handler-onscroll><code>onscroll</code></dfn> <td> <code title=event-scroll>scroll</code>
   </table><hr><p>The following are the <a href=#event-handlers>event handlers</a> (and their
   corresponding <a href=#event-handler-event-type title="event handler event type">event handler
-  event types</a>) <span class=impl>that must be</span> supported by <code><a href=#window>Window</a></code>
-  objects, as IDL attributes on the <code><a href=#window>Window</a></code> object, and
-  with corresponding content attributes and IDL attributes exposed on
-  the <code><a href=#the-body-element>body</a></code> and <code><a href=#frameset>frameset</a></code> elements:</p>
+  event types</a>) <span class=impl>that must be</span> supported
+  by <code><a href=#window>Window</a></code> objects, as IDL attributes on the
+  <code><a href=#window>Window</a></code> object, and with corresponding content
+  attributes and IDL attributes exposed on the <code><a href=#the-body-element>body</a></code> and
+  <code><a href=#frameset>frameset</a></code> elements:</p>
 
   <table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
    <tbody><tr><td><dfn id=handler-window-onafterprint title=handler-window-onafterprint><code>onafterprint</code></dfn> <td> <code title=event-afterprint>afterprint</code>
@@ -69047,8 +68909,22 @@
   </table><p class=note>The <code title=handler-window-onerror><a href=#handler-window-onerror>onerror</a></code>
   handler is also used for <a href=#runtime-script-errors>reporting script errors</a>.</p>
 
+  <hr><!-- this guy is only on HTMLDocument and not on HTMLElement because
+  otherwise HTMLScriptElement would have it and that causes
+  compatibility issues since IE fires readystatechange events on
+  <script>, not load events, and we can't fire both, and some sites
+  try to decide which to look for based on the presence of
+  script.onreadystatechange on HTMLScriptElement.
+     http://www.w3.org/Bugs/Public/show_bug.cgi?id=13965
+     http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-September/033136.html
+  --><p>The following are the <a href=#event-handlers>event handlers</a> (and their
+  corresponding <a href=#event-handler-event-type title="event handler event type">event handler
+  event types</a>) <span class=impl>that must be</span> supported
+  on <code><a href=#document>Document</a></code> objects as IDL attributes:</p>
 
-  <div class=impl>
+  <table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
+   <tbody><tr><td><dfn id=handler-onreadystatechange title=handler-onreadystatechange><code>onreadystatechange</code></dfn> <td> <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code>
+  </table><div class=impl>
 
   <h5 id=event-firing><span class=secno>7.1.6.3 </span>Event firing</h5>
 
@@ -99975,11 +99851,6 @@
      <td> <code title=event-media-ratechange><a href=#event-media-ratechange>ratechange</a></code> event handler
      <td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
 
-    <tr><th id=ix-handler-onreadystatechange> <code title="">onreadystatechange</code>
-     <td> <a href=#handler-onreadystatechange title=handler-onreadystatechange>HTML elements</a>
-     <td> <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> event handler
-     <td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
-
     <tr><th id=ix-handler-onreset> <code title="">onreset</code>
      <td> <a href=#handler-onreset title=handler-onreset>HTML elements</a>
      <td> <code title=event-reset>reset</code> event handler

Modified: index
===================================================================
--- index	2011-09-09 19:56:48 UTC (rev 6549)
+++ index	2011-09-09 22:44:20 UTC (rev 6550)
@@ -9152,7 +9152,6 @@
            attribute <a href=#function>Function</a>? <a href=#handler-onplaying title=handler-onplaying>onplaying</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onprogress title=handler-onprogress>onprogress</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onratechange title=handler-onratechange>onratechange</a>;
-           attribute <a href=#function>Function</a>? <a href=#handler-onreadystatechange title=handler-onreadystatechange>onreadystatechange</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onreset title=handler-onreset>onreset</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onscroll title=handler-onscroll>onscroll</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onseeked title=handler-onseeked>onseeked</a>;
@@ -9165,6 +9164,9 @@
            attribute <a href=#function>Function</a>? <a href=#handler-ontimeupdate title=handler-ontimeupdate>ontimeupdate</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onvolumechange title=handler-onvolumechange>onvolumechange</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onwaiting title=handler-onwaiting>onwaiting</a>;
+
+  // special <a href=#event-handler-idl-attributes>event handler IDL attributes</a> that only apply to Document objects
+           attribute <a href=#function>Function</a>? <a href=#handler-onreadystatechange title=handler-onreadystatechange>onreadystatechange</a>;
 };
 <a href=#document>Document</a> implements <a href=#htmldocument>HTMLDocument</a>;</pre>
 
@@ -10185,7 +10187,6 @@
            attribute <a href=#function>Function</a>? <a href=#handler-onplaying title=handler-onplaying>onplaying</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onprogress title=handler-onprogress>onprogress</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onratechange title=handler-onratechange>onratechange</a>;
-           attribute <a href=#function>Function</a>? <a href=#handler-onreadystatechange title=handler-onreadystatechange>onreadystatechange</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onreset title=handler-onreset>onreset</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onscroll title=handler-onscroll>onscroll</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onseeked title=handler-onseeked>onseeked</a>;
@@ -10289,7 +10290,6 @@
    <li><code title=handler-onplaying><a href=#handler-onplaying>onplaying</a></code></li>
    <li><code title=handler-onprogress><a href=#handler-onprogress>onprogress</a></code></li>
    <li><code title=handler-onratechange><a href=#handler-onratechange>onratechange</a></code></li>
-   <li><code title=handler-onreadystatechange><a href=#handler-onreadystatechange>onreadystatechange</a></code></li>
    <li><code title=handler-onreset><a href=#handler-onreset>onreset</a></code></li>
    <li><code title=handler-onscroll><a href=#handler-onscroll>onscroll</a></code>*</li>
    <li><code title=handler-onseeked><a href=#handler-onseeked>onseeked</a></code></li>
@@ -15084,8 +15084,6 @@
            attribute DOMString <a href=#dom-script-type title=dom-script-type>type</a>;
            attribute DOMString <a href=#dom-script-charset title=dom-script-charset>charset</a>;
            attribute DOMString <a href=#dom-script-text title=dom-script-text>text</a>;
-
-  readonly attribute DOMString <a href=#dom-script-readystate title=dom-script-readyState>readyState</a>;
 };</pre>
    </dd>
   </dl><p>The <code><a href=#the-script-element>script</a></code> element allows authors to include dynamic
@@ -15210,38 +15208,6 @@
   <a href=#parser-inserted>"parser-inserted"</a>, to let the parser know when to
   execute the script.</p>
 
-  <p>The fifth is the <dfn id=concept-script-state title=concept-script-state>current
-  status</dfn> of the script. This is a string. When the element is
-  created, if the user agent does not intend to prefetch the script
-  (i.e. the script, if any, will only be obtained once the
-  <a href=#prepare-a-script>prepare a script</a> algorithm requires it to be fetched),
-  then the <a href=#concept-script-state title=concept-script-state>current status</a>
-  must be set to "<code title="">loaded</code>". If the user agent
-  <em>does</em> intend to prefetch the script (if any), <a href=#scriptPrefetch>as allowed</a> in the <a href=#prepare-a-script>prepare a
-  script</a> algorithm below, the <a href=#concept-script-state title=concept-script-state>current status</a> must be set to
-  "<code title="">uninitialized</code>" when the element is created.
-  When the user agent begins to prefetch the script, it must set the
-  <a href=#concept-script-state title=concept-script-state>current status</a> to "<code title="">loading</code>". Once the script is fetched, the user agent
-  must <a href=#queue-a-task>queue a task</a> that, if the <a href=#prepare-a-script>prepare a
-  script</a> algorithm has still not started and the fetched script
-  is still the appropriate script, sets the <a href=#concept-script-state title=concept-script-state>current status</a> to "<code title="">loaded</code>" and <a href=#fire-a-simple-event title="fire a simple event">fires
-  a simple event</a> named <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> at the
-  element. If the script to be loaded changes while the script is
-  being prefetched, then the user agent must prefetch the new script
-  (if any), without changing the <a href=#concept-script-state title=concept-script-state>current status</a>. If no script is
-  ever successfully fetched (e.g. because the element is an inline
-  script) then the transition to "<code title="">loaded</code>" is
-  skipped, and so the <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> event does
-  not fire for this transition (it still fires when the <a href=#concept-script-state title=concept-script-state>current status</a> is set to "<code title="">complete</code>" later, however). If the script to be
-  loaded changes after a script has been successfully prefetched, the
-  user agent may prefetch the new script but must not change the <a href=#concept-script-state title=concept-script-state>current status</a> or fire any
-  events as a result. If the user agent changes its mind and decides
-  to not bother prefetching the script after all, the user agent must
-  <a href=#queue-a-task>queue a task</a> that, if the <a href=#prepare-a-script>prepare a
-  script</a> algorithm has still not started, sets the <a href=#concept-script-state title=concept-script-state>current status</a> to "<code title="">loaded</code>" and <a href=#fire-a-simple-event title="fire a simple event">fires
-  a simple event</a> named <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> at the
-  element.</p>
-
   <p>The last few pieces of state are <dfn id="the-script-block's-type"><var>the script block's
   type</var></dfn>, <dfn id="the-script-block's-character-encoding"><var>the script block's character
   encoding</var></dfn>, and <dfn id="the-script-block's-fallback-character-encoding"><var>the script block's fallback
@@ -15475,31 +15441,10 @@
     user agent must act as if it had received an empty HTTP 400
     response.</p>
 
-    <p>If the <a href=#concept-script-state title=concept-script-state>current status</a>
-    of the element at this stage is still "<code title="">uninitialized</code>" (meaning that the user agent
-    intended to prefetch the script as described in the next
-    paragraph, but the <a href=#prepare-a-script>prepare a script</a> algorithm was
-    started before it had a chance to do so), then, if a
-    <a href=#fetch>fetch</a> attempt was started in this step, the user
-    agent must set the <a href=#concept-script-state title=concept-script-state>current
-    status</a> to "<code title="">loading</code>" <!--and
-    <span>queue a task</span> to <span>fire a simple event</span>
-    named <code title="event-readystatechange">readystatechange</code>
-    at the element-->. <!--(If the fetching is started as part of a
-    prefetch, then no <code
-    title="event-readystatechange">readystatechange</code> is fired
-    when <span title="concept-script-state">current status</span> is
-    set to "<code title="">loading</code>".)--></p> <!-- commented out
-    text is what IE does, but IE actually does stuff even more
-    complicated than that which I haven't tried to match exactly here
-    since it's just arcane -->
-
-    <p id=scriptPrefetch>For performance reasons, user agents may
-    start fetching the script as soon as the attribute is set,
-    instead, in the hope that the element will be inserted into the
-    document (user agents that do this have <a href=#concept-script-state title=concept-script-state>requirements</a> relating to what
-    events are to be fired during the process). Either way, once the
-    element is <a href=#insert-an-element-into-a-document title="insert an element into a
+    <p>For performance reasons, user agents may start fetching the
+    script as soon as the attribute is set, instead, in the hope that
+    the element will be inserted into the document. Either way, once
+    the element is <a href=#insert-an-element-into-a-document title="insert an element into a
     document">inserted into the document</a>, the load must have
     started. If the UA performs such prefetching, but the element is
     never inserted in the document, or the <code title=attr-script-src><a href=#attr-script-src>src</a></code> attribute is dynamically
@@ -15683,18 +15628,6 @@
 
   <ol><li>
 
-    <p>If the <a href=#concept-script-state title=concept-script-state>current status</a>
-    of the element at this stage is "<code title="">loading</code>"
-    (meaning that the user agent intended to <a href=#scriptPrefetch>prefetch the script</a> as allowed by the
-    <a href=#prepare-a-script>prepare a script</a> algorithm, but the fetch was not
-    completed before that algorithm was started), then the user agent
-    must set the <a href=#concept-script-state title=concept-script-state>current
-    status</a> to "<code title="">loaded</code>".</p>
-
-   </li>
-
-   <li>
-
     <p>If the element is flagged as <a href=#parser-inserted>"parser-inserted"</a>,
     but the element's <code><a href=#document>Document</a></code> is not the
     <code><a href=#document>Document</a></code> of the parser that created the element, then
@@ -15709,21 +15642,9 @@
     <dl class=switch><dt>If the load resulted in an error (for example a DNS error, or
      an HTTP 404 error)</dt>
 
-     <dd>
+     <dd><p>Executing the script block must just consist of <a href=#fire-a-simple-event title="fire a simple event">firing a simple event</a> named
+     <code title=event-error>error</code> at the element.</dd>
 
-      <p>Executing the script block must consist of running the following steps:</p>
-
-      <ol><li><p>Set the <a href=#concept-script-state title=concept-script-state>current
-       status</a> to "<code title="">complete</code>".</li>
-
-       <li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> at the
-       element.</li>
-
-       <li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-error>error</code> at the element.</li>
-
-      </ol></dd>
-
-
      <dt>If the load was successful</dt>
 
      <!-- SCRIPT EXEC -->
@@ -15853,9 +15774,6 @@
 
        </li>
 
-       <li><p>Set the <a href=#concept-script-state title=concept-script-state>current
-       status</a> to "<code title="">interactive</code>".</li>
-
        <li>
 
         <p><a href=#create-a-script-from-a-node title="create a script from a node">Create a
@@ -15876,12 +15794,6 @@
 
        </li>
 
-       <li><p>Set the <a href=#concept-script-state title=concept-script-state>current
-       status</a> to "<code title="">complete</code>".</li>
-
-       <li><p><a href=#fire-a-simple-event>Fire a simple event</a> named <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> at the
-       element.</li>
-
        <li>
 
         <p>If the script is from an external file, <a href=#fire-a-simple-event>fire a simple
@@ -15928,51 +15840,6 @@
 
    </dd>
 
-
-   <dt><var title="">script</var> . <code title=dom-script-readyState><a href=#dom-script-readystate>readyState</a></code></dt>
-
-   <dd>
-
-    <p>Returns the current state of the element. The value is one of
-    the following:</p>
-
-    <dl><dt>"<code title="">uninitialized</code>"</dt>
-
-     <dd><p>The script file, if any, has not yet been loaded, but the
-     user agent will try to prefetch it as soon as possible (e.g. as
-     soon as the <code title=attr-script-src><a href=#attr-script-src>src</a></code> attribute is
-     set).</dd>
-
-
-     <dt>"<code title="">loading</code>"</dt>
-
-     <dd><p>A script file is being downloaded in a user agent that
-     supports prefetching scripts.</dd>
-
-
-     <dt>"<code title="">loaded</code>"</dt>
-
-     <dd><p>Either a script file is loaded and ready to be executed,
-     or the script file is not loaded but the user agent does not
-     intend to prefetch the script file anyway, and will merely fetch
-     it when it is to be executed. If the element started in the <code title="">uninitialized</code>" state and the script has not yet
-     begun to be executed, then a <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> event is
-     fired when the state changes to this value.</dd>
-
-
-     <dt>"<code title="">interactive</code>"</dt>
-
-     <dd><p>The script is running.</dd>
-
-
-     <dt>"<code title="">complete</code>"</dt>
-
-     <dd><p>The script has been executed (or it failed). A <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> event is
-     fired when the state changes to this value, just before the
-     corresponding <code title=event-load>load</code> or <code title=event-error>error</code> event.</dd>
-
-    </dl></dd>
-
   </dl><div class=impl>
 
   <p>The IDL attribute <dfn id=dom-script-text title=dom-script-text><code>text</code></dfn> must return a
@@ -15982,10 +15849,6 @@
   tree order. On setting, it must act the same way as the
   <code><a href=#textcontent>textContent</a></code> IDL attribute.</p>
 
-  <p>The IDL attribute <dfn id=dom-script-readystate title=dom-script-readyState><code>readyState</code></dfn> must
-  return the element's <a href=#concept-script-state title=concept-script-state>current
-  status</a>.</p>
-
   </div>
 
   <p class=note>When inserted using the <code title=dom-document-write><a href=#dom-document-write>document.write()</a></code> method,
@@ -61970,7 +61833,6 @@
            attribute <a href=#function>Function</a>? <a href=#handler-window-onpopstate title=handler-window-onpopstate>onpopstate</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onprogress title=handler-onprogress>onprogress</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onratechange title=handler-onratechange>onratechange</a>;
-           attribute <a href=#function>Function</a>? <a href=#handler-onreadystatechange title=handler-onreadystatechange>onreadystatechange</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onreset title=handler-onreset>onreset</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-window-onresize title=handler-window-onresize>onresize</a>;
            attribute <a href=#function>Function</a>? <a href=#handler-onscroll title=handler-onscroll>onscroll</a>;
@@ -68830,10 +68692,10 @@
 
   <p>The following are the <a href=#event-handlers>event handlers</a> (and their
   corresponding <a href=#event-handler-event-type title="event handler event type">event handler
-  event types</a>) <span class=impl>that must be</span> supported by all <a href=#html-elements>HTML
-  elements</a>, as both content attributes and IDL attributes, and
-  on <code><a href=#document>Document</a></code> and <code><a href=#window>Window</a></code> objects, as IDL
-  attributes.</p>
+  event types</a>) <span class=impl>that must be</span> supported
+  by all <a href=#html-elements>HTML elements</a>, as both content attributes and
+  IDL attributes, and on <code><a href=#document>Document</a></code> and <code><a href=#window>Window</a></code>
+  objects, as IDL attributes.</p>
 
   <table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
    <tbody><tr><td><dfn id=handler-onabort title=handler-onabort><code>onabort</code></dfn> <td> <code title=event-abort>abort</code>
@@ -68873,7 +68735,6 @@
     <tr><td><dfn id=handler-onplaying title=handler-onplaying><code>onplaying</code></dfn> <td> <code title=event-media-playing><a href=#event-media-playing>playing</a></code>
     <tr><td><dfn id=handler-onprogress title=handler-onprogress><code>onprogress</code></dfn> <td> <code title=event-media-progress><a href=#event-media-progress>progress</a></code>
     <tr><td><dfn id=handler-onratechange title=handler-onratechange><code>onratechange</code></dfn> <td> <code title=event-media-ratechange><a href=#event-media-ratechange>ratechange</a></code>
-    <tr><td><dfn id=handler-onreadystatechange title=handler-onreadystatechange><code>onreadystatechange</code></dfn> <td> <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code>
     <tr><td><dfn id=handler-onreset title=handler-onreset><code>onreset</code></dfn> <td> <code title=event-reset>reset</code>
     <tr><td><dfn id=handler-onseeked title=handler-onseeked><code>onseeked</code></dfn> <td> <code title=event-media-seeked><a href=#event-media-seeked>seeked</a></code>
     <tr><td><dfn id=handler-onseeking title=handler-onseeking><code>onseeking</code></dfn> <td> <code title=event-media-seeking><a href=#event-media-seeking>seeking</a></code>
@@ -68894,10 +68755,10 @@
 <!--<tr><td><dfn title="handler-onselectstart"><code>onselectstart</code></dfn> <td> <code title="event-selectstart">selectstart</code>--> <!-- widely used -->
   </table><hr><p>The following are the <a href=#event-handlers>event handlers</a> (and their
   corresponding <a href=#event-handler-event-type title="event handler event type">event handler
-  event types</a>) <span class=impl>that must be</span> supported by all <a href=#html-elements>HTML
-  elements</a> other than <code><a href=#the-body-element>body</a></code>, as both content
-  attributes and IDL attributes, and on <code><a href=#document>Document</a></code> objects,
-  as IDL attributes:</p>
+  event types</a>) <span class=impl>that must be</span> supported
+  by all <a href=#html-elements>HTML elements</a> other than <code><a href=#the-body-element>body</a></code>, as
+  both content attributes and IDL attributes, and on
+  <code><a href=#document>Document</a></code> objects, as IDL attributes:</p>
 
   <table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
    <tbody><tr><td><dfn id=handler-onblur title=handler-onblur><code>onblur</code></dfn> <td> <code title=event-blur>blur</code> <!-- widely used -->
@@ -68907,10 +68768,11 @@
     <tr><td><dfn id=handler-onscroll title=handler-onscroll><code>onscroll</code></dfn> <td> <code title=event-scroll>scroll</code>
   </table><hr><p>The following are the <a href=#event-handlers>event handlers</a> (and their
   corresponding <a href=#event-handler-event-type title="event handler event type">event handler
-  event types</a>) <span class=impl>that must be</span> supported by <code><a href=#window>Window</a></code>
-  objects, as IDL attributes on the <code><a href=#window>Window</a></code> object, and
-  with corresponding content attributes and IDL attributes exposed on
-  the <code><a href=#the-body-element>body</a></code> and <code><a href=#frameset>frameset</a></code> elements:</p>
+  event types</a>) <span class=impl>that must be</span> supported
+  by <code><a href=#window>Window</a></code> objects, as IDL attributes on the
+  <code><a href=#window>Window</a></code> object, and with corresponding content
+  attributes and IDL attributes exposed on the <code><a href=#the-body-element>body</a></code> and
+  <code><a href=#frameset>frameset</a></code> elements:</p>
 
   <table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
    <tbody><tr><td><dfn id=handler-window-onafterprint title=handler-window-onafterprint><code>onafterprint</code></dfn> <td> <code title=event-afterprint>afterprint</code>
@@ -68934,8 +68796,22 @@
   </table><p class=note>The <code title=handler-window-onerror><a href=#handler-window-onerror>onerror</a></code>
   handler is also used for <a href=#runtime-script-errors>reporting script errors</a>.</p>
 
+  <hr><!-- this guy is only on HTMLDocument and not on HTMLElement because
+  otherwise HTMLScriptElement would have it and that causes
+  compatibility issues since IE fires readystatechange events on
+  <script>, not load events, and we can't fire both, and some sites
+  try to decide which to look for based on the presence of
+  script.onreadystatechange on HTMLScriptElement.
+     http://www.w3.org/Bugs/Public/show_bug.cgi?id=13965
+     http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-September/033136.html
+  --><p>The following are the <a href=#event-handlers>event handlers</a> (and their
+  corresponding <a href=#event-handler-event-type title="event handler event type">event handler
+  event types</a>) <span class=impl>that must be</span> supported
+  on <code><a href=#document>Document</a></code> objects as IDL attributes:</p>
 
-  <div class=impl>
+  <table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
+   <tbody><tr><td><dfn id=handler-onreadystatechange title=handler-onreadystatechange><code>onreadystatechange</code></dfn> <td> <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code>
+  </table><div class=impl>
 
   <h5 id=event-firing><span class=secno>7.1.6.3 </span>Event firing</h5>
 
@@ -95422,11 +95298,6 @@
      <td> <code title=event-media-ratechange><a href=#event-media-ratechange>ratechange</a></code> event handler
      <td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
 
-    <tr><th id=ix-handler-onreadystatechange> <code title="">onreadystatechange</code>
-     <td> <a href=#handler-onreadystatechange title=handler-onreadystatechange>HTML elements</a>
-     <td> <code title=event-readystatechange><a href=#event-readystatechange>readystatechange</a></code> event handler
-     <td> <a href=#event-handler-content-attributes title="event handler content attributes">Event handler content attribute</a>
-
     <tr><th id=ix-handler-onreset> <code title="">onreset</code>
      <td> <a href=#handler-onreset title=handler-onreset>HTML elements</a>
      <td> <code title=event-reset>reset</code> event handler

Modified: source
===================================================================
--- source	2011-09-09 19:56:48 UTC (rev 6549)
+++ source	2011-09-09 22:44:20 UTC (rev 6550)
@@ -9301,7 +9301,6 @@
            attribute <span>Function</span>? <span title="handler-onplaying">onplaying</span>;
            attribute <span>Function</span>? <span title="handler-onprogress">onprogress</span>;
            attribute <span>Function</span>? <span title="handler-onratechange">onratechange</span>;
-           attribute <span>Function</span>? <span title="handler-onreadystatechange">onreadystatechange</span>;
            attribute <span>Function</span>? <span title="handler-onreset">onreset</span>;
            attribute <span>Function</span>? <span title="handler-onscroll">onscroll</span>;
            attribute <span>Function</span>? <span title="handler-onseeked">onseeked</span>;
@@ -9314,6 +9313,9 @@
            attribute <span>Function</span>? <span title="handler-ontimeupdate">ontimeupdate</span>;
            attribute <span>Function</span>? <span title="handler-onvolumechange">onvolumechange</span>;
            attribute <span>Function</span>? <span title="handler-onwaiting">onwaiting</span>;
+
+  // special <span>event handler IDL attributes</span> that only apply to Document objects
+           attribute <span>Function</span>? <span title="handler-onreadystatechange">onreadystatechange</span>;
 };
 <span>Document</span> implements <span>HTMLDocument</span>;</pre>
 
@@ -10507,7 +10509,6 @@
            attribute <span>Function</span>? <span title="handler-onplaying">onplaying</span>;
            attribute <span>Function</span>? <span title="handler-onprogress">onprogress</span>;
            attribute <span>Function</span>? <span title="handler-onratechange">onratechange</span>;
-           attribute <span>Function</span>? <span title="handler-onreadystatechange">onreadystatechange</span>;
            attribute <span>Function</span>? <span title="handler-onreset">onreset</span>;
            attribute <span>Function</span>? <span title="handler-onscroll">onscroll</span>;
            attribute <span>Function</span>? <span title="handler-onseeked">onseeked</span>;
@@ -10617,7 +10618,6 @@
    <li><code title="handler-onplaying">onplaying</code></li>
    <li><code title="handler-onprogress">onprogress</code></li>
    <li><code title="handler-onratechange">onratechange</code></li>
-   <li><code title="handler-onreadystatechange">onreadystatechange</code></li>
    <li><code title="handler-onreset">onreset</code></li>
    <li><code title="handler-onscroll">onscroll</code>*</li>
    <li><code title="handler-onseeked">onseeked</code></li>
@@ -16119,8 +16119,6 @@
            attribute DOMString <span title="dom-script-type">type</span>;
            attribute DOMString <span title="dom-script-charset">charset</span>;
            attribute DOMString <span title="dom-script-text">text</span>;
-
-  readonly attribute DOMString <span title="dom-script-readyState">readyState</span>;
 };</pre>
    </dd>
   </dl>
@@ -16264,52 +16262,6 @@
   <span>"parser-inserted"</span>, to let the parser know when to
   execute the script.</p>
 
-  <p>The fifth is the <dfn title="concept-script-state">current
-  status</dfn> of the script. This is a string. When the element is
-  created, if the user agent does not intend to prefetch the script
-  (i.e. the script, if any, will only be obtained once the
-  <span>prepare a script</span> algorithm requires it to be fetched),
-  then the <span title="concept-script-state">current status</span>
-  must be set to "<code title="">loaded</code>". If the user agent
-  <em>does</em> intend to prefetch the script (if any), <a
-  href="#scriptPrefetch">as allowed</a> in the <span>prepare a
-  script</span> algorithm below, the <span
-  title="concept-script-state">current status</span> must be set to
-  "<code title="">uninitialized</code>" when the element is created.
-  When the user agent begins to prefetch the script, it must set the
-  <span title="concept-script-state">current status</span> to "<code
-  title="">loading</code>". Once the script is fetched, the user agent
-  must <span>queue a task</span> that, if the <span>prepare a
-  script</span> algorithm has still not started and the fetched script
-  is still the appropriate script, sets the <span
-  title="concept-script-state">current status</span> to "<code
-  title="">loaded</code>" and <span title="fire a simple event">fires
-  a simple event</span> named <code
-  title="event-readystatechange">readystatechange</code> at the
-  element. If the script to be loaded changes while the script is
-  being prefetched, then the user agent must prefetch the new script
-  (if any), without changing the <span
-  title="concept-script-state">current status</span>. If no script is
-  ever successfully fetched (e.g. because the element is an inline
-  script) then the transition to "<code title="">loaded</code>" is
-  skipped, and so the <code
-  title="event-readystatechange">readystatechange</code> event does
-  not fire for this transition (it still fires when the <span
-  title="concept-script-state">current status</span> is set to "<code
-  title="">complete</code>" later, however). If the script to be
-  loaded changes after a script has been successfully prefetched, the
-  user agent may prefetch the new script but must not change the <span
-  title="concept-script-state">current status</span> or fire any
-  events as a result. If the user agent changes its mind and decides
-  to not bother prefetching the script after all, the user agent must
-  <span>queue a task</span> that, if the <span>prepare a
-  script</span> algorithm has still not started, sets the <span
-  title="concept-script-state">current status</span> to "<code
-  title="">loaded</code>" and <span title="fire a simple event">fires
-  a simple event</span> named <code
-  title="event-readystatechange">readystatechange</code> at the
-  element.</p>
-
   <p>The last few pieces of state are <dfn><var>the script block's
   type</var></dfn>, <dfn><var>the script block's character
   encoding</var></dfn>, and <dfn><var>the script block's fallback
@@ -16589,33 +16541,10 @@
     user agent must act as if it had received an empty HTTP 400
     response.</p>
 
-    <p>If the <span title="concept-script-state">current status</span>
-    of the element at this stage is still "<code
-    title="">uninitialized</code>" (meaning that the user agent
-    intended to prefetch the script as described in the next
-    paragraph, but the <span>prepare a script</span> algorithm was
-    started before it had a chance to do so), then, if a
-    <span>fetch</span> attempt was started in this step, the user
-    agent must set the <span title="concept-script-state">current
-    status</span> to "<code title="">loading</code>" <!--and
-    <span>queue a task</span> to <span>fire a simple event</span>
-    named <code title="event-readystatechange">readystatechange</code>
-    at the element-->. <!--(If the fetching is started as part of a
-    prefetch, then no <code
-    title="event-readystatechange">readystatechange</code> is fired
-    when <span title="concept-script-state">current status</span> is
-    set to "<code title="">loading</code>".)--></p> <!-- commented out
-    text is what IE does, but IE actually does stuff even more
-    complicated than that which I haven't tried to match exactly here
-    since it's just arcane -->
-
-    <p id="scriptPrefetch">For performance reasons, user agents may
-    start fetching the script as soon as the attribute is set,
-    instead, in the hope that the element will be inserted into the
-    document (user agents that do this have <span
-    title="concept-script-state">requirements</span> relating to what
-    events are to be fired during the process). Either way, once the
-    element is <span title="insert an element into a
+    <p>For performance reasons, user agents may start fetching the
+    script as soon as the attribute is set, instead, in the hope that
+    the element will be inserted into the document. Either way, once
+    the element is <span title="insert an element into a
     document">inserted into the document</span>, the load must have
     started. If the UA performs such prefetching, but the element is
     never inserted in the document, or the <code
@@ -16819,19 +16748,6 @@
 
    <li>
 
-    <p>If the <span title="concept-script-state">current status</span>
-    of the element at this stage is "<code title="">loading</code>"
-    (meaning that the user agent intended to <a
-    href="#scriptPrefetch">prefetch the script</a> as allowed by the
-    <span>prepare a script</span> algorithm, but the fetch was not
-    completed before that algorithm was started), then the user agent
-    must set the <span title="concept-script-state">current
-    status</span> to "<code title="">loaded</code>".</p>
-
-   </li>
-
-   <li>
-
     <p>If the element is flagged as <span>"parser-inserted"</span>,
     but the element's <code>Document</code> is not the
     <code>Document</code> of the parser that created the element, then
@@ -16848,27 +16764,10 @@
      <dt>If the load resulted in an error (for example a DNS error, or
      an HTTP 404 error)</dt>
 
-     <dd>
+     <dd><p>Executing the script block must just consist of <span
+     title="fire a simple event">firing a simple event</span> named
+     <code title="event-error">error</code> at the element.</p></dd>
 
-      <p>Executing the script block must consist of running the following steps:</p>
-
-      <ol>
-
-       <li><p>Set the <span title="concept-script-state">current
-       status</span> to "<code title="">complete</code>".</p></li>
-
-       <li><p><span>Fire a simple event</span> named <code
-       title="event-readystatechange">readystatechange</code> at the
-       element.</p></li>
-
-       <li><p><span>Fire a simple event</span> named <code
-       title="event-error">error</code> at the element.</p></li>
-
-      </ol>
-
-     </dd>
-
-
      <dt>If the load was successful</dt>
 
      <!-- SCRIPT EXEC -->
@@ -17022,9 +16921,6 @@
 
        </li>
 
-       <li><p>Set the <span title="concept-script-state">current
-       status</span> to "<code title="">interactive</code>".</p></li>
-
        <li>
 
         <p><span title="create a script from a node">Create a
@@ -17045,13 +16941,6 @@
 
        </li>
 
-       <li><p>Set the <span title="concept-script-state">current
-       status</span> to "<code title="">complete</code>".</p></li>
-
-       <li><p><span>Fire a simple event</span> named <code
-       title="event-readystatechange">readystatechange</code> at the
-       element.</p></li>
-
        <li>
 
         <p>If the script is from an external file, <span>fire a simple
@@ -17111,59 +17000,6 @@
 
    </dd>
 
-
-   <dt><var title="">script</var> . <code title="dom-script-readyState">readyState</code></dt>
-
-   <dd>
-
-    <p>Returns the current state of the element. The value is one of
-    the following:</p>
-
-    <dl>
-
-     <dt>"<code title="">uninitialized</code>"</dt>
-
-     <dd><p>The script file, if any, has not yet been loaded, but the
-     user agent will try to prefetch it as soon as possible (e.g. as
-     soon as the <code title="attr-script-src">src</code> attribute is
-     set).</dd>
-
-
-     <dt>"<code title="">loading</code>"</dt>
-
-     <dd><p>A script file is being downloaded in a user agent that
-     supports prefetching scripts.</dd>
-
-
-     <dt>"<code title="">loaded</code>"</dt>
-
-     <dd><p>Either a script file is loaded and ready to be executed,
-     or the script file is not loaded but the user agent does not
-     intend to prefetch the script file anyway, and will merely fetch
-     it when it is to be executed. If the element started in the <code
-     title="">uninitialized</code>" state and the script has not yet
-     begun to be executed, then a <code
-     title="event-readystatechange">readystatechange</code> event is
-     fired when the state changes to this value.</dd>
-
-
-     <dt>"<code title="">interactive</code>"</dt>
-
-     <dd><p>The script is running.</dd>
-
-
-     <dt>"<code title="">complete</code>"</dt>
-
-     <dd><p>The script has been executed (or it failed). A <code
-     title="event-readystatechange">readystatechange</code> event is
-     fired when the state changes to this value, just before the
-     corresponding <code title="event-load">load</code> or <code
-     title="event-error">error</code> event.</dd>
-
-    </dl>
-
-   </dd>
-
   </dl>
 
   <div class="impl">
@@ -17176,11 +17012,6 @@
   tree order. On setting, it must act the same way as the
   <code>textContent</code> IDL attribute.</p>
 
-  <p>The IDL attribute <dfn
-  title="dom-script-readyState"><code>readyState</code></dfn> must
-  return the element's <span title="concept-script-state">current
-  status</span>.</p>
-
   </div>
 
   <p class="note">When inserted using the <code
@@ -70510,7 +70341,6 @@
            attribute <span>Function</span>? <span title="handler-window-onpopstate">onpopstate</span>;
            attribute <span>Function</span>? <span title="handler-onprogress">onprogress</span>;
            attribute <span>Function</span>? <span title="handler-onratechange">onratechange</span>;
-           attribute <span>Function</span>? <span title="handler-onreadystatechange">onreadystatechange</span>;
            attribute <span>Function</span>? <span title="handler-onreset">onreset</span>;
            attribute <span>Function</span>? <span title="handler-window-onresize">onresize</span>;
            attribute <span>Function</span>? <span title="handler-onscroll">onscroll</span>;
@@ -78436,10 +78266,10 @@
 
   <p>The following are the <span>event handlers</span> (and their
   corresponding <span title="event handler event type">event handler
-  event types</span>) <span class="impl">that must be</span> supported by all <span>HTML
-  elements</span>, as both content attributes and IDL attributes, and
-  on <code>Document</code> and <code>Window</code> objects, as IDL
-  attributes.</p>
+  event types</span>) <span class="impl">that must be</span> supported
+  by all <span>HTML elements</span>, as both content attributes and
+  IDL attributes, and on <code>Document</code> and <code>Window</code>
+  objects, as IDL attributes.</p>
 
   <table>
    <thead>
@@ -78482,7 +78312,6 @@
     <tr><td><dfn title="handler-onplaying"><code>onplaying</code></dfn> <td> <code title="event-media-playing">playing</code>
     <tr><td><dfn title="handler-onprogress"><code>onprogress</code></dfn> <td> <code title="event-media-progress">progress</code>
     <tr><td><dfn title="handler-onratechange"><code>onratechange</code></dfn> <td> <code title="event-media-ratechange">ratechange</code>
-    <tr><td><dfn title="handler-onreadystatechange"><code>onreadystatechange</code></dfn> <td> <code title="event-readystatechange">readystatechange</code>
     <tr><td><dfn title="handler-onreset"><code>onreset</code></dfn> <td> <code title="event-reset">reset</code>
     <tr><td><dfn title="handler-onseeked"><code>onseeked</code></dfn> <td> <code title="event-media-seeked">seeked</code>
     <tr><td><dfn title="handler-onseeking"><code>onseeking</code></dfn> <td> <code title="event-media-seeking">seeking</code>
@@ -78507,10 +78336,10 @@
 
   <p>The following are the <span>event handlers</span> (and their
   corresponding <span title="event handler event type">event handler
-  event types</span>) <span class="impl">that must be</span> supported by all <span>HTML
-  elements</span> other than <code>body</code>, as both content
-  attributes and IDL attributes, and on <code>Document</code> objects,
-  as IDL attributes:</p>
+  event types</span>) <span class="impl">that must be</span> supported
+  by all <span>HTML elements</span> other than <code>body</code>, as
+  both content attributes and IDL attributes, and on
+  <code>Document</code> objects, as IDL attributes:</p>
 
   <table>
    <thead>
@@ -78527,10 +78356,11 @@
 
   <p>The following are the <span>event handlers</span> (and their
   corresponding <span title="event handler event type">event handler
-  event types</span>) <span class="impl">that must be</span> supported by <code>Window</code>
-  objects, as IDL attributes on the <code>Window</code> object, and
-  with corresponding content attributes and IDL attributes exposed on
-  the <code>body</code> and <code>frameset</code> elements:</p>
+  event types</span>) <span class="impl">that must be</span> supported
+  by <code>Window</code> objects, as IDL attributes on the
+  <code>Window</code> object, and with corresponding content
+  attributes and IDL attributes exposed on the <code>body</code> and
+  <code>frameset</code> elements:</p>
 
   <table>
    <thead>
@@ -78560,7 +78390,31 @@
   handler is also used for <a
   href="#runtime-script-errors">reporting script errors</a>.</p>
 
+  <hr>
 
+  <!-- this guy is only on HTMLDocument and not on HTMLElement because
+  otherwise HTMLScriptElement would have it and that causes
+  compatibility issues since IE fires readystatechange events on
+  <script>, not load events, and we can't fire both, and some sites
+  try to decide which to look for based on the presence of
+  script.onreadystatechange on HTMLScriptElement.
+     http://www.w3.org/Bugs/Public/show_bug.cgi?id=13965
+     http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-September/033136.html
+  -->
+
+  <p>The following are the <span>event handlers</span> (and their
+  corresponding <span title="event handler event type">event handler
+  event types</span>) <span class="impl">that must be</span> supported
+  on <code>Document</code> objects as IDL attributes:</p>
+
+  <table>
+   <thead>
+    <tr><th><span title="event handlers">Event handler</span> <th><span>Event handler event type</span>
+   <tbody>
+    <tr><td><dfn title="handler-onreadystatechange"><code>onreadystatechange</code></dfn> <td> <code title="event-readystatechange">readystatechange</code>
+  </table>
+
+
   <div class="impl">
 
   <h5>Event firing</h5>
@@ -113663,12 +113517,6 @@
      <td> <span title="event handler content attributes">Event handler content attribute</span>
 
     <tr>
-     <th id="ix-handler-onreadystatechange"> <code title="">onreadystatechange</code>
-     <td> <span title="handler-onreadystatechange">HTML elements</span>
-     <td> <code title="event-readystatechange">readystatechange</code> event handler
-     <td> <span title="event handler content attributes">Event handler content attribute</span>
-
-    <tr>
      <th id="ix-handler-onreset"> <code title="">onreset</code>
      <td> <span title="handler-onreset">HTML elements</span>
      <td> <code title="event-reset">reset</code> event handler




More information about the Commit-Watchers mailing list