Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[cgt] (2) Make </li> be scoped by <ol>/<ul> also.
git-svn-id: http://svn.whatwg.org/webapps@3769 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 7, 2009
1 parent fc2f4b8 commit 8372add
Show file tree
Hide file tree
Showing 2 changed files with 128 additions and 79 deletions.
98 changes: 59 additions & 39 deletions index
Expand Up @@ -61158,58 +61158,55 @@ interface <dfn id=messageport>MessagePort</dfn> {
<dd><p>All other elements found while parsing an HTML
document.</dd>

</dl><p>The <a href=#stack-of-open-elements>stack of open elements</a> is said to <dfn id=has-an-element-in-scope title="has an element in scope">have an element in scope</dfn> when
the following algorithm terminates in a match state:</p>
</dl><p>The <a href=#stack-of-open-elements>stack of open elements</a> is said to <dfn id=has-an-element-in-the-specific-scope title="has an element in the specific scope">have an element in a
specific scope</dfn> consisting of a list of element types <var title="">list</var> when the following algorithm terminates in a
match state:</p>

<ol><li><p>Initialize <var title="">node</var> to be the <a href=#current-node>current
node</a> (the bottommost node of the stack).</li>

<li><p>If <var title="">node</var> is the target node, terminate in
a match state.</li>

<li><p>Otherwise, if <var title="">node</var> is one of the
following elements, terminate in a failure state:</p>
<ul class=brief><li><code><a href=#the-applet-element>applet</a></code> in the HTML namespace</li>
<li><code><a href=#the-caption-element>caption</a></code> in the HTML namespace</li>
<li><code><a href=#the-html-element-0>html</a></code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
<li><code><a href=#the-table-element>table</a></code> in the HTML namespace</li>
<li><code><a href=#the-td-element>td</a></code> in the HTML namespace</li>
<li><code><a href=#the-th-element>th</a></code> in the HTML namespace</li>
<li><code><a href=#the-button-element>button</a></code> in the HTML namespace</li>
<li><code><a href=#the-marquee-element>marquee</a></code> in the HTML namespace</li>
<li><code><a href=#the-object-element>object</a></code> in the HTML namespace</li>
<li><code title="">foreignObject</code> in the SVG namespace</li>
</ul></li>

<li><p>Otherwise, set <var title="">node</var> to the previous
entry in the <a href=#stack-of-open-elements>stack of open elements</a> and return to step
2. (This will never fail, since the loop will always terminate in
the previous step if the top of the stack &mdash; an
<code><a href=#the-html-element-0>html</a></code> element &mdash; is reached.)</li>

</ol><p>The <a href=#stack-of-open-elements>stack of open elements</a> is said to <dfn id=has-an-element-in-table-scope title="has an element in table scope">have an element in <em>table
scope</em></dfn> when the following algorithm terminates in a match
state:</p>

<ol><li><p>Initialize <var title="">node</var> to be the <a href=#current-node>current
node</a> (the bottommost node of the stack).</li>

<li><p>If <var title="">node</var> is the target node, terminate in
a match state.</li>

<li><p>Otherwise, if <var title="">node</var> is one of the
following elements, terminate in a failure state:</p>
<ul class=brief><li><code><a href=#the-html-element-0>html</a></code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
<li><code><a href=#the-table-element>table</a></code> in the HTML namespace</li>
</ul></li>
<li><p>Otherwise, if <var title="">node</var> is one of the element
types in <var title="">list</var>, terminate in a failure
state.</li>

<li><p>Otherwise, set <var title="">node</var> to the previous
entry in the <a href=#stack-of-open-elements>stack of open elements</a> and return to step
2. (This will never fail, since the loop will always terminate in
the previous step if the top of the stack &mdash; an
<code><a href=#the-html-element-0>html</a></code> element &mdash; is reached.)</li>

</ol><p>Nothing happens if at any time any of the elements in the
</ol><p>The <a href=#stack-of-open-elements>stack of open elements</a> is said to <dfn id=has-an-element-in-scope title="has an element in scope">have an element in scope</dfn> when
it <a href=#has-an-element-in-the-specific-scope>has an element in the specific scope</a> consisting
of the following element types:</p>

<ul class=brief><li><code><a href=#the-applet-element>applet</a></code> in the HTML namespace</li>
<li><code><a href=#the-caption-element>caption</a></code> in the HTML namespace</li>
<li><code><a href=#the-html-element-0>html</a></code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
<li><code><a href=#the-table-element>table</a></code> in the HTML namespace</li>
<li><code><a href=#the-td-element>td</a></code> in the HTML namespace</li>
<li><code><a href=#the-th-element>th</a></code> in the HTML namespace</li>
<li><code><a href=#the-button-element>button</a></code> in the HTML namespace</li>
<li><code><a href=#the-marquee-element>marquee</a></code> in the HTML namespace</li>
<li><code><a href=#the-object-element>object</a></code> in the HTML namespace</li>
<li><code title="">foreignObject</code> in the SVG namespace</li>
</ul><p>The <a href=#stack-of-open-elements>stack of open elements</a> is said to <dfn id=has-an-element-in-list-item-scope title="has an element in list item scope">have an element in list
item scope</dfn> when it <a href=#has-an-element-in-the-specific-scope>has an element in the specific
scope</a> consisting of the following element types:</p>

<ul class=brief><li>All the element types listed above for the <i><a href=#has-an-element-in-scope>has an element
in scope</a></i> algorithm.</li>
<li><code><a href=#the-ol-element>ol</a></code> in the HTML namespace</li>
<li><code><a href=#the-ul-element>ul</a></code> in the HTML namespace</li>
</ul><p>The <a href=#stack-of-open-elements>stack of open elements</a> is said to <dfn id=has-an-element-in-table-scope title="has an element in table scope">have an element in <em>table
scope</em></dfn> when it <a href=#has-an-element-in-the-specific-scope>has an element in the specific
scope</a> consisting of the following element types:</p>

<ul class=brief><li><code><a href=#the-html-element-0>html</a></code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
<li><code><a href=#the-table-element>table</a></code> in the HTML namespace</li>
</ul><p>Nothing happens if at any time any of the elements in the
<a href=#stack-of-open-elements>stack of open elements</a> are moved to a new location in,
or removed from, the <code>Document</code> tree. In particular, the
stack is not changed in this situation. This can cause, amongst
Expand Down Expand Up @@ -64134,8 +64131,31 @@ document.body.appendChild(text);

</ol></dd>

<!-- as normal, but needs care as the elements have optional tags, and are further scoped by <ol>/<ul> -->
<dt>An end tag whose tag name is "li"</dt>
<dd>

<p>If the <a href=#stack-of-open-elements>stack of open elements</a> does not <a href=#has-an-element-in-list-item-scope title="has an element in list item scope">have an element in list
item scope</a> with the same tag name as that of the token,
then this is a <a href=#parse-error>parse error</a>; ignore the token.</p>

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

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

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

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

</ol></dd>

<!-- as normal, but needs care as the elements have optional tags -->
<dt>An end tag whose tag name is one of: "dd", "dt", "li"</dt>
<dt>An end tag whose tag name is one of: "dd", "dt"</dt>
<dd>

<p>If the <a href=#stack-of-open-elements>stack of open elements</a> does not <a href=#has-an-element-in-scope title="has an element in scope">have an element in scope</a>
Expand Down
109 changes: 69 additions & 40 deletions source
Expand Up @@ -75745,8 +75745,10 @@ interface <dfn>MessagePort</dfn> {
</dl>

<p>The <span>stack of open elements</span> is said to <dfn
title="has an element in scope">have an element in scope</dfn> when
the following algorithm terminates in a match state:</p>
title="has an element in the specific scope">have an element in a
specific scope</dfn> consisting of a list of element types <var
title="">list</var> when the following algorithm terminates in a
match state:</p>

<ol>

Expand All @@ -75756,21 +75758,9 @@ interface <dfn>MessagePort</dfn> {
<li><p>If <var title="">node</var> is the target node, terminate in
a match state.</p></li>

<li><p>Otherwise, if <var title="">node</var> is one of the
following elements, terminate in a failure state:</p>
<ul class="brief">
<li><code>applet</code> in the HTML namespace</li>
<li><code>caption</code> in the HTML namespace</li>
<li><code>html</code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
<li><code>table</code> in the HTML namespace</li>
<li><code>td</code> in the HTML namespace</li>
<li><code>th</code> in the HTML namespace</li>
<li><code>button</code> in the HTML namespace</li>
<li><code>marquee</code> in the HTML namespace</li>
<li><code>object</code> in the HTML namespace</li>
<li><code title="">foreignObject</code> in the SVG namespace</li>
</ul>
</li>
<li><p>Otherwise, if <var title="">node</var> is one of the element
types in <var title="">list</var>, terminate in a failure
state.</p></li>

<li><p>Otherwise, set <var title="">node</var> to the previous
entry in the <span>stack of open elements</span> and return to step
Expand All @@ -75781,33 +75771,44 @@ interface <dfn>MessagePort</dfn> {
</ol>

<p>The <span>stack of open elements</span> is said to <dfn
title="has an element in table scope">have an element in <em>table
scope</em></dfn> when the following algorithm terminates in a match
state:</p>

<ol>
title="has an element in scope">have an element in scope</dfn> when
it <span>has an element in the specific scope</span> consisting
of the following element types:</p>

<li><p>Initialize <var title="">node</var> to be the <span>current
node</span> (the bottommost node of the stack).</p></li>
<ul class="brief">
<li><code>applet</code> in the HTML namespace</li>
<li><code>caption</code> in the HTML namespace</li>
<li><code>html</code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
<li><code>table</code> in the HTML namespace</li>
<li><code>td</code> in the HTML namespace</li>
<li><code>th</code> in the HTML namespace</li>
<li><code>button</code> in the HTML namespace</li>
<li><code>marquee</code> in the HTML namespace</li>
<li><code>object</code> in the HTML namespace</li>
<li><code title="">foreignObject</code> in the SVG namespace</li>
</ul>

<li><p>If <var title="">node</var> is the target node, terminate in
a match state.</p></li>
<p>The <span>stack of open elements</span> is said to <dfn
title="has an element in list item scope">have an element in list
item scope</dfn> when it <span>has an element in the specific
scope</span> consisting of the following element types:</p>

<li><p>Otherwise, if <var title="">node</var> is one of the
following elements, terminate in a failure state:</p>
<ul class="brief">
<li><code>html</code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
<li><code>table</code> in the HTML namespace</li>
</ul>
</li>
<ul class="brief">
<li>All the element types listed above for the <i>has an element
in scope</i> algorithm.</li>
<li><code>ol</code> in the HTML namespace</li>
<li><code>ul</code> in the HTML namespace</li>
</ul>

<li><p>Otherwise, set <var title="">node</var> to the previous
entry in the <span>stack of open elements</span> and return to step
2. (This will never fail, since the loop will always terminate in
the previous step if the top of the stack &mdash; an
<code>html</code> element &mdash; is reached.)</p></li>
<p>The <span>stack of open elements</span> is said to <dfn
title="has an element in table scope">have an element in <em>table
scope</em></dfn> when it <span>has an element in the specific
scope</span> consisting of the following element types:</p>

</ol>
<ul class="brief">
<li><code>html</code> in the HTML namespace</li> <!-- (This can only happen if the <var title="">node</var> is the topmost node of the <span>stack of open elements</span>, and prevents the next step from being invoked if there are no more elements in the stack.) -->
<li><code>table</code> in the HTML namespace</li>
</ul>

<p>Nothing happens if at any time any of the elements in the
<span>stack of open elements</span> are moved to a new location in,
Expand Down Expand Up @@ -79100,8 +79101,36 @@ document.body.appendChild(text);

</dd>

<!-- as normal, but needs care as the elements have optional tags, and are further scoped by <ol>/<ul> -->
<dt>An end tag whose tag name is "li"</dt>
<dd>

<p>If the <span>stack of open elements</span> does not <span
title="has an element in list item scope">have an element in list
item scope</span> with the same tag name as that of the token,
then this is a <span>parse error</span>; ignore the token.</p>

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

<ol>

<li><p><span>Generate implied end tags</span>, except
for elements with the same tag name as the token.</p></li>

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

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

</ol>

</dd>

<!-- as normal, but needs care as the elements have optional tags -->
<dt>An end tag whose tag name is one of: "dd", "dt", "li"</dt>
<dt>An end tag whose tag name is one of: "dd", "dt"</dt>
<dd>

<p>If the <span>stack of open elements</span> does not <span
Expand Down

0 comments on commit 8372add

Please sign in to comment.