Skip to content

Commit

Permalink
Define speculative HTML parsing (WIP)
Browse files Browse the repository at this point in the history
  • Loading branch information
zcorpan committed Oct 29, 2020
1 parent 895fd80 commit 0c4cb34
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -111086,6 +111086,8 @@ document.body.appendChild(text);
invocations of the tokenizer, yielding control back to the caller. (Tokenization will resume
when the caller returns to the "outer" tree construction stage.)</p>

<p class="XXX">Speculatively parse the remainder of the document.write string here?</p>

<p class="note">The tree construction stage of this particular parser is <a
href="#nestedParsing">being called reentrantly</a>, say from a call to <code
data-x="dom-document-write">document.write()</code>.</p>
Expand All @@ -111101,6 +111103,9 @@ document.body.appendChild(text);
<li><p>Let <var>the script</var> be the <span>pending parsing-blocking
script</span>. There is no longer a <span>pending parsing-blocking script</span>.</p></li>

<li><p><span>Start the speculative HTML parser</span> for this instance of the HTML
parser.</p></li>

<li><p>Block the <span data-x="tokenization">tokenizer</span> for this instance of the
<span>HTML parser</span>, such that the <span>event loop</span> will not run <span
data-x="concept-task">tasks</span> that invoke the <span
Expand All @@ -111122,6 +111127,9 @@ document.body.appendChild(text);
<code>Document</code>.</p>
</li>

<li><p><span>Stop the speculative HTML parser</span> for this instance of the HTML
parser.</p></li>

<li><p>Unblock the <span data-x="tokenization">tokenizer</span> for this instance of the
<span>HTML parser</span>, such that <span data-x="concept-task">tasks</span> that invoke the
<span data-x="tokenization">tokenizer</span> can again be run.</p></li>
Expand Down Expand Up @@ -112657,6 +112665,14 @@ document.body.appendChild(text);

</div>

<div w-nodev>

<h4>Speculative HTML parsing</h4>

<p class="XXX"><dfn>Speculative HTML parser</dfn>, <dfn>start the speculative HTML parser</dfn>,
<dfn>stop the speculative HTML parser</dfn>...</p>

</div>

<div w-nodev>

Expand Down Expand Up @@ -112781,6 +112797,9 @@ document.body.appendChild(text);
<li><p>Throw away any pending content in the <span>input stream</span>, and discard any future
content that would have been added to it.</p></li>

<li><p>If there is an active <span>speculative HTML parser</span>, <span>stop the speculative
HTML parser</span> for this HTML parser.</p></li>

<li><p>Set the <span>current document readiness</span> to "<code data-x="">interactive</code>"<!--
this immediately fires an event -->.</p></li>

Expand Down

0 comments on commit 0c4cb34

Please sign in to comment.