Skip to content

Commit

Permalink
[giow] (3) Adjust the Adoption Agency Algorithm to not reverse the or…
Browse files Browse the repository at this point in the history
…der 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
  • Loading branch information
Hixie committed Jul 31, 2013
1 parent 69a860f commit 22ce3c3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 21 deletions.
13 changes: 6 additions & 7 deletions complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -91534,24 +91534,23 @@ <h6 id=the-before-head-insertion-mode><span class=secno>12.2.5.4.3 </span>The "<

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

<li><p><i>Inner loop</i>: If <var title="">inner loop counter</var> is greater than or equal to
three, then go to the next step in the overall algorithm.</li>

<li><p>Increment <var title="">inner loop counter</var> by one.</li>
<li><p><i>Inner loop</i>: Increment <var title="">inner loop counter</var> by one.</li>

<li><p>Let <var title="">node</var> be the element immediately above <var title="">node</var>
in the <a href=#stack-of-open-elements>stack of open elements</a>, or if <var title="">node</var> is no longer in the
<a href=#stack-of-open-elements>stack of open elements</a> (e.g. because it got removed by this algorithm<!-- in
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>
was removed.</li>

<li><p>If <var title="">node</var> is <var title="">formatting element</var>, then go to the
next step in the overall algorithm.</li>

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

<li><p><!-- "removal" step: -->If <var title="">node</var> is not 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=#stack-of-open-elements>stack of open
elements</a> and then go back to the step labeled <i>inner loop</i>.</li>

<li><p>Otherwise, if <var title="">node</var> is <var title="">formatting element</var>, then
go to the next step in the overall algorithm.</li>

<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
parent; replace the entry for <var title="">node</var> in the <a href=#list-of-active-formatting-elements>list of active formatting
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
Expand Down
13 changes: 6 additions & 7 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -91534,24 +91534,23 @@ document.body.appendChild(text);

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

<li><p><i>Inner loop</i>: If <var title="">inner loop counter</var> is greater than or equal to
three, then go to the next step in the overall algorithm.</li>

<li><p>Increment <var title="">inner loop counter</var> by one.</li>
<li><p><i>Inner loop</i>: Increment <var title="">inner loop counter</var> by one.</li>

<li><p>Let <var title="">node</var> be the element immediately above <var title="">node</var>
in the <a href=#stack-of-open-elements>stack of open elements</a>, or if <var title="">node</var> is no longer in the
<a href=#stack-of-open-elements>stack of open elements</a> (e.g. because it got removed by this algorithm<!-- in
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>
was removed.</li>

<li><p>If <var title="">node</var> is <var title="">formatting element</var>, then go to the
next step in the overall algorithm.</li>

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

<li><p><!-- "removal" step: -->If <var title="">node</var> is not 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=#stack-of-open-elements>stack of open
elements</a> and then go back to the step labeled <i>inner loop</i>.</li>

<li><p>Otherwise, if <var title="">node</var> is <var title="">formatting element</var>, then
go to the next step in the overall algorithm.</li>

<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
parent; replace the entry for <var title="">node</var> in the <a href=#list-of-active-formatting-elements>list of active formatting
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
Expand Down
15 changes: 8 additions & 7 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -102244,10 +102244,7 @@ document.body.appendChild(text);

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

<li><p><i>Inner loop</i>: If <var title="">inner loop counter</var> is greater than or equal to
three, then go to the next step in the overall algorithm.</p></li>

<li><p>Increment <var title="">inner loop counter</var> by one.</p></li>
<li><p><i>Inner loop</i>: Increment <var title="">inner loop counter</var> by one.</p></li>

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

<li><p>If <var title="">node</var> is <var title="">formatting element</var>, then go to the
next step in the overall algorithm.</p></li>

<li><p>If <var title="">inner loop counter</var> is greater than three and <var
title="">node</var> is in the <span>list of active formatting elements</span>, then remove <var
title="">node</var> from the <span>list of active formatting elements</span>.</p></li>

<li><p><!-- "removal" step: -->If <var title="">node</var> is not in the <span>list of active
formatting elements</span>, then remove <var title="">node</var> from the <span>stack of open
elements</span> and then go back to the step labeled <i>inner loop</i>.</p></li>

<li><p>Otherwise, if <var title="">node</var> is <var title="">formatting element</var>, then
go to the next step in the overall algorithm.</p></li>

<li><p><span>Create an element for the token</span> for which the element <var
title="">node</var> was created, with <var title="">common ancestor</var> as the intended
parent; replace the entry for <var title="">node</var> in the <span>list of active formatting
Expand Down

0 comments on commit 22ce3c3

Please sign in to comment.