W3C home > Mailing lists > Public > public-html-diffs@w3.org > December 2008

spec/Overview.html 1.1683 2512 Attempt to define that <script>document.

From: poot <cvsmail@w3.org>
Date: Tue, 2 Dec 2008 13:38:42 +0900 (JST)
To: public-html-diffs@w3.org
Message-Id: <20081202043843.119692BBF2@toro.w3.mag.keio.ac.jp>

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. (whatwg r2512)

8.2.2 The input stream
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1683.html#the-input-stream
acknowledged
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1683.html#acknowledge-self-closing-flag
parser pause flag
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1683.html#parser-pause-flag
script nesting level
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1683.html#script-nesting-level
At this stage, if there is a pending external script, then:
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1683.html#scriptTagParserResumes
8.2.4.1 Data state
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1683.html#data-state
There is only one set of state for the tokeniser stage and the tree construction stage, but the tree construction stage is reentrant, meaning that while the tree construction stage is handling one token, the tokeniser might be resumed, causing further tokens to be emitted and processed before the first token's processing is complete.
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1683.html#nestedParsing
8.2.5.11 The "in CDATA/RCDATA" insertion mode
http://people.w3.org/mike/diffs/html5/spec/Overview.1.1683.html#parsing-main-incdata

http://people.w3.org/mike/diffs/html5/spec/Overview.diff.html
http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.1682&r2=1.1683&f=h
http://html5.org/tools/web-apps-tracker?from=2511&to=2512

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.1682
retrieving revision 1.1683
diff -u -d -r1.1682 -r1.1683
--- Overview.html	2 Dec 2008 04:10:40 -0000	1.1682
+++ Overview.html	2 Dec 2008 04:35:59 -0000	1.1683
@@ -36142,7 +36142,9 @@
 &lt;/script&gt;
 ...</pre>
 
-  </div><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
+  </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.<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
   tokenization stage will be initially seen by the user agent as a
   stream of bytes (typically coming over the network or from the local
   file system). The bytes encode the actual characters according to a
@@ -37029,12 +37031,16 @@
   tree construction stage, that is a <a href=#parse-error>parse error</a>.<p>When an end tag token is emitted, the <a href=#content-model-flag>content model
   flag</a> must be switched to the PCDATA state.<p>When an end tag token is emitted with attributes, that is a
   <a href=#parse-error>parse error</a>.<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>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>The tokeniser state machine consists of the states defined in the
+  flag</i> set, that is a <a href=#parse-error>parse error</a>.<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>The tokeniser state machine consists of the states defined in the
   following subsections.</p><!-- XXX should go through these reordering the entries so that
   they're in some consistent order, like, by Unicode, errors last, or
   something --><h5 id=data-state><span class=secno>8.2.4.1 </span><dfn>Data state</dfn></h5><p>Consume the <a href=#next-input-character>next input character</a>:<dl class=switch><dt>U+0026 AMPERSAND (&amp;)</dt>
@@ -40045,11 +40051,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
@@ -40062,10 +40075,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>
Received on Tuesday, 2 December 2008 04:39:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 18 December 2010 06:13:57 GMT