Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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.

git-svn-id: http://svn.whatwg.org/webapps@2512 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Dec 2, 2008
1 parent bfd8138 commit ee775a4
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 21 deletions.
36 changes: 26 additions & 10 deletions index
Expand Up @@ -45121,6 +45121,10 @@ interface <dfn id=messagechannel>MessageChannel</dfn> {

</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>

Expand Down Expand Up @@ -46167,12 +46171,16 @@ interface <dfn id=messagechannel>MessageChannel</dfn> {
<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>
Expand Down Expand Up @@ -49481,11 +49489,18 @@ interface <dfn id=messagechannel>MessageChannel</dfn> {
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
Expand All @@ -49498,10 +49513,11 @@ interface <dfn id=messagechannel>MessageChannel</dfn> {
<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>
Expand Down
37 changes: 26 additions & 11 deletions source
Expand Up @@ -51468,6 +51468,10 @@ interface <dfn>MessageChannel</dfn> {

</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>

Expand Down Expand Up @@ -52682,13 +52686,16 @@ interface <dfn>MessageChannel</dfn> {
<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>
Expand Down Expand Up @@ -56361,13 +56368,20 @@ interface <dfn>MessageChannel</dfn> {
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
characters to be inserted into the tokeniser</span>, 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 <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
Expand All @@ -56384,10 +56398,11 @@ interface <dfn>MessageChannel</dfn> {
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>
Expand Down

0 comments on commit ee775a4

Please sign in to comment.