You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[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.
<ol><li><p>Let <var title="">inner loop counter</var> be zero.</li>
91536
91536
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>
91541
91538
91542
91539
<li><p>Let <var title="">node</var> be the element immediately above <var title="">node</var>
91543
91540
in the <a href=#stack-of-open-elements>stack of open elements</a>, or if <var title="">node</var> is no longer in the
91544
91541
<a href=#stack-of-open-elements>stack of open elements</a> (e.g. because it got removed by this algorithm<!-- in
91545
91542
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>
91546
91543
was removed.</li>
91547
91544
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
+
91548
91550
<li><p><!-- "removal" step: -->If <var title="">node</var> is not in the <a href=#list-of-active-formatting-elements>list of active
91549
91551
formatting elements</a>, then remove <var title="">node</var> from the <a href=#stack-of-open-elements>stack of open
91550
91552
elements</a> and then go back to the step labeled <i>inner loop</i>.</li>
91551
91553
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
-
91555
91554
<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
91556
91555
parent; replace the entry for <var title="">node</var> in the <a href=#list-of-active-formatting-elements>list of active formatting
91557
91556
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
<ol><li><p>Let <var title="">inner loop counter</var> be zero.</li>
91536
91536
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>
91541
91538
91542
91539
<li><p>Let <var title="">node</var> be the element immediately above <var title="">node</var>
91543
91540
in the <a href=#stack-of-open-elements>stack of open elements</a>, or if <var title="">node</var> is no longer in the
91544
91541
<a href=#stack-of-open-elements>stack of open elements</a> (e.g. because it got removed by this algorithm<!-- in
91545
91542
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>
91546
91543
was removed.</li>
91547
91544
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
+
91548
91550
<li><p><!-- "removal" step: -->If <var title="">node</var> is not in the <a href=#list-of-active-formatting-elements>list of active
91549
91551
formatting elements</a>, then remove <var title="">node</var> from the <a href=#stack-of-open-elements>stack of open
91550
91552
elements</a> and then go back to the step labeled <i>inner loop</i>.</li>
91551
91553
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
-
91555
91554
<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
91556
91555
parent; replace the entry for <var title="">node</var> in the <a href=#list-of-active-formatting-elements>list of active formatting
91557
91556
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
0 commit comments