Skip to content

Commit 69a860f

Browse files
committed
[e] (0) Tidy the AAA.
Affected topics: HTML Syntax and Parsing git-svn-id: http://svn.whatwg.org/webapps@8107 340c8d12-0b0e-0410-8428-c7bf67bfef74
1 parent 9f98d39 commit 69a860f

File tree

3 files changed

+170
-149
lines changed

3 files changed

+170
-149
lines changed

complete.html

+55-49
Original file line numberDiff line numberDiff line change
@@ -91466,7 +91466,7 @@ <h6 id=the-before-head-insertion-mode><span class=secno>12.2.5.4.3 </span>The "<
9146691466
<li><p>Pop elements from the <a href=#stack-of-open-elements>stack of open elements</a> until a <code><a href=#the-p-element>p</a></code> element
9146791467
has been popped from the stack.</li>
9146891468

91469-
</ol><p id=adoptionAgency>The <dfn id=adoption-agency-algorithm>adoption agency algorithm</dfn>, which takes as its only argument
91469+
</ol><!-- AAA --><p id=adoptionAgency>The <dfn id=adoption-agency-algorithm>adoption agency algorithm</dfn>, which takes as its only argument
9147091470
a tag name <var title="">subject</var> for which the algorithm is being run, consists of the
9147191471
following steps:</p>
9147291472

@@ -91479,49 +91479,57 @@ <h6 id=the-before-head-insertion-mode><span class=secno>12.2.5.4.3 </span>The "<
9147991479

9148091480
<li>
9148191481

91482-
<p>Let the <var title="">formatting element</var> be the last element in the <a href=#list-of-active-formatting-elements>list of
91483-
active formatting elements</a> that:</p>
91482+
<p>Let <var title="">formatting element</var> be the last element in the <a href=#list-of-active-formatting-elements>list of active
91483+
formatting elements</a> that:</p>
9148491484

9148591485
<ul><li>is between the end of the list and the last scope marker in the list, if any, or the start
9148691486
of the list otherwise, and</li>
9148791487

9148891488
<li>has the tag name <var title="">subject</var>.</li>
9148991489

91490-
</ul><p>If there is no such node, then abort these steps and instead act as described in the "any
91490+
</ul><p>If there is no such element, then abort these steps and instead act as described in the "any
9149191491
other end tag" entry below.</p>
9149291492

91493-
<p>Otherwise, if there is such a node, but that node is not in the <a href=#stack-of-open-elements>stack of open
91494-
elements</a>, then this is a <a href=#parse-error>parse error</a>; remove the element from the list, and
91495-
abort these steps.</p>
91493+
</li>
9149691494

91497-
<p>Otherwise, if there is such a node, and that node is also in the <a href=#stack-of-open-elements>stack of open
91498-
elements</a>, but the element is not <a href=#has-an-element-in-scope title="has an element in scope">in scope</a>,
91499-
then this is a <a href=#parse-error>parse error</a>; abort these steps.</p>
91495+
<li><p>If <var title="">formatting element</var> is not in the <a href=#stack-of-open-elements>stack of open
91496+
elements</a>, then this is a <a href=#parse-error>parse error</a>; remove the element from the list, and
91497+
abort these steps.</li>
9150091498

91501-
<p>Otherwise, there is a <var title="">formatting element</var> and that element is in <a href=#stack-of-open-elements title="stack of open elements">the stack</a> and is <a href=#has-an-element-in-scope title="has an element in scope">in
91502-
scope</a>. If the element is not the <a href=#current-node>current node</a>, this is a <a href=#parse-error>parse
91503-
error</a>. In any case, proceed with the algorithm as written in the following steps.</p>
91499+
<li><p>If <var title="">formatting element</var> is in the <a href=#stack-of-open-elements>stack of open elements</a>,
91500+
but the element is not <a href=#has-an-element-in-scope title="has an element in scope">in scope</a>, then this is a
91501+
<a href=#parse-error>parse error</a>; abort these steps.</li>
9150491502

91505-
</li>
91503+
<!-- at this point, <var title="">formatting element</var> is in <span title="stack of open
91504+
elements">the stack</span> and <span title="list of active formatting elements">the
91505+
list</span>, and is <span title="has an element in scope">in scope</span>. -->
9150691506

