[html5] r5883 - [giow] (2) Make a parser-inserted script not run if it is moved to another docum [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Feb 14 12:47:48 PST 2011


Author: ianh
Date: 2011-02-14 12:47:46 -0800 (Mon, 14 Feb 2011)
New Revision: 5883

Modified:
   complete.html
   index
   source
Log:
[giow] (2) Make a parser-inserted script not run if it is moved to another document before it executes (and not even fetch if it is parsed into another document than its parser's document).
Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=11323

Modified: complete.html
===================================================================
--- complete.html	2011-02-14 10:02:35 UTC (rev 5882)
+++ complete.html	2011-02-14 20:47:46 UTC (rev 5883)
@@ -15061,6 +15061,15 @@
 
    </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
+    abort these steps.</p>
+
+   </li>
+
    <li id=script-processing-noscript>
 
     <p>If <a href=#concept-n-noscript title=concept-n-noscript>scripting is
@@ -15325,172 +15334,194 @@
   style sheets are blocking which scripts -->
 
   <p>When the user agent is required to <dfn id=execute-the-script-block title="execute the script
-  block">execute a script block</dfn>, it must act as follows:</p>
+  block">execute a script block</dfn>, it must run the following
+  steps:</p>
 
-  <dl class=switch><dt>If the load resulted in an error (for example a DNS error, or
-   an HTTP 404 error)</dt>
+  <ol><li>
 
-   <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>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
+    abort these steps.</p>
 
-   <dt>If the load was successful</dt>
+   </li>
 
-   <!-- SCRIPT EXEC -->
-   <dd>
+   <li>
 
-    <p>Executing the script block must consists of running the
-    following steps. For the purposes of these steps, the script is
-    considered to be from an <i>external file</i> if, while the
-    <a href=#prepare-a-script>prepare a script</a> algorithm above was running for this
-    script, the <code><a href=#script>script</a></code> element had a <code title=attr-script-src><a href=#attr-script-src>src</a></code> attribute specified.</p>
+    <p>Jump to the appropriate set of steps from the list below:</p>
 
-    <ol><li id=establish-script-block-source>
+    <dl class=switch><dt>If the load resulted in an error (for example a DNS error, or
+     an HTTP 404 error)</dt>
 
-      <p>Initialize <dfn id="the-script-block's-source"><var>the script block's source</var></dfn> as
-      follows:</p>
+     <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>
 
-      <dl class=switch><dt>If the script is from an external file and <var><a href="#the-script-block's-type">the script block's type</a></var> is a text-based language</dt>
+     <dt>If the load was successful</dt>
 
-       <dd>
+     <!-- SCRIPT EXEC -->
+     <dd>
 
-        <p>The contents of that file, interpreted as string of
-        Unicode characters, are the script source.</p>
+      <p>Executing the script block must consists of running the
+      following steps. For the purposes of these steps, the script is
+      considered to be from an <i>external file</i> if, while the
+      <a href=#prepare-a-script>prepare a script</a> algorithm above was running for
+      this script, the <code><a href=#script>script</a></code> element had a <code title=attr-script-src><a href=#attr-script-src>src</a></code> attribute specified.</p>
 
-        <p>To obtain the string of Unicode characters, the user agent
-        run the following steps:</p>
+      <ol><li id=establish-script-block-source>
 
-        <ol><li><p>If the resource's <a href=#content-type title=Content-Type>Content
-         Type metadata</a>, if any, specifies a character encoding,
-         and the user agent supports that encoding, then let <var title="">character encoding</var> be that encoding, and jump
-         to the bottom step in this series of steps.</li>
+        <p>Initialize <dfn id="the-script-block's-source"><var>the script block's source</var></dfn>
+        as follows:</p>
 
-         <li><p>If the algorithm above set <var><a href="#the-script-block's-character-encoding">the script block's
-         character encoding</a></var>, then let <var title="">character
-         encoding</var> be that encoding, and jump to the bottom step
-         in this series of steps.</li>
+        <dl class=switch><dt>If the script is from an external file and <var><a href="#the-script-block's-type">the
+         script block's type</a></var> is a text-based language</dt>
 
-         <li><p>For each of the rows in the following table, starting
-         with the first one and going down, if the file has as many or
-         more bytes available than the number of bytes in the first
-         column, and the first bytes of the file match the bytes given
-         in the first column, then set <var title="">character
-         encoding</var> to the encoding given in the cell in the
-         second column of that row, and jump to the bottom step in
-         this series of steps:</p>
+         <dd>
 
-          <!-- this table is present in several forms in this file; keep them in sync -->
-          <table id=table-script-bom><thead><tr><th>Bytes in Hexadecimal
-             <th>Encoding
-           <tbody><!-- nobody uses this
-            <tr>
-             <td>00 00 FE FF
-             <td>UTF-32BE
-            <tr>
-             <td>FF FE 00 00
-             <td>UTF-32LE
-  --><tr><td>FE FF
-             <td>Big-endian UTF-16
-            <tr><td>FF FE
-             <td>Little-endian UTF-16
-            <tr><td>EF BB BF
-             <td>UTF-8
-  <!-- nobody uses this
-            <tr>
-             <td>DD 73 66 73
-             <td>UTF-EBCDIC
-  -->
-          </table><p class=note>This step looks for Unicode Byte Order Marks
-          (BOMs).</p>
+          <p>The contents of that file, interpreted as string of
+          Unicode characters, are the script source.</p>
 
-         </li>
+          <p>To obtain the string of Unicode characters, the user
+          agent run the following steps:</p>
 
-         <li><p>Let <var title="">character encoding</var> be <var><a href="#the-script-block's-fallback-character-encoding">the
-         script block's fallback character encoding</a></var>.</li>
+          <ol><li><p>If the resource's <a href=#content-type title=Content-Type>Content
+           Type metadata</a>, if any, specifies a character
+           encoding, and the user agent supports that encoding, then
+           let <var title="">character encoding</var> be that
+           encoding, and jump to the bottom step in this series of
+           steps.</li>
 
-         <li><p>Convert the file to Unicode using <var>character
-         encoding</var>, following the rules for doing so given by the
-         specification for <var><a href="#the-script-block's-type">the script block's
-         type</a></var>.</li>
+           <li><p>If the algorithm above set <var><a href="#the-script-block's-character-encoding">the script block's
+           character encoding</a></var>, then let <var title="">character
+           encoding</var> be that encoding, and jump to the bottom
+           step in this series of steps.</li>
 
-        </ol></dd>
+           <li><p>For each of the rows in the following table,
+           starting with the first one and going down, if the file has
+           as many or more bytes available than the number of bytes in
+           the first column, and the first bytes of the file match the
+           bytes given in the first column, then set <var title="">character encoding</var> to the encoding given in
+           the cell in the second column of that row, and jump to the
+           bottom step in this series of steps:</p>
 
-       <dt>If the script is from an external file and <var><a href="#the-script-block's-type">the script block's type</a></var> is an XML-based language</dt>
+            <!-- this table is present in several forms in this file; keep them in sync -->
+            <table id=table-script-bom><thead><tr><th>Bytes in Hexadecimal
+               <th>Encoding
+             <tbody><!-- nobody uses this
+              <tr>
+               <td>00 00 FE FF
+               <td>UTF-32BE
+              <tr>
+               <td>FF FE 00 00
+               <td>UTF-32LE
+    --><tr><td>FE FF
+               <td>Big-endian UTF-16
+              <tr><td>FF FE
+               <td>Little-endian UTF-16
+              <tr><td>EF BB BF
+               <td>UTF-8
+    <!-- nobody uses this
+              <tr>
+               <td>DD 73 66 73
+               <td>UTF-EBCDIC
+    -->
+            </table><p class=note>This step looks for Unicode Byte Order
+            Marks (BOMs).</p>
 
-       <dd>
+           </li>
 
-        <p>The external file is the script source. When it is later
-        executed, it must be interpreted in a manner consistent with
-        the specification defining the language given by <var><a href="#the-script-block's-type">the
-        script block's type</a></var>.</p>
+           <li><p>Let <var title="">character encoding</var> be
+           <var><a href="#the-script-block's-fallback-character-encoding">the script block's fallback character
+           encoding</a></var>.</li>
 
-       </dd>
+           <li><p>Convert the file to Unicode using <var>character
+           encoding</var>, following the rules for doing so given by
+           the specification for <var><a href="#the-script-block's-type">the script block's
+           type</a></var>.</li>
 
-       <dt>If the script is inline and <var><a href="#the-script-block's-type">the script block's type</a></var> is a text-based language</dt>
+          </ol></dd>
 
-       <dd>
+         <dt>If the script is from an external file and <var><a href="#the-script-block's-type">the
+         script block's type</a></var> is an XML-based language</dt>
 
-        <p>The value of the <code title=dom-script-text><a href=#dom-script-text>text</a></code>
-        IDL attribute at the time the element's <a href=#already-started>"already
-        started"</a> flag was last set is the script source.</p>
+         <dd>
 
-       </dd>
+          <p>The external file is the script source. When it is later
+          executed, it must be interpreted in a manner consistent with
+          the specification defining the language given by <var><a href="#the-script-block's-type">the
+          script block's type</a></var>.</p>
 
-       <dt>If the script is inline and <var><a href="#the-script-block's-type">the script block's type</a></var> is an XML-based language</dt>
+         </dd>
 
-       <dd>
+         <dt>If the script is inline and <var><a href="#the-script-block's-type">the script block's
+         type</a></var> is a text-based language</dt>
 
-        <p>The child nodes of the <code><a href=#script>script</a></code> element at the
-        time the element's <a href=#already-started>"already started"</a> flag was
-        last set are the script source.</p>
+         <dd>
 
-       </dd>
+          <p>The value of the <code title=dom-script-text><a href=#dom-script-text>text</a></code> IDL attribute at the
+          time the element's <a href=#already-started>"already started"</a> flag was
+          last set is the script source.</p>
 
-      </dl></li>
+         </dd>
 
-     <li>
+         <dt>If the script is inline and <var><a href="#the-script-block's-type">the script block's
+         type</a></var> is an XML-based language</dt>
 
-      <p>If the script is from an external file, then increment the
-      <a href=#ignore-destructive-writes-counter>ignore-destructive-writes counter</a> of the
-      <code><a href=#script>script</a></code> element's <code><a href=#document>Document</a></code>. Let <var title="">neutralized doc</var> be that
-      <code><a href=#document>Document</a></code>.</p>
+         <dd>
 
-     </li>
+          <p>The child nodes of the <code><a href=#script>script</a></code> element at the
+          time the element's <a href=#already-started>"already started"</a> flag was
+          last set are the script source.</p>
 
-     <li>
+         </dd>
 
-      <p><a href=#create-a-script-from-a-node title="create a script from a node">Create a
-      script</a> from the <code><a href=#script>script</a></code> element node, using
-      <var><a href="#the-script-block's-source">the script block's source</a></var> and <var><a href="#the-script-block's-type">the script
-      block's type</a></var>.</p>
+        </dl></li>
 
-      <p class=note>This is where the script is compiled and
-      actually executed.</p>
+       <li>
 
-     </li>
+        <p>If the script is from an external file, then increment the
+        <a href=#ignore-destructive-writes-counter>ignore-destructive-writes counter</a> of the
+        <code><a href=#script>script</a></code> element's <code><a href=#document>Document</a></code>. Let <var title="">neutralized doc</var> be that
+        <code><a href=#document>Document</a></code>.</p>
 
-     <li>
+       </li>
 
-      <p>Decrement the <a href=#ignore-destructive-writes-counter>ignore-destructive-writes counter</a>
-      of <var title="">neutralized doc</var>, if it was incremented in
-      the earlier step.</p>
+       <li>
 
-     </li>
+        <p><a href=#create-a-script-from-a-node title="create a script from a node">Create a
+        script</a> from the <code><a href=#script>script</a></code> element node, using
+        <var><a href="#the-script-block's-source">the script block's source</a></var> and <var><a href="#the-script-block's-type">the script
+        block's type</a></var>.</p>
 
-     <li>
+        <p class=note>This is where the script is compiled and
+        actually executed.</p>
 
-      <p>If the script is from an external file, <a href=#fire-a-simple-event>fire a simple
-      event</a> named <code title=event-load>load</code> at the
-      <code><a href=#script>script</a></code> element.</p>
+       </li>
 
-      <p>Otherwise, the script is internal; <a href=#queue-a-task>queue a task</a>
-      to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-load>load</code> at the <code><a href=#script>script</a></code>
-      element.</p>
+       <li>
 
-     </li>
+        <p>Decrement the <a href=#ignore-destructive-writes-counter>ignore-destructive-writes
+        counter</a> of <var title="">neutralized doc</var>, if it
+        was incremented in the earlier step.</p>
 
-    </ol></dd>
+       </li>
 
-  </dl><p>The IDL attributes <dfn id=dom-script-src title=dom-script-src><code>src</code></dfn>, <dfn id=dom-script-type title=dom-script-type><code>type</code></dfn>, <dfn id=dom-script-charset title=dom-script-charset><code>charset</code></dfn>, and <dfn id=dom-script-defer title=dom-script-defer><code>defer</code></dfn>, each must
+       <li>
+
+        <p>If the script is from an external file, <a href=#fire-a-simple-event>fire a simple
+        event</a> named <code title=event-load>load</code> at the
+        <code><a href=#script>script</a></code> element.</p>
+
+        <p>Otherwise, the script is internal; <a href=#queue-a-task>queue a
+        task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-load>load</code> at the <code><a href=#script>script</a></code>
+        element.</p>
+
+       </li>
+
+      </ol></dd>
+
+    </dl></li>
+
+  </ol><p>The IDL attributes <dfn id=dom-script-src title=dom-script-src><code>src</code></dfn>, <dfn id=dom-script-type title=dom-script-type><code>type</code></dfn>, <dfn id=dom-script-charset title=dom-script-charset><code>charset</code></dfn>, and <dfn id=dom-script-defer title=dom-script-defer><code>defer</code></dfn>, each must
   <a href=#reflect>reflect</a> the respective content attributes of the same
   name.</p>
 

Modified: index
===================================================================
--- index	2011-02-14 10:02:35 UTC (rev 5882)
+++ index	2011-02-14 20:47:46 UTC (rev 5883)
@@ -15041,6 +15041,15 @@
 
    </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
+    abort these steps.</p>
+
+   </li>
+
    <li id=script-processing-noscript>
 
     <p>If <a href=#concept-n-noscript title=concept-n-noscript>scripting is
@@ -15305,172 +15314,194 @@
   style sheets are blocking which scripts -->
 
   <p>When the user agent is required to <dfn id=execute-the-script-block title="execute the script
-  block">execute a script block</dfn>, it must act as follows:</p>
+  block">execute a script block</dfn>, it must run the following
+  steps:</p>
 
-  <dl class=switch><dt>If the load resulted in an error (for example a DNS error, or
-   an HTTP 404 error)</dt>
+  <ol><li>
 
-   <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>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
+    abort these steps.</p>
 
-   <dt>If the load was successful</dt>
+   </li>
 
-   <!-- SCRIPT EXEC -->
-   <dd>
+   <li>
 
-    <p>Executing the script block must consists of running the
-    following steps. For the purposes of these steps, the script is
-    considered to be from an <i>external file</i> if, while the
-    <a href=#prepare-a-script>prepare a script</a> algorithm above was running for this
-    script, the <code><a href=#script>script</a></code> element had a <code title=attr-script-src><a href=#attr-script-src>src</a></code> attribute specified.</p>
+    <p>Jump to the appropriate set of steps from the list below:</p>
 
-    <ol><li id=establish-script-block-source>
+    <dl class=switch><dt>If the load resulted in an error (for example a DNS error, or
+     an HTTP 404 error)</dt>
 
-      <p>Initialize <dfn id="the-script-block's-source"><var>the script block's source</var></dfn> as
-      follows:</p>
+     <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>
 
-      <dl class=switch><dt>If the script is from an external file and <var><a href="#the-script-block's-type">the script block's type</a></var> is a text-based language</dt>
+     <dt>If the load was successful</dt>
 
-       <dd>
+     <!-- SCRIPT EXEC -->
+     <dd>
 
-        <p>The contents of that file, interpreted as string of
-        Unicode characters, are the script source.</p>
+      <p>Executing the script block must consists of running the
+      following steps. For the purposes of these steps, the script is
+      considered to be from an <i>external file</i> if, while the
+      <a href=#prepare-a-script>prepare a script</a> algorithm above was running for
+      this script, the <code><a href=#script>script</a></code> element had a <code title=attr-script-src><a href=#attr-script-src>src</a></code> attribute specified.</p>
 
-        <p>To obtain the string of Unicode characters, the user agent
-        run the following steps:</p>
+      <ol><li id=establish-script-block-source>
 
-        <ol><li><p>If the resource's <a href=#content-type title=Content-Type>Content
-         Type metadata</a>, if any, specifies a character encoding,
-         and the user agent supports that encoding, then let <var title="">character encoding</var> be that encoding, and jump
-         to the bottom step in this series of steps.</li>
+        <p>Initialize <dfn id="the-script-block's-source"><var>the script block's source</var></dfn>
+        as follows:</p>
 
-         <li><p>If the algorithm above set <var><a href="#the-script-block's-character-encoding">the script block's
-         character encoding</a></var>, then let <var title="">character
-         encoding</var> be that encoding, and jump to the bottom step
-         in this series of steps.</li>
+        <dl class=switch><dt>If the script is from an external file and <var><a href="#the-script-block's-type">the
+         script block's type</a></var> is a text-based language</dt>
 
-         <li><p>For each of the rows in the following table, starting
-         with the first one and going down, if the file has as many or
-         more bytes available than the number of bytes in the first
-         column, and the first bytes of the file match the bytes given
-         in the first column, then set <var title="">character
-         encoding</var> to the encoding given in the cell in the
-         second column of that row, and jump to the bottom step in
-         this series of steps:</p>
+         <dd>
 
-          <!-- this table is present in several forms in this file; keep them in sync -->
-          <table id=table-script-bom><thead><tr><th>Bytes in Hexadecimal
-             <th>Encoding
-           <tbody><!-- nobody uses this
-            <tr>
-             <td>00 00 FE FF
-             <td>UTF-32BE
-            <tr>
-             <td>FF FE 00 00
-             <td>UTF-32LE
-  --><tr><td>FE FF
-             <td>Big-endian UTF-16
-            <tr><td>FF FE
-             <td>Little-endian UTF-16
-            <tr><td>EF BB BF
-             <td>UTF-8
-  <!-- nobody uses this
-            <tr>
-             <td>DD 73 66 73
-             <td>UTF-EBCDIC
-  -->
-          </table><p class=note>This step looks for Unicode Byte Order Marks
-          (BOMs).</p>
+          <p>The contents of that file, interpreted as string of
+          Unicode characters, are the script source.</p>
 
-         </li>
+          <p>To obtain the string of Unicode characters, the user
+          agent run the following steps:</p>
 
-         <li><p>Let <var title="">character encoding</var> be <var><a href="#the-script-block's-fallback-character-encoding">the
-         script block's fallback character encoding</a></var>.</li>
+          <ol><li><p>If the resource's <a href=#content-type title=Content-Type>Content
+           Type metadata</a>, if any, specifies a character
+           encoding, and the user agent supports that encoding, then
+           let <var title="">character encoding</var> be that
+           encoding, and jump to the bottom step in this series of
+           steps.</li>
 
-         <li><p>Convert the file to Unicode using <var>character
-         encoding</var>, following the rules for doing so given by the
-         specification for <var><a href="#the-script-block's-type">the script block's
-         type</a></var>.</li>
+           <li><p>If the algorithm above set <var><a href="#the-script-block's-character-encoding">the script block's
+           character encoding</a></var>, then let <var title="">character
+           encoding</var> be that encoding, and jump to the bottom
+           step in this series of steps.</li>
 
-        </ol></dd>
+           <li><p>For each of the rows in the following table,
+           starting with the first one and going down, if the file has
+           as many or more bytes available than the number of bytes in
+           the first column, and the first bytes of the file match the
+           bytes given in the first column, then set <var title="">character encoding</var> to the encoding given in
+           the cell in the second column of that row, and jump to the
+           bottom step in this series of steps:</p>
 
-       <dt>If the script is from an external file and <var><a href="#the-script-block's-type">the script block's type</a></var> is an XML-based language</dt>
+            <!-- this table is present in several forms in this file; keep them in sync -->
+            <table id=table-script-bom><thead><tr><th>Bytes in Hexadecimal
+               <th>Encoding
+             <tbody><!-- nobody uses this
+              <tr>
+               <td>00 00 FE FF
+               <td>UTF-32BE
+              <tr>
+               <td>FF FE 00 00
+               <td>UTF-32LE
+    --><tr><td>FE FF
+               <td>Big-endian UTF-16
+              <tr><td>FF FE
+               <td>Little-endian UTF-16
+              <tr><td>EF BB BF
+               <td>UTF-8
+    <!-- nobody uses this
+              <tr>
+               <td>DD 73 66 73
+               <td>UTF-EBCDIC
+    -->
+            </table><p class=note>This step looks for Unicode Byte Order
+            Marks (BOMs).</p>
 
-       <dd>
+           </li>
 
-        <p>The external file is the script source. When it is later
-        executed, it must be interpreted in a manner consistent with
-        the specification defining the language given by <var><a href="#the-script-block's-type">the
-        script block's type</a></var>.</p>
+           <li><p>Let <var title="">character encoding</var> be
+           <var><a href="#the-script-block's-fallback-character-encoding">the script block's fallback character
+           encoding</a></var>.</li>
 
-       </dd>
+           <li><p>Convert the file to Unicode using <var>character
+           encoding</var>, following the rules for doing so given by
+           the specification for <var><a href="#the-script-block's-type">the script block's
+           type</a></var>.</li>
 
-       <dt>If the script is inline and <var><a href="#the-script-block's-type">the script block's type</a></var> is a text-based language</dt>
+          </ol></dd>
 
-       <dd>
+         <dt>If the script is from an external file and <var><a href="#the-script-block's-type">the
+         script block's type</a></var> is an XML-based language</dt>
 
-        <p>The value of the <code title=dom-script-text><a href=#dom-script-text>text</a></code>
-        IDL attribute at the time the element's <a href=#already-started>"already
-        started"</a> flag was last set is the script source.</p>
+         <dd>
 
-       </dd>
+          <p>The external file is the script source. When it is later
+          executed, it must be interpreted in a manner consistent with
+          the specification defining the language given by <var><a href="#the-script-block's-type">the
+          script block's type</a></var>.</p>
 
-       <dt>If the script is inline and <var><a href="#the-script-block's-type">the script block's type</a></var> is an XML-based language</dt>
+         </dd>
 
-       <dd>
+         <dt>If the script is inline and <var><a href="#the-script-block's-type">the script block's
+         type</a></var> is a text-based language</dt>
 
-        <p>The child nodes of the <code><a href=#script>script</a></code> element at the
-        time the element's <a href=#already-started>"already started"</a> flag was
-        last set are the script source.</p>
+         <dd>
 
-       </dd>
+          <p>The value of the <code title=dom-script-text><a href=#dom-script-text>text</a></code> IDL attribute at the
+          time the element's <a href=#already-started>"already started"</a> flag was
+          last set is the script source.</p>
 
-      </dl></li>
+         </dd>
 
-     <li>
+         <dt>If the script is inline and <var><a href="#the-script-block's-type">the script block's
+         type</a></var> is an XML-based language</dt>
 
-      <p>If the script is from an external file, then increment the
-      <a href=#ignore-destructive-writes-counter>ignore-destructive-writes counter</a> of the
-      <code><a href=#script>script</a></code> element's <code><a href=#document>Document</a></code>. Let <var title="">neutralized doc</var> be that
-      <code><a href=#document>Document</a></code>.</p>
+         <dd>
 
-     </li>
+          <p>The child nodes of the <code><a href=#script>script</a></code> element at the
+          time the element's <a href=#already-started>"already started"</a> flag was
+          last set are the script source.</p>
 
-     <li>
+         </dd>
 
-      <p><a href=#create-a-script-from-a-node title="create a script from a node">Create a
-      script</a> from the <code><a href=#script>script</a></code> element node, using
-      <var><a href="#the-script-block's-source">the script block's source</a></var> and <var><a href="#the-script-block's-type">the script
-      block's type</a></var>.</p>
+        </dl></li>
 
-      <p class=note>This is where the script is compiled and
-      actually executed.</p>
+       <li>
 
-     </li>
+        <p>If the script is from an external file, then increment the
+        <a href=#ignore-destructive-writes-counter>ignore-destructive-writes counter</a> of the
+        <code><a href=#script>script</a></code> element's <code><a href=#document>Document</a></code>. Let <var title="">neutralized doc</var> be that
+        <code><a href=#document>Document</a></code>.</p>
 
-     <li>
+       </li>
 
-      <p>Decrement the <a href=#ignore-destructive-writes-counter>ignore-destructive-writes counter</a>
-      of <var title="">neutralized doc</var>, if it was incremented in
-      the earlier step.</p>
+       <li>
 
-     </li>
+        <p><a href=#create-a-script-from-a-node title="create a script from a node">Create a
+        script</a> from the <code><a href=#script>script</a></code> element node, using
+        <var><a href="#the-script-block's-source">the script block's source</a></var> and <var><a href="#the-script-block's-type">the script
+        block's type</a></var>.</p>
 
-     <li>
+        <p class=note>This is where the script is compiled and
+        actually executed.</p>
 
-      <p>If the script is from an external file, <a href=#fire-a-simple-event>fire a simple
-      event</a> named <code title=event-load>load</code> at the
-      <code><a href=#script>script</a></code> element.</p>
+       </li>
 
-      <p>Otherwise, the script is internal; <a href=#queue-a-task>queue a task</a>
-      to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-load>load</code> at the <code><a href=#script>script</a></code>
-      element.</p>
+       <li>
 
-     </li>
+        <p>Decrement the <a href=#ignore-destructive-writes-counter>ignore-destructive-writes
+        counter</a> of <var title="">neutralized doc</var>, if it
+        was incremented in the earlier step.</p>
 
-    </ol></dd>
+       </li>
 
-  </dl><p>The IDL attributes <dfn id=dom-script-src title=dom-script-src><code>src</code></dfn>, <dfn id=dom-script-type title=dom-script-type><code>type</code></dfn>, <dfn id=dom-script-charset title=dom-script-charset><code>charset</code></dfn>, and <dfn id=dom-script-defer title=dom-script-defer><code>defer</code></dfn>, each must
+       <li>
+
+        <p>If the script is from an external file, <a href=#fire-a-simple-event>fire a simple
+        event</a> named <code title=event-load>load</code> at the
+        <code><a href=#script>script</a></code> element.</p>
+
+        <p>Otherwise, the script is internal; <a href=#queue-a-task>queue a
+        task</a> to <a href=#fire-a-simple-event>fire a simple event</a> named <code title=event-load>load</code> at the <code><a href=#script>script</a></code>
+        element.</p>
+
+       </li>
+
+      </ol></dd>
+
+    </dl></li>
+
+  </ol><p>The IDL attributes <dfn id=dom-script-src title=dom-script-src><code>src</code></dfn>, <dfn id=dom-script-type title=dom-script-type><code>type</code></dfn>, <dfn id=dom-script-charset title=dom-script-charset><code>charset</code></dfn>, and <dfn id=dom-script-defer title=dom-script-defer><code>defer</code></dfn>, each must
   <a href=#reflect>reflect</a> the respective content attributes of the same
   name.</p>
 

Modified: source
===================================================================
--- source	2011-02-14 10:02:35 UTC (rev 5882)
+++ source	2011-02-14 20:47:46 UTC (rev 5883)
@@ -15970,6 +15970,15 @@
 
    </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
+    abort these steps.</p>
+
+   </li>
+
    <li id="script-processing-noscript">
 
     <p>If <span title="concept-n-noscript">scripting is
@@ -16271,202 +16280,229 @@
   style sheets are blocking which scripts -->
 
   <p>When the user agent is required to <dfn title="execute the script
-  block">execute a script block</dfn>, it must act as follows:</p>
+  block">execute a script block</dfn>, it must run the following
+  steps:</p>
 
-  <dl class="switch">
+  <ol>
 
-   <dt>If the load resulted in an error (for example a DNS error, or
-   an HTTP 404 error)</dt>
+   <li>
 
-   <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>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
+    abort these steps.</p>
 
-   <dt>If the load was successful</dt>
+   </li>
 
-   <!-- SCRIPT EXEC -->
-   <dd>
+   <li>
 
-    <p>Executing the script block must consists of running the
-    following steps. For the purposes of these steps, the script is
-    considered to be from an <i>external file</i> if, while the
-    <span>prepare a script</span> algorithm above was running for this
-    script, the <code>script</code> element had a <code
-    title="attr-script-src">src</code> attribute specified.</p>
+    <p>Jump to the appropriate set of steps from the list below:</p>
 
-    <ol>
+    <dl class="switch">
 
-     <li id="establish-script-block-source">
+     <dt>If the load resulted in an error (for example a DNS error, or
+     an HTTP 404 error)</dt>
 
-      <p>Initialize <dfn><var>the script block's source</var></dfn> as
-      follows:</p>
+     <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>
 
-      <dl class="switch">
+     <dt>If the load was successful</dt>
 
-       <dt>If the script is from an external file and <var>the script block's type</var> is a text-based language</dt>
+     <!-- SCRIPT EXEC -->
+     <dd>
 
-       <dd>
+      <p>Executing the script block must consists of running the
+      following steps. For the purposes of these steps, the script is
+      considered to be from an <i>external file</i> if, while the
+      <span>prepare a script</span> algorithm above was running for
+      this script, the <code>script</code> element had a <code
+      title="attr-script-src">src</code> attribute specified.</p>
 
-        <p>The contents of that file, interpreted as string of
-        Unicode characters, are the script source.</p>
+      <ol>
 
-        <p>To obtain the string of Unicode characters, the user agent
-        run the following steps:</p>
+       <li id="establish-script-block-source">
 
-        <ol>
+        <p>Initialize <dfn><var>the script block's source</var></dfn>
+        as follows:</p>
 
-         <li><p>If the resource's <span title="Content-Type">Content
-         Type metadata</span>, if any, specifies a character encoding,
-         and the user agent supports that encoding, then let <var
-         title="">character encoding</var> be that encoding, and jump
-         to the bottom step in this series of steps.</p></li>
+        <dl class="switch">
 
-         <li><p>If the algorithm above set <var>the script block's
-         character encoding</var>, then let <var title="">character
-         encoding</var> be that encoding, and jump to the bottom step
-         in this series of steps.</p></li>
+         <dt>If the script is from an external file and <var>the
+         script block's type</var> is a text-based language</dt>
 
-         <li><p>For each of the rows in the following table, starting
-         with the first one and going down, if the file has as many or
-         more bytes available than the number of bytes in the first
-         column, and the first bytes of the file match the bytes given
-         in the first column, then set <var title="">character
-         encoding</var> to the encoding given in the cell in the
-         second column of that row, and jump to the bottom step in
-         this series of steps:</p>
+         <dd>
 
-          <!-- this table is present in several forms in this file; keep them in sync -->
-          <table id="table-script-bom">
-           <thead>
-            <tr>
-             <th>Bytes in Hexadecimal
-             <th>Encoding
-           <tbody>
-  <!-- nobody uses this
-            <tr>
-             <td>00 00 FE FF
-             <td>UTF-32BE
-            <tr>
-             <td>FF FE 00 00
-             <td>UTF-32LE
-  -->
-            <tr>
-             <td>FE FF
-             <td>Big-endian UTF-16
-            <tr>
-             <td>FF FE
-             <td>Little-endian UTF-16
-            <tr>
-             <td>EF BB BF
-             <td>UTF-8
-  <!-- nobody uses this
-            <tr>
-             <td>DD 73 66 73
-             <td>UTF-EBCDIC
-  -->
-          </table>
+          <p>The contents of that file, interpreted as string of
+          Unicode characters, are the script source.</p>
 
-          <p class="note">This step looks for Unicode Byte Order Marks
-          (BOMs).</p>
+          <p>To obtain the string of Unicode characters, the user
+          agent run the following steps:</p>
 
-         </li>
+          <ol>
 
-         <li><p>Let <var title="">character encoding</var> be <var>the
-         script block's fallback character encoding</var>.</p></li>
+           <li><p>If the resource's <span title="Content-Type">Content
+           Type metadata</span>, if any, specifies a character
+           encoding, and the user agent supports that encoding, then
+           let <var title="">character encoding</var> be that
+           encoding, and jump to the bottom step in this series of
+           steps.</p></li>
 
-         <li><p>Convert the file to Unicode using <var>character
-         encoding</var>, following the rules for doing so given by the
-         specification for <var>the script block's
-         type</var>.</p></li>
+           <li><p>If the algorithm above set <var>the script block's
+           character encoding</var>, then let <var title="">character
+           encoding</var> be that encoding, and jump to the bottom
+           step in this series of steps.</p></li>
 
-        </ol>
+           <li><p>For each of the rows in the following table,
+           starting with the first one and going down, if the file has
+           as many or more bytes available than the number of bytes in
+           the first column, and the first bytes of the file match the
+           bytes given in the first column, then set <var
+           title="">character encoding</var> to the encoding given in
+           the cell in the second column of that row, and jump to the
+           bottom step in this series of steps:</p>
 
-       </dd>
+            <!-- this table is present in several forms in this file; keep them in sync -->
+            <table id="table-script-bom">
+             <thead>
+              <tr>
+               <th>Bytes in Hexadecimal
+               <th>Encoding
+             <tbody>
+    <!-- nobody uses this
+              <tr>
+               <td>00 00 FE FF
+               <td>UTF-32BE
+              <tr>
+               <td>FF FE 00 00
+               <td>UTF-32LE
+    -->
+              <tr>
+               <td>FE FF
+               <td>Big-endian UTF-16
+              <tr>
+               <td>FF FE
+               <td>Little-endian UTF-16
+              <tr>
+               <td>EF BB BF
+               <td>UTF-8
+    <!-- nobody uses this
+              <tr>
+               <td>DD 73 66 73
+               <td>UTF-EBCDIC
+    -->
+            </table>
 
-       <dt>If the script is from an external file and <var>the script block's type</var> is an XML-based language</dt>
+            <p class="note">This step looks for Unicode Byte Order
+            Marks (BOMs).</p>
 
-       <dd>
+           </li>
 
-        <p>The external file is the script source. When it is later
-        executed, it must be interpreted in a manner consistent with
-        the specification defining the language given by <var>the
-        script block's type</var>.</p>
+           <li><p>Let <var title="">character encoding</var> be
+           <var>the script block's fallback character
+           encoding</var>.</p></li>
 
-       </dd>
+           <li><p>Convert the file to Unicode using <var>character
+           encoding</var>, following the rules for doing so given by
+           the specification for <var>the script block's
+           type</var>.</p></li>
 
-       <dt>If the script is inline and <var>the script block's type</var> is a text-based language</dt>
+          </ol>
 
-       <dd>
+         </dd>
 
-        <p>The value of the <code title="dom-script-text">text</code>
-        IDL attribute at the time the element's <span>"already
-        started"</span> flag was last set is the script source.</p>
+         <dt>If the script is from an external file and <var>the
+         script block's type</var> is an XML-based language</dt>
 
-       </dd>
+         <dd>
 
-       <dt>If the script is inline and <var>the script block's type</var> is an XML-based language</dt>
+          <p>The external file is the script source. When it is later
+          executed, it must be interpreted in a manner consistent with
+          the specification defining the language given by <var>the
+          script block's type</var>.</p>
 
-       <dd>
+         </dd>
 
-        <p>The child nodes of the <code>script</code> element at the
-        time the element's <span>"already started"</span> flag was
-        last set are the script source.</p>
+         <dt>If the script is inline and <var>the script block's
+         type</var> is a text-based language</dt>
 
-       </dd>
+         <dd>
 
-      </dl>
+          <p>The value of the <code
+          title="dom-script-text">text</code> IDL attribute at the
+          time the element's <span>"already started"</span> flag was
+          last set is the script source.</p>
 
-     </li>
+         </dd>
 
-     <li>
+         <dt>If the script is inline and <var>the script block's
+         type</var> is an XML-based language</dt>
 
-      <p>If the script is from an external file, then increment the
-      <span>ignore-destructive-writes counter</span> of the
-      <code>script</code> element's <code>Document</code>. Let <var
-      title="">neutralized doc</var> be that
-      <code>Document</code>.</p>
+         <dd>
 
-     </li>
+          <p>The child nodes of the <code>script</code> element at the
+          time the element's <span>"already started"</span> flag was
+          last set are the script source.</p>
 
-     <li>
+         </dd>
 
-      <p><span title="create a script from a node">Create a
-      script</span> from the <code>script</code> element node, using
-      <var>the script block's source</var> and <var>the script
-      block's type</var>.</p>
+        </dl>
 
-      <p class="note">This is where the script is compiled and
-      actually executed.</p>
+       </li>
 
-     </li>
+       <li>
 
-     <li>
+        <p>If the script is from an external file, then increment the
+        <span>ignore-destructive-writes counter</span> of the
+        <code>script</code> element's <code>Document</code>. Let <var
+        title="">neutralized doc</var> be that
+        <code>Document</code>.</p>
 
-      <p>Decrement the <span>ignore-destructive-writes counter</span>
-      of <var title="">neutralized doc</var>, if it was incremented in
-      the earlier step.</p>
+       </li>
 
-     </li>
+       <li>
 
-     <li>
+        <p><span title="create a script from a node">Create a
+        script</span> from the <code>script</code> element node, using
+        <var>the script block's source</var> and <var>the script
+        block's type</var>.</p>
 
-      <p>If the script is from an external file, <span>fire a simple
-      event</span> named <code title="event-load">load</code> at the
-      <code>script</code> element.</p>
+        <p class="note">This is where the script is compiled and
+        actually executed.</p>
 
-      <p>Otherwise, the script is internal; <span>queue a task</span>
-      to <span>fire a simple event</span> named <code
-      title="event-load">load</code> at the <code>script</code>
-      element.</p>
+       </li>
 
-     </li>
+       <li>
 
-    </ol>
+        <p>Decrement the <span>ignore-destructive-writes
+        counter</span> of <var title="">neutralized doc</var>, if it
+        was incremented in the earlier step.</p>
 
-   </dd>
+       </li>
 
-  </dl>
+       <li>
 
+        <p>If the script is from an external file, <span>fire a simple
+        event</span> named <code title="event-load">load</code> at the
+        <code>script</code> element.</p>
+
+        <p>Otherwise, the script is internal; <span>queue a
+        task</span> to <span>fire a simple event</span> named <code
+        title="event-load">load</code> at the <code>script</code>
+        element.</p>
+
+       </li>
+
+      </ol>
+
+     </dd>
+
+    </dl>
+
+   </li>
+
+  </ol>
+
   <p>The IDL attributes <dfn
   title="dom-script-src"><code>src</code></dfn>, <dfn
   title="dom-script-type"><code>type</code></dfn>, <dfn




More information about the Commit-Watchers mailing list