[html5] r7241 - [cgiowt] (0) Make the outline algorithm handle implied headings better. Really t [...]
whatwg at whatwg.org
whatwg at whatwg.org
Thu Aug 9 20:05:53 PDT 2012
Author: ianh
Date: 2012-08-09 20:05:51 -0700 (Thu, 09 Aug 2012)
New Revision: 7241
Modified:
complete.html
index
source
Log:
[cgiowt] (0) Make the outline algorithm handle implied headings better. Really this should just be rewritten to be clearer...
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=15670
Affected topics: HTML
Modified: complete.html
===================================================================
--- complete.html 2012-08-10 00:01:59 UTC (rev 7240)
+++ complete.html 2012-08-10 03:05:51 UTC (rev 7241)
@@ -246,7 +246,7 @@
<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
- <h2 class="no-num no-toc">Living Standard — Last Updated 9 August 2012</h2>
+ <h2 class="no-num no-toc">Living Standard — Last Updated 10 August 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
@@ -19167,6 +19167,10 @@
<dd>
+ <p>If the <var title="">current section</var> has no heading,
+ create an implied heading and let that be the heading for the
+ <var title="">current section</var>.</p>
+
<p>Pop the top element from the stack, and let the <var title="">current outlinee</var> be that element.</p>
<p>Let <var title="">current section</var> be the last section
@@ -19188,8 +19192,12 @@
<p>Run these steps:</p>
- <ol><li><p>Pop the top element from the stack, and let the <var title="">current outlinee</var> be that element.</li>
+ <ol><li><p>If the <var title="">current section</var> has no
+ heading, create an implied heading and let that be the heading
+ for the <var title="">current section</var>.</li>
+ <li><p>Pop the top element from the stack, and let the <var title="">current outlinee</var> be that element.</li>
+
<li><p>Let <var title="">current section</var> be the last
section in the <a href=#outline>outline</a> of the <var title="">current
outlinee</var> element.</li>
@@ -19218,9 +19226,9 @@
at the root of the subtree for which an outline is being
generated.</p>
- <p>Let <var title="">current section</var> be the first <a href=#concept-section title=concept-section>section</a> in the
- <a href=#outline>outline</a> of the <var title="">current outlinee</var>
- element.</p>
+ <p>If the <var title="">current section</var> has no heading,
+ create an implied heading and let that be the heading for the
+ <var title="">current section</var>.</p>
<p>Skip to the next step in the overall set of steps. (The walk
is over.)</p>
@@ -19237,7 +19245,9 @@
<p>Otherwise, if the element being entered has a
<a href=#rank>rank</a> equal to or greater than the heading of the
- last section of the <a href=#outline>outline</a> of the <var title="">current outlinee</var>, then create a new <a href=#concept-section title=concept-section>section</a> and append it to the
+ last section of the <a href=#outline>outline</a> of the <var title="">current outlinee</var>, or if the heading of the last
+ section of the <a href=#outline>outline</a> of the <var title="">current
+ outlinee</var> is an implied heading, then create a new <a href=#concept-section title=concept-section>section</a> and append it to the
<a href=#outline>outline</a> of the <var title="">current outlinee</var>
element, so that this new section is the new last section of
that outline. Let <var title="">current section</var> be that
@@ -19248,8 +19258,11 @@
<ol><li><p>Let <var title="">candidate section</var> be <var title="">current section</var>.</li>
- <li><p>If the element being entered has a <a href=#rank>rank</a>
- lower than the <a href=#rank>rank</a> of the heading of the <var title="">candidate section</var>, then create a new <a href=#concept-section title=concept-section>section</a>, and append it to <var title="">candidate section</var>. (This does not change which
+ <li><p><i>Heading loop</i>: If the element being entered has a
+ <a href=#rank>rank</a> lower than the <a href=#rank>rank</a> of the
+ heading of the <var title="">candidate section</var><!-- the
+ first time through, it won't be, but maybe on a subsequent pass
+ it is -->, then create a new <a href=#concept-section title=concept-section>section</a>, and append it to <var title="">candidate section</var>. (This does not change which
section is the last section in the outline.) Let <var title="">current section</var> be this new section. Let the
element being entered be the new heading for the <var title="">current section</var>. Abort these substeps.</p>
@@ -19259,7 +19272,7 @@
<li><p>Let <var title="">candidate section</var> be <var title="">new candidate section</var>.</li>
- <li><p>Return to step 2.</li>
+ <li><p>Return to the step labeled <i>heading loop</i>.</li>
</ol><p>Push the element being entered onto the stack. (This causes
the algorithm to skip any descendants of the element.)</p>
Modified: index
===================================================================
--- index 2012-08-10 00:01:59 UTC (rev 7240)
+++ index 2012-08-10 03:05:51 UTC (rev 7241)
@@ -246,7 +246,7 @@
<header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
<hgroup><h1 class=allcaps>HTML</h1>
- <h2 class="no-num no-toc">Living Standard — Last Updated 9 August 2012</h2>
+ <h2 class="no-num no-toc">Living Standard — Last Updated 10 August 2012</h2>
</hgroup><dl><dt><strong>Web developer edition:</strong></dt>
<dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
<dt>Multiple-page version:</dt>
@@ -19167,6 +19167,10 @@
<dd>
+ <p>If the <var title="">current section</var> has no heading,
+ create an implied heading and let that be the heading for the
+ <var title="">current section</var>.</p>
+
<p>Pop the top element from the stack, and let the <var title="">current outlinee</var> be that element.</p>
<p>Let <var title="">current section</var> be the last section
@@ -19188,8 +19192,12 @@
<p>Run these steps:</p>
- <ol><li><p>Pop the top element from the stack, and let the <var title="">current outlinee</var> be that element.</li>
+ <ol><li><p>If the <var title="">current section</var> has no
+ heading, create an implied heading and let that be the heading
+ for the <var title="">current section</var>.</li>
+ <li><p>Pop the top element from the stack, and let the <var title="">current outlinee</var> be that element.</li>
+
<li><p>Let <var title="">current section</var> be the last
section in the <a href=#outline>outline</a> of the <var title="">current
outlinee</var> element.</li>
@@ -19218,9 +19226,9 @@
at the root of the subtree for which an outline is being
generated.</p>
- <p>Let <var title="">current section</var> be the first <a href=#concept-section title=concept-section>section</a> in the
- <a href=#outline>outline</a> of the <var title="">current outlinee</var>
- element.</p>
+ <p>If the <var title="">current section</var> has no heading,
+ create an implied heading and let that be the heading for the
+ <var title="">current section</var>.</p>
<p>Skip to the next step in the overall set of steps. (The walk
is over.)</p>
@@ -19237,7 +19245,9 @@
<p>Otherwise, if the element being entered has a
<a href=#rank>rank</a> equal to or greater than the heading of the
- last section of the <a href=#outline>outline</a> of the <var title="">current outlinee</var>, then create a new <a href=#concept-section title=concept-section>section</a> and append it to the
+ last section of the <a href=#outline>outline</a> of the <var title="">current outlinee</var>, or if the heading of the last
+ section of the <a href=#outline>outline</a> of the <var title="">current
+ outlinee</var> is an implied heading, then create a new <a href=#concept-section title=concept-section>section</a> and append it to the
<a href=#outline>outline</a> of the <var title="">current outlinee</var>
element, so that this new section is the new last section of
that outline. Let <var title="">current section</var> be that
@@ -19248,8 +19258,11 @@
<ol><li><p>Let <var title="">candidate section</var> be <var title="">current section</var>.</li>
- <li><p>If the element being entered has a <a href=#rank>rank</a>
- lower than the <a href=#rank>rank</a> of the heading of the <var title="">candidate section</var>, then create a new <a href=#concept-section title=concept-section>section</a>, and append it to <var title="">candidate section</var>. (This does not change which
+ <li><p><i>Heading loop</i>: If the element being entered has a
+ <a href=#rank>rank</a> lower than the <a href=#rank>rank</a> of the
+ heading of the <var title="">candidate section</var><!-- the
+ first time through, it won't be, but maybe on a subsequent pass
+ it is -->, then create a new <a href=#concept-section title=concept-section>section</a>, and append it to <var title="">candidate section</var>. (This does not change which
section is the last section in the outline.) Let <var title="">current section</var> be this new section. Let the
element being entered be the new heading for the <var title="">current section</var>. Abort these substeps.</p>
@@ -19259,7 +19272,7 @@
<li><p>Let <var title="">candidate section</var> be <var title="">new candidate section</var>.</li>
- <li><p>Return to step 2.</li>
+ <li><p>Return to the step labeled <i>heading loop</i>.</li>
</ol><p>Push the element being entered onto the stack. (This causes
the algorithm to skip any descendants of the element.)</p>
Modified: source
===================================================================
--- source 2012-08-10 00:01:59 UTC (rev 7240)
+++ source 2012-08-10 03:05:51 UTC (rev 7241)
@@ -20535,6 +20535,10 @@
<dd>
+ <p>If the <var title="">current section</var> has no heading,
+ create an implied heading and let that be the heading for the
+ <var title="">current section</var>.</p>
+
<p>Pop the top element from the stack, and let the <var
title="">current outlinee</var> be that element.</p>
@@ -20559,6 +20563,10 @@
<ol>
+ <li><p>If the <var title="">current section</var> has no
+ heading, create an implied heading and let that be the heading
+ for the <var title="">current section</var>.</p></li>
+
<li><p>Pop the top element from the stack, and let the <var
title="">current outlinee</var> be that element.</p></li>
@@ -20593,10 +20601,9 @@
at the root of the subtree for which an outline is being
generated.</p>
- <p>Let <var title="">current section</var> be the first <span
- title="concept-section">section</span> in the
- <span>outline</span> of the <var title="">current outlinee</var>
- element.</p>
+ <p>If the <var title="">current section</var> has no heading,
+ create an implied heading and let that be the heading for the
+ <var title="">current section</var>.</p>
<p>Skip to the next step in the overall set of steps. (The walk
is over.)</p>
@@ -20615,7 +20622,9 @@
<p>Otherwise, if the element being entered has a
<span>rank</span> equal to or greater than the heading of the
last section of the <span>outline</span> of the <var
- title="">current outlinee</var>, then create a new <span
+ title="">current outlinee</var>, or if the heading of the last
+ section of the <span>outline</span> of the <var title="">current
+ outlinee</var> is an implied heading, then create a new <span
title="concept-section">section</span> and append it to the
<span>outline</span> of the <var title="">current outlinee</var>
element, so that this new section is the new last section of
@@ -20630,9 +20639,11 @@
<li><p>Let <var title="">candidate section</var> be <var
title="">current section</var>.</p></li>
- <li><p>If the element being entered has a <span>rank</span>
- lower than the <span>rank</span> of the heading of the <var
- title="">candidate section</var>, then create a new <span
+ <li><p><i>Heading loop</i>: If the element being entered has a
+ <span>rank</span> lower than the <span>rank</span> of the
+ heading of the <var title="">candidate section</var><!-- the
+ first time through, it won't be, but maybe on a subsequent pass
+ it is -->, then create a new <span
title="concept-section">section</span>, and append it to <var
title="">candidate section</var>. (This does not change which
section is the last section in the outline.) Let <var
@@ -20648,7 +20659,7 @@
<li><p>Let <var title="">candidate section</var> be <var
title="">new candidate section</var>.</p></li>
- <li><p>Return to step 2.</p></li>
+ <li><p>Return to the step labeled <i>heading loop</i>.</p></li>
</ol>
More information about the Commit-Watchers
mailing list