91507-
<li><p>Let the <var title="">furthest block</var> be the topmost node in the <a href=#stack-of-open-elements>stack of open
91508-
elements</a> that is lower in the stack than the <var title="">formatting element</var>, and
91509-
is an element in the <a href=#special>special</a> category. There might not be one.</li>
91507+
<li><p>If <var title="">formatting element</var> is not the <a href=#current-node>current node</a>, this is a
91508+
<a href=#parse-error>parse error</a>. (But do not abort these steps.)</li>
91509+
91510+
<li><p>Let <var title="">furthest block</var> be the topmost node in the <a href=#stack-of-open-elements>stack of open
91511+
elements</a> that is lower in the stack than <var title="">formatting element</var>, and is an
91512+
element in the <a href=#special>special</a> category. There might not be one.</li>
91513+
91514+
<!-- <html> ... <formatting element> ... <furthest block> ... <current node> -->
9151091515

9151191516
<li><p>If there is no <var title="">furthest block</var>, then the UA must first pop all the
9151291517
nodes from the bottom of the <a href=#stack-of-open-elements>stack of open elements</a>, from the <a href=#current-node>current
91513-
node</a> up to and including the <var title="">formatting element</var>, then remove the <var title="">formatting element</var> from the <a href=#list-of-active-formatting-elements>list of active formatting elements</a>, and
91514-
finally abort these steps.</li>
91518+
node</a> up to and including <var title="">formatting element</var>, then remove <var title="">formatting element</var> from the <a href=#list-of-active-formatting-elements>list of active formatting elements</a>, and
91519+
finally abort these steps.</li> <!-- the "reconstruct the active formatting elements"
91520+
algorithm will rebuild them later -->
91521+
91522+
<li><p>Let <var title="">common ancestor</var> be the element immediately above <var title="">formatting element</var> in the <a href=#stack-of-open-elements>stack of open elements</a>.</li>
9151591523

91516-
<li><p>Let the <var title="">common ancestor</var> be the element immediately above the <var title="">formatting element</var> in the <a href=#stack-of-open-elements>stack of open elements</a>.</li>
91524+
<!-- <html> ... <common ancestor> <formatting element> ... <furthest block> ... <current node> -->
9151791525

91518-
<li><p>Let a bookmark note the position of the <var title="">formatting element</var> in the
91526+
<li><p>Let a bookmark note the position of <var title="">formatting element</var> in the
9151991527
<a href=#list-of-active-formatting-elements>list of active formatting elements</a> relative to the elements on either side of it in
9152091528
the list.</li>
9152191529

9152291530
<li>
9152391531

91524-
<p>Let <var title="">node</var> and <var title="">last node</var> be the <var title="">furthest
91532+
<p>Let <var title="">node</var> and <var title="">last node</var> be <var title="">furthest
9152591533
block</var>. Follow these steps:</p>
9152691534

9152791535
<ol><li><p>Let <var title="">inner loop counter</var> be zero.</li>
@@ -91531,59 +91539,57 @@ <h6 id=the-before-head-insertion-mode><span class=secno>12.2.5.4.3 </span>The "<
9153191539

9153291540
<li><p>Increment <var title="">inner loop counter</var> by one.</li>
9153391541

91534-
<li>Let <var title="">node</var> be the element immediately above <var title="">node</var> in
91535-
the <a href=#stack-of-open-elements>stack of open elements</a>, or if <var title="">node</var> is no longer in the
91536-
<a href=#stack-of-open-elements>stack of open elements</a> (e.g. because it got removed by the next step), the element
91537-
that was immediately above <var title="">node</var> in the <a href=#stack-of-open-elements>stack of open elements</a>
91538-
before <var title="">node</var> was removed.</li>
91542+
<li><p>Let <var title="">node</var> be the element immediately above <var title="">node</var>
91543+
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+
<a href=#stack-of-open-elements>stack of open elements</a> (e.g. because it got removed by this algorithm<!-- in
91545+
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+
was removed.</li>
9153991547

91540-
<li>If <var title="">node</var> is not in the <a href=#list-of-active-formatting-elements>list of active formatting elements</a>,
91541-
then remove <var title="">node</var> from the <a href=#stack-of-open-elements>stack of open elements</a> and then go
91542-
back to the step labeled <i>inner loop</i>.</li>
91548+
<li><p><!-- "removal" step: -->If <var title="">node</var> is not in the <a href=#list-of-active-formatting-elements>list of active
91549+
formatting elements</a>, then remove <var title="">node</var> from the <a href=#stack-of-open-elements>stack of open
91550+
elements</a> and then go back to the step labeled <i>inner loop</i>.</li>
9154391551

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

