[html5] r2512 - [ct] (0) Attempt to define that <script>document.write('<script src=a.js><'+'/sc [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Dec 1 20:35:56 PST 2008


Author: ianh
Date: 2008-12-01 20:35:55 -0800 (Mon, 01 Dec 2008)
New Revision: 2512

Modified:
   index
   source
Log:
[ct] (0) Attempt to define that <script>document.write('<script src=a.js><'+'/script>1');document.write('2<script src=a.js><'+'/script>');</script> must output 12 not 21.

Modified: index
===================================================================
--- index	2008-12-02 04:10:36 UTC (rev 2511)
+++ index	2008-12-02 04:35:55 UTC (rev 2512)
@@ -45121,7 +45121,11 @@
 
   </div>
 
+  <p>To handle these cases, parsers have a <dfn id=script-nesting-level>script nesting
+  level</dfn>, which must be initially set to zero, and a <dfn id=parser-pause-flag>parser
+  pause flag</dfn>, which must be initially set to false.</p>
 
+
   <h4 id=the-input-stream><span class=secno>8.2.2 </span>The <dfn>input stream</dfn></h4>
 
   <p>The stream of Unicode characters that consists the input to the
@@ -46167,12 +46171,16 @@
   <p>When an end tag token is emitted with its <i>self-closing
   flag</i> set, that is a <a href=#parse-error>parse error</a>.</p>
 
-  <p>Before each step of the tokeniser, the user agent may check to
-  see if either one of the scripts in the <a href=#list-of-scripts-that-will-execute-as-soon-as-possible>list of scripts that
-  will execute as soon as possible</a> or the first script in the
-  <a href=#list-of-scripts-that-will-execute-asynchronously>list of scripts that will execute asynchronously</a>, has
-  <a href=#completed-loading>completed loading</a>. If one has, then it must be <a href=#executing-a-script-block title="executing a script block">executed</a> and removed from
-  its list.</p>
+  <p>Before each step of the tokeniser, the user agent must first
+  check the <a href=#parser-pause-flag>parser pause flag</a>. If it is true, then the
+  tokeniser must abort the processing of any nested invocations of the
+  tokeniser, yielding control back to the caller. If it is false, then
+  the user agent may then check to see if either one of the scripts in
+  the <a href=#list-of-scripts-that-will-execute-as-soon-as-possible>list of scripts that will execute as soon as
+  possible</a> or the first script in the <a href=#list-of-scripts-that-will-execute-asynchronously>list of scripts
+  that will execute asynchronously</a>, has <a href=#completed-loading>completed
+  loading</a>. If one has, then it must be <a href=#executing-a-script-block title="executing a
+  script block">executed</a> and removed from its list.</p>
 
   <p>The tokeniser state machine consists of the states defined in the
   following subsections.</p>
@@ -49481,11 +49489,18 @@
     the <a href=#insertion-point>insertion point</a> be just before the <a href=#next-input-character>next
     input character</a>.</p>
 
+    <p>Increment the parser's <a href=#script-nesting-level>script nesting level</a> by
+    one.</p>
+
     <p><a href=#running-a-script title="running a script">Run</a> the <var title="">script</var>. This might cause some script to execute,
     which might cause <a href=#dom-document-write-html title=dom-document-write-HTML>new
     characters to be inserted into the tokeniser</a>, and might
     cause the tokeniser to output more tokens, resulting in a <a href=#nestedParsing>reentrant invocation of the parser</a>.</p>
 
+    <p>Decrement the parser's <a href=#script-nesting-level>script nesting level</a> by
+    one. If the parser's <a href=#script-nesting-level>script nesting level</a> is zero,
+    then set the <a href=#parser-pause-flag>parser pause flag</a> to false.</p>
+
     <p>Let the <a href=#insertion-point>insertion point</a> have the value of the
     <var title="">old insertion point</var>. (In other words,
     restore the <a href=#insertion-point>insertion point</a> to the value it had
@@ -49498,10 +49513,11 @@
     <dl class=switch><dt>If the tree construction stage is <a href=#nestedParsing>being called reentrantly</a>, say from a
      call to <code title=dom-document-write-HTML><a href=#dom-document-write-html>document.write()</a></code>:</dt>
 
-     <dd><p>Abort the processing of any nested invocations of the
-     tokeniser, yielding control back to the caller. (Tokenization
-     will resume when the caller returns to the "outer" tree
-     construction stage.)</dd>
+     <dd><p>Set the <a href=#parser-pause-flag>parser pause flag</a> to true, and abort
+     the processing of any nested invocations of the tokeniser,
+     yielding control back to the caller. (Tokenization will resume
+     when the caller returns to the "outer" tree construction
+     stage.)</dd>
 
 
      <dt>Otherwise:</dt>

Modified: source
===================================================================
--- source	2008-12-02 04:10:36 UTC (rev 2511)
+++ source	2008-12-02 04:35:55 UTC (rev 2512)
@@ -51468,7 +51468,11 @@
 
   </div>
 
+  <p>To handle these cases, parsers have a <dfn>script nesting
+  level</dfn>, which must be initially set to zero, and a <dfn>parser
+  pause flag</dfn>, which must be initially set to false.</p>
 
+
   <h4>The <dfn>input stream</dfn></h4>
 
   <p>The stream of Unicode characters that consists the input to the
@@ -52682,13 +52686,16 @@
   <p>When an end tag token is emitted with its <i>self-closing
   flag</i> set, that is a <span>parse error</span>.</p>
 
-  <p>Before each step of the tokeniser, the user agent may check to
-  see if either one of the scripts in the <span>list of scripts that
-  will execute as soon as possible</span> or the first script in the
-  <span>list of scripts that will execute asynchronously</span>, has
-  <span>completed loading</span>. If one has, then it must be <span
-  title="executing a script block">executed</span> and removed from
-  its list.</p>
+  <p>Before each step of the tokeniser, the user agent must first
+  check the <span>parser pause flag</span>. If it is true, then the
+  tokeniser must abort the processing of any nested invocations of the
+  tokeniser, yielding control back to the caller. If it is false, then
+  the user agent may then check to see if either one of the scripts in
+  the <span>list of scripts that will execute as soon as
+  possible</span> or the first script in the <span>list of scripts
+  that will execute asynchronously</span>, has <span>completed
+  loading</span>. If one has, then it must be <span title="executing a
+  script block">executed</span> and removed from its list.</p>
 
   <p>The tokeniser state machine consists of the states defined in the
   following subsections.</p>
@@ -56361,6 +56368,9 @@
     the <span>insertion point</span> be just before the <span>next
     input character</span>.</p>
 
+    <p>Increment the parser's <span>script nesting level</span> by
+    one.</p>
+
     <p><span title="running a script">Run</span> the <var
     title="">script</var>. This might cause some script to execute,
     which might cause <span title="dom-document-write-HTML">new
@@ -56368,6 +56378,10 @@
     cause the tokeniser to output more tokens, resulting in a <a
     href="#nestedParsing">reentrant invocation of the parser</a>.</p>
 
+    <p>Decrement the parser's <span>script nesting level</span> by
+    one. If the parser's <span>script nesting level</span> is zero,
+    then set the <span>parser pause flag</span> to false.</p>
+
     <p>Let the <span>insertion point</span> have the value of the
     <var title="">old insertion point</var>. (In other words,
     restore the <span>insertion point</span> to the value it had
@@ -56384,10 +56398,11 @@
      call to <code
      title="dom-document-write-HTML">document.write()</code>:</dt>
 
-     <dd><p>Abort the processing of any nested invocations of the
-     tokeniser, yielding control back to the caller. (Tokenization
-     will resume when the caller returns to the "outer" tree
-     construction stage.)</p></dd>
+     <dd><p>Set the <span>parser pause flag</span> to true, and abort
+     the processing of any nested invocations of the tokeniser,
+     yielding control back to the caller. (Tokenization will resume
+     when the caller returns to the "outer" tree construction
+     stage.)</p></dd>
 
 
      <dt>Otherwise:</dt>




More information about the Commit-Watchers mailing list