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
<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>
91484
91484
91485
91485
<ul><li>is between the end of the list and the last scope marker in the list, if any, or the start
91486
91486
of the list otherwise, and</li>
91487
91487
91488
91488
<li>has the tag name <var title="">subject</var>.</li>
91489
91489
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
91491
91491
other end tag" entry below.</p>
91492
91492
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>
91496
91494
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>
91500
91498
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>
91504
91502
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>. -->
91506
91506
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>
<li><p>If there is no <var title="">furthest block</var>, then the UA must first pop all the
91512
91517
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>
91515
91523
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>
<li><p>Increment <var title="">inner loop counter</var> by one.</li>
91533
91541
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>
91539
91547
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>
91543
91551
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
91545
91553
go to the next step in the overall algorithm.</li>
91546
91554
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>
91553
91559
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
91555
91561
aforementioned bookmark to be immediately after the new <var title="">node</var> in the
91556
91562
<a href=#list-of-active-formatting-elements>list of active formatting elements</a>.</li>
91557
91563
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>
91560
91566
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>
91562
91568
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>
91564
91570
91565
91571
</ol></li>
91566
91572
91567
91573
<li><p>Insert whatever <var title="">last node</var> ended up being in the previous step at the
91568
91574
<a href=#appropriate-place-for-inserting-a-node>appropriate place for inserting a node</a>, but using <var title="">common
91569
91575
ancestor</var> as the <i>override target</i>.</li>
91570
91576
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
91572
91578
element</var> was created, with <var title="">furthest block</var> as the intended
91573
91579
parent.</li>
91574
91580
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>
91577
91583
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>
91579
91585
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
91581
91587
elements</a>, and insert the new element into the <a href=#list-of-active-formatting-elements>list of active formatting
91582
91588
elements</a> at the position of the aforementioned bookmark.</li>
91583
91589
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
91585
91591
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>
91587
91593
91588
91594
<li><p>Jump back to the step labeled <i>outer loop</i>.</li>
0 commit comments