Skip to content

Commit 22ce3c3

Browse files
committed
[giow] (3) Adjust the Adoption Agency Algorithm to not reverse the order of nodes in the document, by removing nodes that we're not recreating from the stack of open elements.
Affected topics: HTML Syntax and Parsing git-svn-id: http://svn.whatwg.org/webapps@8108 340c8d12-0b0e-0410-8428-c7bf67bfef74
1 parent 69a860f commit 22ce3c3

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

complete.html

+6-7
Original file line numberDiff line numberDiff line change
@@ -91534,24 +91534,23 @@ <h6 id=the-before-head-insertion-mode><span class=secno>12.2.5.4.3 </span>The "<
9153491534

9153591535
<ol><li><p>Let <var title="">inner loop counter</var> be zero.</li>
9153691536

91537-
<li><p><i>Inner loop</i>: If <var title="">inner loop counter</var> is greater than or equal to
91538-
three, then go to the next step in the overall algorithm.</li>
91539-
91540-
<li><p>Increment <var title="">inner loop counter</var> by one.</li>
91537+
<li><p><i>Inner loop</i>: Increment <var title="">inner loop counter</var> by one.</li>
9154191538

9154291539
<li><p>Let <var title="">node</var> be the element immediately above <var title="">node</var>
9154391540
in the <a href=#stack-of-open-elements>stack of open elements</a>, or if <var title="">node</var> is no longer in the
9154491541
<a href=#stack-of-open-elements>stack of open elements</a> (e.g. because it got removed by this algorithm<!-- in
9154591542
particular, the step labeled "removal" below -->), the element that was immediately above <var title="">node</var> in the <a href=#stack-of-open-elements>stack of open elements</a> before <var title="">node</var>
9154691543
was removed.</li>
9154791544

91545+
<li><p>If <var title="">node</var> is <var title="">formatting element</var>, then go to the
91546+
next step in the overall algorithm.</li>
91547+
91548+
<li><p>If <var title="">inner loop counter</var> is greater than three and <var title="">node</var> is in the <a href=#list-of-active-formatting-elements>list of active formatting elements</a>, then remove <var title="">node</var> from the <a href=#list-of-active-formatting-elements>list of active formatting elements</a>.</li>
91549+
9154891550
<li><p><!-- "removal" step: -->If <var title="">node</var> is not in the <a href=#list-of-active-formatting-elements>list of active
9154991551
formatting elements</a>, then remove <var title="">node</var> from the <a href=#stack-of-open-elements>stack of open
9155091552
elements</a> and then go back to the step labeled <i>inner loop</i>.</li>
9155191553

91552-
<li><p>Otherwise, if <var title="">node</var> is <var title="">formatting element</var>, then
91553-
go to the next step in the overall algorithm.</li>
91554-
9155591554
<li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> for which the element <var title="">node</var> was created, with <var title="">common ancestor</var> as the intended
9155691555
parent; replace the entry for <var title="">node</var> in the <a href=#list-of-active-formatting-elements>list of active formatting
9155791556
elements</a> with an entry for the new element, replace the entry for <var title="">node</var> in the <a href=#stack-of-open-elements>stack of open elements</a> with an entry for the new

index

+6-7
Original file line numberDiff line numberDiff line change
@@ -91534,24 +91534,23 @@ document.body.appendChild(text);
9153491534

9153591535
<ol><li><p>Let <var title="">inner loop counter</var> be zero.</li>
9153691536

91537-
<li><p><i>Inner loop</i>: If <var title="">inner loop counter</var> is greater than or equal to
91538-
three, then go to the next step in the overall algorithm.</li>
91539-
91540-
<li><p>Increment <var title="">inner loop counter</var> by one.</li>
91537+
<li><p><i>Inner loop</i>: Increment <var title="">inner loop counter</var> by one.</li>
9154191538

