Skip to content

Commit

Permalink
[e] (0) Remove the remaining 'act as if' cases. This _should_ be an e…
Browse files Browse the repository at this point in the history
…ntirely editorial fix, but reviews are definitely encouraged...

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

git-svn-id: http://svn.whatwg.org/webapps@8002 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jul 1, 2013
1 parent 1e9cd28 commit 0fee116
Show file tree
Hide file tree
Showing 3 changed files with 522 additions and 505 deletions.
330 changes: 168 additions & 162 deletions complete.html
Expand Up @@ -88823,8 +88823,7 @@ <h4 id=tree-construction><span class=secno>12.2.5 </span><dfn>Tree construction<
<code><a href=#document>Document</a></code> so that it is available to the user, or when it has to begin accepting user
input.</p>

<hr><p>As each token is emitted from the tokenizer, and when the specification says that a user agent
is to <dfn id=act-as-if-a-token-had-been-seen>act as if a token had been seen</dfn>, the user agent must follow the appropriate steps
<hr><p>As each token is emitted from the tokenizer, the user agent must follow the appropriate steps
from the following list, known as the <dfn id=tree-construction-dispatcher>tree construction dispatcher</dfn>:</p>

<dl class=switch><dt>If there is no <a href=#adjusted-current-node>adjusted current node</a></dt>
Expand Down Expand Up @@ -90612,10 +90611,11 @@ <h6 id=the-before-head-insertion-mode><span class=secno>12.2.5.4.3 </span>The "<
contains an element whose tag name is "a" between the end of
the list and the last marker on the list (or the start of the
list if there is no marker on the list), then this is a
<a href=#parse-error>parse error</a>; act as if an end tag with the tag
name "a" had been seen, then remove that element from the
<a href=#parse-error>parse error</a>; run the <a href=#adoption-agency-algorithm>adoption agency
algorithm</a> for the tag name "a", then remove that element from the
<a href=#list-of-active-formatting-elements>list of active formatting elements</a> and the
<a href=#stack-of-open-elements>stack of open elements</a> if the end tag didn't
<a href=#stack-of-open-elements>stack of open elements</a> if the <a href=#adoption-agency-algorithm>adoption agency
algorithm</a> didn't
already remove it (it might not have if the element is not
<a href=#has-an-element-in-table-scope title="has an element in table scope">in table
scope</a>).</p>
Expand Down Expand Up @@ -90662,8 +90662,8 @@ <h6 id=the-before-head-insertion-mode><span class=secno>12.2.5.4.3 </span>The "<

<p>If the <a href=#stack-of-open-elements>stack of open elements</a> <a href=#has-an-element-in-scope title="has an
element in scope">has a <code>nobr</code> element in scope</a>,
then this is a <a href=#parse-error>parse error</a>; act as if an end tag with
the tag name "nobr" had been seen, then once again
then this is a <a href=#parse-error>parse error</a>; run the <a href=#adoption-agency-algorithm>adoption agency algorithm</a> for
the tag name "nobr", then once again
<a href=#reconstruct-the-active-formatting-elements>reconstruct the active formatting elements</a>, if
any.</p>

Expand All @@ -90678,159 +90678,7 @@ <h6 id=the-before-head-insertion-mode><span class=secno>12.2.5.4.3 </span>The "<
"strike", "strong", "tt", "u"</dt>
<dd>

<p>Run these steps:</p>

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

<li><p><i>Outer loop</i>: If <var title="">outer loop
counter</var> is greater than or equal to eight, then abort these
steps.</li>

<li><p>Increment <var title="">outer loop counter</var> by
one.</li>

<li>

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

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

<li>has the same tag name as the token.</li>

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

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

<p>Otherwise, if there is such a node, and that node is also in
the <a href=#stack-of-open-elements>stack of open elements</a>, 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 <a href=#parse-error>parse error</a>; ignore the token, and abort these
steps.</p>

<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 scope</a>. If the element is not the
<a href=#current-node>current node</a>, this is a <a href=#parse-error>parse
error</a>. In any case, proceed with the algorithm as
written in the following steps.</p>

</li>

<li><p>Let the <var title="">furthest block</var> be the topmost
node in the <a href=#stack-of-open-elements>stack of open elements</a> that is lower in
the stack than the <var title="">formatting element</var>, and is
an 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 nodes from the bottom of the
<a href=#stack-of-open-elements>stack of open elements</a>, from the <a href=#current-node>current
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 finally abort these steps.</li>

<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>Let a bookmark note the position of the <var title="">formatting element</var> in the <a href=#list-of-active-formatting-elements>list of active
formatting elements</a> relative to the elements on either
side of it in the list.</li>

<li>

<p>Let <var title="">node</var> and <var title="">last node</var> be the <var title="">furthest block</var>. Follow these steps:</p>

<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>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 the next step), 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>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>Otherwise, if <var title="">node</var> is the <var title="">formatting element</var>, then go to the next step
in the overall algorithm.</li>