91547-
<li><a href=#create-an-element-for-the-token>Create an element for the token</a> for which the element <var title="">node</var>
91548-
was created, with <var title="">common ancestor</var> as the intended parent; replace the entry
91549-
for <var title="">node</var> in the <a href=#list-of-active-formatting-elements>list of active formatting elements</a> with an
91550-
entry for the new element, replace the entry for <var title="">node</var> in the <a href=#stack-of-open-elements>stack of
91551-
open elements</a> with an entry for the new element, and let <var title="">node</var> be the
91552-
new element.</li>
91555+
<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+
parent; replace the entry for <var title="">node</var> in the <a href=#list-of-active-formatting-elements>list of active formatting
91557+
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
91558+
element, and let <var title="">node</var> be the new element.</li>
9155391559

91554-
<li>If <var title="">last node</var> is the <var title="">furthest block</var>, then move the
91560+
<li><p>If <var title="">last node</var> is <var title="">furthest block</var>, then move the
9155591561
aforementioned bookmark to be immediately after the new <var title="">node</var> in the
9155691562
<a href=#list-of-active-formatting-elements>list of active formatting elements</a>.</li>
9155791563

91558-
<li>Insert <var title="">last node</var> into <var title="">node</var>, first removing it from
91559-
its previous parent node if any.</li>
91564+
<li><p>Insert <var title="">last node</var> into <var title="">node</var>, first removing it
91565+
from its previous parent node if any.</li>
9156091566

91561-
<li>Let <var title="">last node</var> be <var title="">node</var>.</li>
91567+
<li><p>Let <var title="">last node</var> be <var title="">node</var>.</li>
9156291568

91563-
<li>Return to the step labeled <i>inner loop</i>.</li>
91569+
<li><p>Return to the step labeled <i>inner loop</i>.</li>
9156491570

9156591571
</ol></li>
9156691572

9156791573
<li><p>Insert whatever <var title="">last node</var> ended up being in the previous step at the
9156891574
<a href=#appropriate-place-for-inserting-a-node>appropriate place for inserting a node</a>, but using <var title="">common
9156991575
ancestor</var> as the <i>override target</i>.</li>
9157091576

91571-
<li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> for which the <var title="">formatting
91577+
<li><p><a href=#create-an-element-for-the-token>Create an element for the token</a> for which <var title="">formatting
9157291578
element</var> was created, with <var title="">furthest block</var> as the intended
9157391579
parent.</li>
9157491580

91575-
<li><p>Take all of the child nodes of the <var title="">furthest block</var> and append them to
91576-
the element created in the last step.</li>
91581+
<li><p>Take all of the child nodes of <var title="">furthest block</var> and append them to the
91582+
element created in the last step.</li>
9157791583

91578-
<li><p>Append that new element to the <var title="">furthest block</var>.</li>
91584+
<li><p>Append that new element to <var title="">furthest block</var>.</li>
9157991585

91580-
<li><p>Remove the <var title="">formatting element</var> from the <a href=#list-of-active-formatting-elements>list of active formatting
91586+
<li><p>Remove <var title="">formatting element</var> from the <a href=#list-of-active-formatting-elements>list of active formatting
9158191587
elements</a>, and insert the new element into the <a href=#list-of-active-formatting-elements>list of active formatting
9158291588
elements</a> at the position of the aforementioned bookmark.</li>
9158391589

91584-
<li><p>Remove the <var title="">formatting element</var> from the <a href=#stack-of-open-elements>stack of open
91590+
<li><p>Remove <var title="">formatting element</var> from the <a href=#stack-of-open-elements>stack of open
9158591591
elements</a>, and insert the new element into the <a href=#stack-of-open-elements>stack of open elements</a>
91586-
immediately below the position of the <var title="">furthest block</var> in that stack.</li>
91592+
immediately below the position of <var title="">furthest block</var> in that stack.</li>
9158791593

9158891594
<li><p>Jump back to the step labeled <i>outer loop</i>.</li>
9158991595

0 commit comments

Comments
 (0)