Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[act] (2) Change the algorithm for </form> to work the same as for </…
…div>. Also some scary editoral work that theoretically didn't change anything: simplify the 'generate implied end tags' algorith. Reword some of the algorithms so that they don't sound like you have to look through the stack twice.

git-svn-id: http://svn.whatwg.org/webapps@1320 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Mar 3, 2008
1 parent d8c0111 commit fb7324d
Show file tree
Hide file tree
Showing 2 changed files with 215 additions and 169 deletions.
197 changes: 111 additions & 86 deletions index
Expand Up @@ -40838,20 +40838,14 @@ function receiver(e) {
implied end tags</h5>

<p>When the steps below require the UA to <dfn id=generate>generate implied
end tags</dfn>, then, if the <a href="#current4">current node</a> is a
end tags</dfn>, then, while the <a href="#current4">current node</a> is a
<code><a href="#dd">dd</a></code> element, a <code><a
href="#dt">dt</a></code> element, an <code><a href="#li">li</a></code>
element, a <code><a href="#p">p</a></code> element, a <code><a
href="#tbody">tbody</a></code> element, a <code><a
href="#td">td</a></code> element, a <code><a
href="#tfoot0">tfoot</a></code> element, a <code><a
href="#th">th</a></code> element, a <code><a
href="#thead0">thead</a></code> element, a <code><a
href="#tr">tr</a></code> element, the UA must act as if an end tag with
the respective tag name had been seen and then <a
href="#generate">generate implied end tags</a> again.

<p>The step that requires the UA to generate implied end tags but lists an
element, or a <code><a href="#p">p</a></code> element, the UA must pop the
<a href="#current4">current node</a> off the <a href="#stack">stack of
open elements</a>.

<p>If a step requires the UA to generate implied end tags but lists an
element to exclude from the process, then the UA must perform the above
steps as if that element was not in the above list.

Expand Down Expand Up @@ -42204,52 +42198,59 @@ simplified explanation instead:
"ul"

<dd>
<p>If the <a href="#stack">stack of open elements</a> <a
href="#have-an">has an element in scope</a> with the same tag name as
that of the token, then <a href="#generate">generate implied end
tags</a>.</p>

<p>Now, if the <a href="#current4">current node</a> is not an element
with the same tag name as that of the token, then this is a <a
<p>If the <a href="#stack">stack of open elements</a> does not <a
href="#have-an" title="has an element in scope">have an element in
scope</a> with the same tag name as that of the token, then this is a <a
href="#parse0">parse error</a>.</p>

<p>If the <a href="#stack">stack of open elements</a> <a
href="#have-an">has an element in scope</a> with the same tag name as
that of the token, then pop elements from this stack until an element
with that tag name has been popped from the stack.</p>
<!-- XXX quirk (except for in certain cases?):
<p>Otherwise, act as if a start tag with the tag name given in
the token had been seen, then reprocess the current token.</p>
-->

<p>Otherwise, run these steps:</p>

<ol>
<li>
<p><a href="#generate">Generate implied end tags</a>.

<li>
<p>If the <a href="#current4">current node</a> is not an element with
the same tag name as that of the token, then this is a <a
href="#parse0">parse error</a>.

<li>
<p>Pop elements from the <a href="#stack">stack of open elements</a>
until an element with the same tag name as the token has been popped
from the stack.
</ol>

<dt>An end tag whose tag name is "form"

<dd>
<p>If the <a href="#stack">stack of open elements</a> <a
href="#have-an">has an element in scope</a> with the same tag name as
that of the token, then <a href="#generate">generate implied end
tags</a>.</p>
<p>Set the <a href="#form-element"><code title="">form</code> element
pointer</a> to null.</p>

<p>Now, if the <a href="#current4">current node</a> is not an element
with the same tag name as that of the token, then this is a <a
<p>If the <a href="#stack">stack of open elements</a> does not <a
href="#have-an" title="has an element in scope">have an element in
scope</a> with the same tag name as that of the token, then this is a <a
href="#parse0">parse error</a>.</p>

<p>Otherwise, if the <a href="#current4">current node</a> is an element
with the same tag name as that of the token pop that element from the
stack.</p>
<p>Otherwise, run these steps:</p>

<ol>
<li>
<p><a href="#generate">Generate implied end tags</a>.

<li>
<p>If the <a href="#current4">current node</a> is not an element with
the same tag name as that of the token, then this is a <a
href="#parse0">parse error</a>.

<p>In any case, set the <a href="#form-element"><code
title="">form</code> element pointer</a> to null.</p>
<li>
<p>Pop elements from the <a href="#stack">stack of open elements</a>
until an element with the same tag name as the token has been popped
from the stack.
</ol>

<dt>An end tag whose tag name is "p"

<dd>
<p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
title="has an element in scope">has a <code>p</code> element in
scope</a>, then <a href="#generate">generate implied end tags</a>,
except for <code><a href="#p">p</a></code> elements.</p>

<p>If the <a href="#current4">current node</a> is not a <code><a
href="#p">p</a></code> element, then this is a <a href="#parse0">parse
error</a>.</p>
Expand All @@ -42266,43 +42267,58 @@ simplified explanation instead:
<dt>An end tag whose tag name is one of: "dd", "dt", "li"

<dd>
<p>If the <a href="#stack">stack of open elements</a> <a
href="#have-an">has an element in scope</a> whose tag name matches the
tag name of the token, then <a href="#generate">generate implied end
tags</a>, except for elements with the same tag name as the token.</p>
<p>If the <a href="#stack">stack of open elements</a> does not <a
href="#have-an" title="has an element in scope">have an element in
scope</a> with the same tag name as that of the token, then this is a <a
href="#parse0">parse error</a>.</p>

<p>If the <a href="#current4">current node</a> is not an element with the
same tag name as the token, then this is a <a href="#parse0">parse
error</a>.</p>
<p>Otherwise, run these steps:</p>

<p>If the <a href="#stack">stack of open elements</a> <a
href="#have-an">has an element in scope</a> whose tag name matches the
tag name of the token, then pop elements from this stack until an
element with that tag name has been popped from the stack.</p>
<ol>
<li>
<p><a href="#generate">Generate implied end tags</a>, except for
elements with the same tag name as the token.

<li>
<p>If the <a href="#current4">current node</a> is not an element with
the same tag name as that of the token, then this is a <a
href="#parse0">parse error</a>.

<li>
<p>Pop elements from the <a href="#stack">stack of open elements</a>
until an element with the same tag name as the token has been popped
from the stack.
</ol>

<dt>An end tag whose tag name is one of: "h1", "h2", "h3", "h4", "h5",
"h6"

<dd>
<p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
title="has an element in scope">has in scope</a> an element whose tag
name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then <a
href="#generate">generate implied end tags</a>.</p>
<p>If the <a href="#stack">stack of open elements</a> does not <a
href="#have-an" title="has an element in scope">have an element in
scope</a> whose tag name is one of "h1", "h2", "h3", "h4", "h5", or
"h6", then this is a <a href="#parse0">parse error</a>.
<!-- XXX quirk: Act as if
a start tag with the tag name given in the token had been seen,
then reprocess the current token. --></p>

<p>Now, if the <a href="#current4">current node</a> is not an element
with the same tag name as that of the token, then this is a <a
href="#parse0">parse error</a>.</p>
<p>Otherwise, run these steps:</p>

<p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
title="has an element in scope">has in scope</a> an element whose tag
name is one of "h1", "h2", "h3", "h4", "h5", or "h6", then pop elements
from the stack until an element with one of those tag names has been
popped from the stack.</p>
<!-- XXX quirk:
<p>Otherwise, act as if a start tag with the tag name given in
the token had been seen, then reprocess the current token.</p>
-->
</dd>
<ol>
<li>
<p><a href="#generate">Generate implied end tags</a>.

<li>
<p>If the <a href="#current4">current node</a> is not an element with
the same tag name as that of the token, then this is a <a
href="#parse0">parse error</a>.

<li>
<p>Pop elements from the <a href="#stack">stack of open elements</a>
until an element whose tag name is one of "h1", "h2", "h3", "h4",
"h5", or "h6" has been popped from the stack.
</ol>
</dd>
<!-- ADOPTION AGENCY ELEMENTS
Mozilla-only: bdo blink del ins sub sup q
Safari-only: code dfn kbd nobr samp var wbr
Expand Down Expand Up @@ -42563,20 +42579,30 @@ simplified explanation instead:
"object"

<dd>
<p>If the <a href="#stack">stack of open elements</a> <a href="#have-an"
title="has an element in scope">has in scope</a> an element whose tag
name is the same as the tag name of the token, then <a
href="#generate">generate implied end tags</a>.</p>

<p>Now, if the <a href="#current4">current node</a> is not an element
with the same tag name as the token, then this is a <a
<p>If the <a href="#stack">stack of open elements</a> does not <a
href="#have-an" title="has an element in scope">have an element in
scope</a> with the same tag name as that of the token, then this is a <a
href="#parse0">parse error</a>.</p>

<p>Now, if the <a href="#stack">stack of open elements</a> <a
href="#have-an">has an element in scope</a> whose tag name matches the
tag name of the token, then pop elements from the stack until that
element has been popped from the stack, and <a href="#clear0">clear the
list of active formatting elements up to the last marker</a>.</p>
<p>Otherwise, run these steps:</p>

<ol>
<li>
<p><a href="#generate">Generate implied end tags</a>.

<li>
<p>If the <a href="#current4">current node</a> is not an element with
the same tag name as that of the token, then this is a <a
href="#parse0">parse error</a>.

<li>
<p>Pop elements from the <a href="#stack">stack of open elements</a>
until an element with the same tag name as the token has been popped
from the stack.

<li><a href="#clear0">Clear the list of active formatting elements up to
the last marker</a>.
</ol>

<dt>A start tag whose tag name is "xmp"

Expand Down Expand Up @@ -43382,8 +43408,7 @@ mtd, maction

<p>Otherwise:</p>

<p><a href="#generate">Generate implied end tags</a>, except for elements
with the same tag name as the token.</p>
<p><a href="#generate">Generate implied end tags</a>.</p>

<p>Now, if the <a href="#current4">current node</a> is not an element
with the same tag name as the token, then this is a <a
Expand Down

0 comments on commit fb7324d

Please sign in to comment.