<li><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
element, and let <var title="">node</var> be the new
element.</li>

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

<li>Insert <var title="">last node</var> into <var title="">node</var>, first removing it from its previous
parent node if any.</li>

<li>Let <var title="">last node</var> be <var title="">node</var>.</li>

<li>Return to the step labeled <i>inner loop</i>.</li>

</ol></li>

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

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

<li><p>Take all of the child nodes of the <var title="">furthest
block</var> and append them to the element created in the last
step.</li>

<li><p>Append that new element to the <var title="">furthest
block</var>.</li>

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

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

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

</ol><p class=note>Because of the way this algorithm causes elements
to change parents, it has been dubbed the "adoption agency
algorithm" (in contrast with other possible algorithms for dealing
with misnested content, which included the "incest algorithm", the
"secret affair algorithm", and the "Heisenberg algorithm").</p>
<p>Run the <a href=#adoption-agency-algorithm>adoption agency algorithm</a> for the token's tag name.</p>

</dd>

Expand Down Expand Up @@ -91332,7 +91180,165 @@ <h6 id=the-before-head-insertion-mode><span class=secno>12.2.5.4.3 </span>The "<
<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
has been popped from the stack.</li>

</ol><h6 id=parsing-main-incdata><span class=secno>12.2.5.4.8 </span>The "<dfn title="insertion mode: text">text</dfn>" insertion mode</h6>
</ol><p>The <dfn id=adoption-agency-algorithm>adoption agency algorithm</dfn>, which takes as its only argument a tag name <var title="">subject</var> for which the algorithm is being run, consists of the following steps:</p>

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

<li><p><i>Outer loop</i>: If <var title="">outer loop
counter</var> is greater than or equal to eight, then abort these
steps.</li>

<li><p>Increment <var title="">outer loop counter</var> by
one.</li>

<li>

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

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

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

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

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

<p>Otherwise, if there is such a node, and that node is also in
the <a href=#stack-of-open-elements>stack of open elements</a>, 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 <a href=#parse-error>parse error</a>; abort these
steps.</p>

<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 scope</a>. If the element is not the
<a href=#current-node>current node</a>, this is a <a href=#parse-error>parse
error</a>. In any case, proceed with the algorithm as
written in the following steps.</p>

</li>

<li><p>Let the <var title="">furthest block</var> be the topmost
node in the <a href=#stack-of-open-elements>stack of open elements</a> that is lower in
the stack than the <var title="">formatting element</var>, and is
an 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 nodes from the bottom of the
<a href=#stack-of-open-elements>stack of open elements</a>, from the <a href=#current-node>current
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 finally abort these steps.</li>

<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>Let a bookmark note the position of the <var title="">formatting element</var> in the <a href=#list-of-active-formatting-elements>list of active
formatting elements</a> relative to the elements on either
side of it in the list.</li>

<li>

<p>Let <var title="">node</var> and <var title="">last node</var> be the <var title="">furthest block</var>. Follow these steps:</p>

<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>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 the next step), 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>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>Otherwise, if <var title="">node</var> is the <var title="">formatting element</var>, then go to the next step
in the overall algorithm.</li>

<li><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
element, and let <var title="">node</var> be the new
element.</li>

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

<li>Insert <var title="">last node</var> into <var title="">node</var>, first removing it from its previous
parent node if any.</li>

<li>Let <var title="">last node</var> be <var title="">node</var>.</li>

<li>Return to the step labeled <i>inner loop</i>.</li>

</ol></li>

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

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

<li><p>Take all of the child nodes of the <var title="">furthest
block</var> and append them to the element created in the last
step.</li>

<li><p>Append that new element to the <var title="">furthest
block</var>.</li>

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

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

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

</ol><p class=note>This algorithm's name, the "adoption agency algorithm", comes from the way it
causes elements to change parents, and is in contrast with other possible algorithms for dealing
with misnested content, which included the "incest algorithm", the "secret affair algorithm", and
the "Heisenberg algorithm".</p>





<h6 id=parsing-main-incdata><span class=secno>12.2.5.4.8 </span>The "<dfn title="insertion mode: text">text</dfn>" insertion mode</h6>

<p>When the user agent is to apply the rules for the "<a href=#parsing-main-incdata title="insertion mode: text">text</a>" <a href=#insertion-mode>insertion mode</a>, the user agent must handle the token as follows:</p>

Expand Down Expand Up @@ -93000,7 +93006,7 @@ <h6 id=parsing-main-inselect><span class=secno>12.2.5.4.16 </span>The "<dfn titl
<dd>

<p><a href=#acknowledge-self-closing-flag title="acknowledge self-closing flag">Acknowledge the token's <i>self-closing
flag</i></a>, and then act as if an end tag with the tag name "script" had been seen.</p>
flag</i></a>, and then act as described in the steps for a "script" end tag below.</p>

</dd>

Expand Down

0 comments on commit 0fee116

Please sign in to comment.