9154291539
<li><p>Let <var title="">node</var> be the element immediately above <var title="">node</var>
9154391540
in the <a href=#stack-of-open-elements>stack of open elements</a>, or if <var title="">node</var> is no longer in the
9154491541
<a href=#stack-of-open-elements>stack of open elements</a> (e.g. because it got removed by this algorithm<!-- in
9154591542
particular, the step labeled "removal" below -->), the element that was immediately above <var title="">node</var> in the <a href=#stack-of-open-elements>stack of open elements</a> before <var title="">node</var>
9154691543
was removed.</li>
9154791544

91545+
<li><p>If <var title="">node</var> is <var title="">formatting element</var>, then go to the
91546+
next step in the overall algorithm.</li>
91547+
91548+
<li><p>If <var title="">inner loop counter</var> is greater than three and <var title="">node</var> is in the <a href=#list-of-active-formatting-elements>list of active formatting elements</a>, then remove <var title="">node</var> from the <a href=#list-of-active-formatting-elements>list of active formatting elements</a>.</li>
91549+
9154891550
<li><p><!-- "removal" step: -->If <var title="">node</var> is not in the <a href=#list-of-active-formatting-elements>list of active
9154991551
formatting elements</a>, then remove <var title="">node</var> from the <a href=#stack-of-open-elements>stack of open
9155091552
elements</a> and then go back to the step labeled <i>inner loop</i>.</li>
9155191553

91552-
<li><p>Otherwise, if <var title="">node</var> is <var title="">formatting element</var>, then
91553-
go to the next step in the overall algorithm.</li>
91554-
9155591554
<li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> for which the element <var title="">node</var> was created, with <var title="">common ancestor</var> as the intended
9155691555
parent; replace the entry for <var title="">node</var> in the <a href=#list-of-active-formatting-elements>list of active formatting
9155791556
elements</a> with an entry for the new element, replace the entry for <var title="">node</var> in the <a href=#stack-of-open-elements>stack of open elements</a> with an entry for the new

source

+8-7
Original file line numberDiff line numberDiff line change
@@ -102244,10 +102244,7 @@ document.body.appendChild(text);
102244102244

102245102245
<li><p>Let <var title="">inner loop counter</var> be zero.</p></li>
102246102246

102247-
<li><p><i>Inner loop</i>: If <var title="">inner loop counter</var> is greater than or equal to
102248-
three, then go to the next step in the overall algorithm.</p></li>
102249-
102250-
<li><p>Increment <var title="">inner loop counter</var> by one.</p></li>
102247+
<li><p><i>Inner loop</i>: Increment <var title="">inner loop counter</var> by one.</p></li>
102251102248

102252102249
<li><p>Let <var title="">node</var> be the element immediately above <var title="">node</var>
102253102250
in the <span>stack of open elements</span>, or if <var title="">node</var> is no longer in the
@@ -102256,13 +102253,17 @@ document.body.appendChild(text);
102256102253
title="">node</var> in the <span>stack of open elements</span> before <var title="">node</var>
102257102254
was removed.</p></li>
102258102255

102256+
<li><p>If <var title="">node</var> is <var title="">formatting element</var>, then go to the
102257+
next step in the overall algorithm.</p></li>
102258+
102259+
<li><p>If <var title="">inner loop counter</var> is greater than three and <var
102260+
title="">node</var> is in the <span>list of active formatting elements</span>, then remove <var
102261+
title="">node</var> from the <span>list of active formatting elements</span>.</p></li>
102262+
102259102263
<li><p><!-- "removal" step: -->If <var title="">node</var> is not in the <span>list of active
102260102264
formatting elements</span>, then remove <var title="">node</var> from the <span>stack of open
102261102265
elements</span> and then go back to the step labeled <i>inner loop</i>.</p></li>
102262102266

102263-
<li><p>Otherwise, if <var title="">node</var> is <var title="">formatting element</var>, then
102264-
go to the next step in the overall algorithm.</p></li>
102265-
102266102267
<li><p><span>Create an element for the token</span> for which the element <var
102267102268
title="">node</var> was created, with <var title="">common ancestor</var> as the intended
102268102269
parent; replace the entry for <var title="">node</var> in the <span>list of active formatting

0 commit comments

Comments
 (0)