Skip to content

Commit

Permalink
[cgiowt] (3) PARSER CHANGE: Change the Adoption Agency Algorithm so t…
Browse files Browse the repository at this point in the history
…hat it only pops the current element if it's not on the list of formatting elements, since otherwise we can end up with close tags closing things out of order even when they're all there.

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=24833
Affected topics: HTML Syntax and Parsing

git-svn-id: http://svn.whatwg.org/webapps@8531 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Mar 6, 2014
1 parent 4d9202e commit ca405b3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 49 deletions.
19 changes: 4 additions & 15 deletions complete.html
Expand Up @@ -92348,21 +92348,10 @@ <h6 id=the-before-head-insertion-mode><span class=secno>12.2.5.4.3 </span>The "<
a tag name <var title="">subject</var> for which the algorithm is being run, consists of the
following steps:</p>

<ol><!-- don't forget about the noah's ark clause when looking at this algorithm! --><li>

<p>If the <a href=#current-node>current node</a> is an <a href=#html-elements title="HTML elements">HTML element</a> whose
tag name is <var title="">subject</var>, then run these substeps:

<ol><li><p>Let <var title="">element</var> be the <a href=#current-node>current node</a>.</li>

<li><p>Pop <var title="">element</var> off the <a href=#stack-of-open-elements>stack of open elements</a>.</li>

<li><p>If <var title="">element</var> is also in the <a href=#list-of-active-formatting-elements>list of active formatting
elements</a>, remove the element from the list.</li>

<li><p>Abort the <a href=#adoption-agency-algorithm>adoption agency algorithm</a>.</li>

</ol></li>
<ol><!-- don't forget about the noah's ark clause when looking at this algorithm! --><li><p>If the <a href=#current-node>current node</a> is an <a href=#html-elements title="HTML elements">HTML element</a>
whose tag name is <var title="">subject</var>, and the <a href=#current-node>current node</a> is not in the
<a href=#list-of-active-formatting-elements>list of active formatting elements</a>, then pop the <a href=#current-node>current node</a> off the
<a href=#stack-of-open-elements>stack of open elements</a>, and abort these steps.</li>

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

Expand Down
19 changes: 4 additions & 15 deletions index
Expand Up @@ -92348,21 +92348,10 @@ document.body.appendChild(text);
a tag name <var title="">subject</var> for which the algorithm is being run, consists of the
following steps:</p>

<ol><!-- don't forget about the noah's ark clause when looking at this algorithm! --><li>

<p>If the <a href=#current-node>current node</a> is an <a href=#html-elements title="HTML elements">HTML element</a> whose
tag name is <var title="">subject</var>, then run these substeps:

<ol><li><p>Let <var title="">element</var> be the <a href=#current-node>current node</a>.</li>

<li><p>Pop <var title="">element</var> off the <a href=#stack-of-open-elements>stack of open elements</a>.</li>

<li><p>If <var title="">element</var> is also in the <a href=#list-of-active-formatting-elements>list of active formatting
elements</a>, remove the element from the list.</li>

<li><p>Abort the <a href=#adoption-agency-algorithm>adoption agency algorithm</a>.</li>

</ol></li>
<ol><!-- don't forget about the noah's ark clause when looking at this algorithm! --><li><p>If the <a href=#current-node>current node</a> is an <a href=#html-elements title="HTML elements">HTML element</a>
whose tag name is <var title="">subject</var>, and the <a href=#current-node>current node</a> is not in the
<a href=#list-of-active-formatting-elements>list of active formatting elements</a>, then pop the <a href=#current-node>current node</a> off the
<a href=#stack-of-open-elements>stack of open elements</a>, and abort these steps.</li>

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

Expand Down
23 changes: 4 additions & 19 deletions source
Expand Up @@ -103021,25 +103021,10 @@ document.body.appendChild(text);

<!-- don't forget about the noah's ark clause when looking at this algorithm! -->

<li>

<p>If the <span>current node</span> is an <span data-x="HTML elements">HTML element</span> whose
tag name is <var data-x="">subject</var>, then run these substeps:

<ol>

<li><p>Let <var data-x="">element</var> be the <span>current node</span>.</p></li>

<li><p>Pop <var data-x="">element</var> off the <span>stack of open elements</span>.</p></li>

<li><p>If <var data-x="">element</var> is also in the <span>list of active formatting
elements</span>, remove the element from the list.</p></li>

<li><p>Abort the <span>adoption agency algorithm</span>.</p></li>

</ol>

</li>
<li><p>If the <span>current node</span> is an <span data-x="HTML elements">HTML element</span>
whose tag name is <var data-x="">subject</var>, and the <span>current node</span> is not in the
<span>list of active formatting elements</span>, then pop the <span>current node</span> off the
<span>stack of open elements</span>, and abort these steps.</p></li>

<li><p>Let <var data-x="">outer loop counter</var> be zero.</p></li>

Expand Down

0 comments on commit ca405b3

Please sign in to comment.