Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace current outline algorithm with one based on heading levels #7829

Merged
merged 45 commits into from
Jul 1, 2022
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
1065688
removed outline algorithm
stevefaulkner Apr 17, 2022
f86c397
clarify allowed content of hgroup
stevefaulkner Apr 17, 2022
e96100f
updated headings and sections
stevefaulkner Apr 18, 2022
7ffe0bd
removed sectioning root concept
stevefaulkner Apr 18, 2022
6b5cc4c
fixed conflict
stevefaulkner Apr 19, 2022
0d2fa7b
another fix?
stevefaulkner Apr 19, 2022
3d23dab
added return h1
stevefaulkner Apr 19, 2022
88bc37a
Fix build errors
sideshowbarker Apr 20, 2022
f5f3917
Fix markup error caught by HTML checker
sideshowbarker Apr 20, 2022
d7a8d50
Revert markup change that added p element in hgroup
sideshowbarker Apr 20, 2022
5b3e474
several clarifications
stevefaulkner Apr 21, 2022
09e8490
fix linting errors
stevefaulkner Apr 21, 2022
0327b04
Merge branch 'whatwg:main' into outline-reality-reset
stevefaulkner Apr 21, 2022
71cd1d1
remove rank in reference to headings
stevefaulkner Apr 21, 2022
cce4797
WIP Some updates based on code review
stevefaulkner Apr 27, 2022
4b5a5d3
fix linting error
stevefaulkner Apr 27, 2022
91f864c
remove mention of CSS sticky
stevefaulkner Apr 27, 2022
7ac1373
restored hr note
stevefaulkner Apr 27, 2022
0fbbc0d
removed Generic
stevefaulkner Apr 27, 2022
817c59a
replace document headings with outline
stevefaulkner Apr 27, 2022
b2207d3
fix lint error
stevefaulkner Apr 27, 2022
03d27be
added back heading content category
stevefaulkner Apr 27, 2022
b595cbd
Zap trailing whitespace (unbreak CI)
sideshowbarker Apr 28, 2022
5f7ae31
update hgroup content model
stevefaulkner Apr 28, 2022
0c07285
replaced important term
stevefaulkner May 2, 2022
e841164
Minor editorial fixes
domenic May 3, 2022
5543e9c
updated example and svg
stevefaulkner May 4, 2022
0096441
reworked hgroup definition
stevefaulkner May 5, 2022
efbe168
added back header clarification
stevefaulkner May 5, 2022
8c1cb5e
add example
stevefaulkner May 5, 2022
2242b9d
added example
stevefaulkner May 5, 2022
2d0b9bb
removed trailing whitespace
stevefaulkner May 5, 2022
5754ddd
Merge branch 'main' into outline-reality-reset
stevefaulkner May 8, 2022
045cf00
various updates
stevefaulkner May 8, 2022
d07cf54
lint fix
stevefaulkner May 8, 2022
ea5492b
typo fix
stevefaulkner May 8, 2022
559d70b
removed note
stevefaulkner May 8, 2022
052efb0
Minor fixes
domenic Jun 22, 2022
becd7b3
Attempt to fix remaining review comments
domenic Jun 23, 2022
a1b9930
This link no longer seems relevant
domenic Jun 23, 2022
9014ace
Updates from zcorpan's review
domenic Jun 29, 2022
71928c0
Remove "sectioning root" again
domenic Jun 29, 2022
de7ac7b
Add back "Exposing outlines to users"; various example tweaks
domenic Jun 29, 2022
a7004a9
Fix extra "ancestor"
domenic Jun 29, 2022
dd81361
Add missing "None" for td category
domenic Jul 1, 2022
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed sectioning root concept
general clean up and closer alignment with @annevk PR #3499
  • Loading branch information
stevefaulkner committed Apr 18, 2022
commit 7ffe0bdf242e4ff743887ab7de40b4506ab0d340
73 changes: 21 additions & 52 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -2084,6 +2084,10 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<p>Applications and tools that process HTML and XML documents for reasons other than to either
render the documents or check them for conformance should act in accordance with the semantics
of the documents that they process.</p>

<p class="example">A tool that generates document outlines but increases the nesting level for
each paragraph and does not increase the nesting level for <span
data-x="concept-heading">headings</span> would not be conforming.</p>
</dd>


Expand Down Expand Up @@ -11159,17 +11163,12 @@ console.assert(image.height === 200);</code></pre>
<li><code>section</code></li>
</ul>

<p>Each <span>sectioning content</span> element potentially has a heading and an
<span>outline</span>. See the section on <span>headings and sections</span> for further
details.</p>

<p class="note">There are also certain elements that are <span data-x="sectioning root">sectioning
roots</span>. These are distinct from <span>sectioning content</span>.</p>
<p>See the section on <span>headings and sections</span> for further details.</p>


<h6>Heading content</h6>

<p><dfn export>Heading content</dfn> defines the header of a section (whether explicitly marked
<p><dfn export>Heading content</dfn> defines the heading of a section (whether explicitly marked
up using <span>sectioning content</span> elements, or implied by the heading content itself).</p>

<!-- when updating this also update the category index -->
Expand Down Expand Up @@ -16248,7 +16247,7 @@ console.log(style.disabled); // false</code></pre>

<dl class="element">
<dt><span data-x="concept-element-categories">Categories</span>:</dt>
<dd><span>Sectioning root</span>.</dd>
<dd>None.</dd>
<dt><span data-x="concept-element-contexts">Contexts in which this element can be used</span>:</dt>
<dd>As the second element in an <code>html</code> element.</dd>
<dt><span data-x="concept-element-content-model">Content model</span>:</dt>
Expand Down Expand Up @@ -17127,7 +17126,7 @@ interface <dfn interface>HTMLHeadingElement</dfn> : <span>HTMLElement</span> {
<dd><span>Global attributes</span></dd>
<dt><span
data-x="concept-element-accessibility-considerations">Accessibility considerations</span>:</dt>
<dd>If the nearest ancestor <span>sectioning content</span> or <span>sectioning root</span>
<dd>If the nearest ancestor <span>sectioning content</span>
element is <span>the body element</span>: <a
domenic marked this conversation as resolved.
Show resolved Hide resolved
href="https://w3c.github.io/html-aria/#el-header">for authors</a>; <a
href="https://w3c.github.io/html-aam/#el-header-ancestorbody">for implementers</a>.</dd>
Expand Down Expand Up @@ -17181,8 +17180,7 @@ interface <dfn interface>HTMLHeadingElement</dfn> : <span>HTMLElement</span> {
<p>In this example, the page has a page heading given by the <code>h1</code> element, and two
subsections whose headings are given by <code>h2</code> elements. The content after the
<code>header</code> element is still part of the last subsection started in the
<code>header</code> element, because the <code>header</code> element doesn't take part in the
<span>outline</span> algorithm.</p>
<code>header</code> element.</p>

<pre><code class="html">&lt;body>
&lt;header>
Expand Down Expand Up @@ -17223,7 +17221,7 @@ interface <dfn interface>HTMLHeadingElement</dfn> : <span>HTMLElement</span> {
<dd><span>Global attributes</span></dd>
<dt><span
data-x="concept-element-accessibility-considerations">Accessibility considerations</span>:</dt>
<dd>If the nearest ancestor <span>sectioning content</span> or <span>sectioning root</span>
<dd>If the nearest ancestor <span>sectioning content</span>
element is <span>the body element</span>: <a
href="https://w3c.github.io/html-aria/#el-footer">for authors</a>; <a
href="https://w3c.github.io/html-aam/#el-footer-ancestorbody">for implementers</a>.</dd>
Expand All @@ -17235,7 +17233,7 @@ interface <dfn interface>HTMLHeadingElement</dfn> : <span>HTMLElement</span> {
</dl>

<p>The <code>footer</code> element <span>represents</span> a footer for its nearest ancestor
<span>sectioning content</span> or <span>sectioning root</span> element. A footer typically
<span>sectioning content</span> element. A footer typically
contains information about its section such as who wrote it, links to related documents, copyright
data, and the like.</p>

Expand All @@ -17253,7 +17251,7 @@ interface <dfn interface>HTMLHeadingElement</dfn> : <span>HTMLElement</span> {
<p>Footers don't necessarily have to appear at the <em>end</em> of a section, though they usually
do.</p>

<p>When the nearest ancestor <span>sectioning content</span> or <span>sectioning root</span>
<p>When the nearest ancestor <span>sectioning content</span>
element is <span>the body element</span>, then it applies to the whole page.</p>

<p class="note">The <code>footer</code> element is not <span>sectioning content</span>; it doesn't
Expand Down Expand Up @@ -17794,7 +17792,7 @@ interface <dfn interface>HTMLHeadingElement</dfn> : <span>HTMLElement</span> {

<tr>
<td rowspan=2><code>h1</code>&ndash;<code>h6</code>
<td>A section heading
<td>A heading
<tr>
<td><pre class="example"><code class="html"><strong>&lt;h1></strong>The Guide To Music On The Playa<strong>&lt;/h1></strong>
<strong>&lt;h2></strong>The Main Stage<strong>&lt;/h2></strong>
Expand All @@ -17808,19 +17806,19 @@ interface <dfn interface>HTMLHeadingElement</dfn> : <span>HTMLElement</span> {
<tr>
<td><pre class="example"><code class="html"><strong>&lt;hgroup></strong>
&lt;h1>Burning Music&lt;/h1>
&lt;h2>The Guide To Music On The Playa&lt;/h2>
&lt;p>The Guide To Music On The Playa&lt;/p>
<strong>&lt;/hgroup></strong>
&lt;section>
<strong>&lt;hgroup></strong>
&lt;h1>Main Stage&lt;/h1>
&lt;h2>The Fiction Of A Music Festival&lt;/h2>
&lt;p>The Fiction Of A Music Festival&lt;/p>
<strong>&lt;/hgroup></strong>
&lt;p>If you want to play on a stage, you <!--non-normative-->should bring one.&lt;/p>
&lt;/section>
&lt;section>
<strong>&lt;hgroup></strong>
&lt;h1>Loudness!&lt;/h1>
&lt;h2>Questions About Amplified Music&lt;/h2>
&lt;p>Questions About Amplified Music&lt;/p>
<strong>&lt;/hgroup></strong>
&lt;p>Amplifiers up to 300W or 90dB are welcome.&lt;/p>
&lt;/section></code></pre>
Expand Down Expand Up @@ -18129,10 +18127,6 @@ of Gralmond's winters.&lt;/p></code></pre>

</div>

<p class="note">The <code>hr</code> element does not affect the document's
<span>outline</span>.</p>


<h4>The <dfn element><code>pre</code></dfn> element</h4>

<dl class="element">
Expand Down Expand Up @@ -18257,7 +18251,6 @@ a friend lost to the
<dl class="element">
<dt><span data-x="concept-element-categories">Categories</span>:</dt>
<dd><span>Flow content</span>.</dd>
<dd><span>Sectioning root</span>.</dd>
<dd><span>Palpable content</span>.</dd>
<dt><span data-x="concept-element-contexts">Contexts in which this element can be used</span>:</dt>
<dd>Where <span>flow content</span> is expected.</dd>
Expand Down Expand Up @@ -19316,7 +19309,6 @@ first matching case):&lt;/p&gt;
<dl class="element">
<dt><span data-x="concept-element-categories">Categories</span>:</dt>
<dd><span>Flow content</span>.</dd>
<dd><span>Sectioning root</span>.</dd>
<dd><span>Palpable content</span>.</dd>
<dt><span data-x="concept-element-contexts">Contexts in which this element can be used</span>:</dt>
<dd>Where <span>flow content</span> is expected.</dd>
Expand Down Expand Up @@ -41293,7 +41285,6 @@ interface <dfn interface>HTMLTableRowElement</dfn> : <span>HTMLElement</span> {

<dl class="element">
<dt><span data-x="concept-element-categories">Categories</span>:</dt>
<dd><span>Sectioning root</span>.</dd>
<dt><span data-x="concept-element-contexts">Contexts in which this element can be used</span>:</dt>
<dd>As a child of a <code>tr</code> element.</dd>
<dt><span data-x="concept-element-content-model">Content model</span>:</dt>
Expand Down Expand Up @@ -52975,7 +52966,6 @@ out of 233&#x2009;257&#x2009;824 bytes available&lt;/meter>&lt;/p></code></pre>
<dl class="element">
<dt><span data-x="concept-element-categories">Categories</span>:</dt>
<dd><span>Flow content</span>.</dd>
<dd><span>Sectioning root</span>.</dd>
<dd><span data-x="category-listed">Listed</span> and <span data-x="category-autocapitalize">autocapitalize-inheriting</span> <span>form-associated element</span>.</dd>
<dd><span>Palpable content</span>.</dd>
<dt><span data-x="concept-element-contexts">Contexts in which this element can be used</span>:</dt>
Expand Down Expand Up @@ -57719,7 +57709,6 @@ dictionary <dfn dictionary>FormDataEventInit</dfn> : <span>EventInit</span> {
<dl class="element">
<dt><span data-x="concept-element-categories">Categories</span>:</dt>
<dd><span>Flow content</span>.</dd>
<dd><span>Sectioning root</span>.</dd>
<dd><span>Interactive content</span>.</dd>
<dd><span>Palpable content</span>.</dd>
<dt><span data-x="concept-element-contexts">Contexts in which this element can be used</span>:</dt>
Expand Down Expand Up @@ -58246,7 +58235,6 @@ interface <dfn interface>HTMLDetailsElement</dfn> : <span>HTMLElement</span> {
<dl class="element">
<dt><span data-x="concept-element-categories">Categories</span>:</dt>
<dd><span>Flow content</span>.</dd>
<dd><span>Sectioning root</span>.</dd>
<dt><span data-x="concept-element-contexts">Contexts in which this element can be used</span>:</dt>
<dd>Where <span>flow content</span> is expected.</dd>
<dt><span data-x="concept-element-content-model">Content model</span>:</dt>
Expand Down Expand Up @@ -121896,7 +121884,6 @@ interface <dfn interface>External</dfn> {
<th><code>blockquote</code></th>
<td>A section quoted from another source</td>
<td><span data-x="Flow content">flow</span>;
<span data-x="Sectioning root">sectioning root</span>;
<span data-x="Palpable content">palpable</span></td>
<td><span data-x="Flow content">flow</span></td>
<td><span data-x="Flow content">flow</span></td>
Expand All @@ -121908,7 +121895,7 @@ interface <dfn interface>External</dfn> {
<tr>
<th><code>body</code></th>
<td>Document body</td>
<td><span data-x="Sectioning root">sectioning root</span></td>
<td>none</td>
<td><code>html</code></td>
<td><span data-x="Flow content">flow</span></td>
<td><span data-x="global attributes">globals</span>;
Expand Down Expand Up @@ -122095,7 +122082,6 @@ interface <dfn interface>External</dfn> {
<th><code>details</code></th>
<td>Disclosure control for hiding details</td>
<td><span data-x="Flow content">flow</span>;
<span data-x="Sectioning root">sectioning root</span>;
<span data-x="Interactive content">interactive</span>;
<span data-x="Palpable content">palpable</span></td>
<td><span data-x="Flow content">flow</span></td>
Expand All @@ -122121,8 +122107,7 @@ interface <dfn interface>External</dfn> {
<tr>
<th><code>dialog</code></th>
<td>Dialog box or window</td>
<td><span data-x="Flow content">flow</span>;
<span data-x="Sectioning root">sectioning root</span></td>
<td><span data-x="Flow content">flow</span>;</td>
<td><span data-x="Flow content">flow</span></td>
<td><span data-x="Flow content">flow</span></td>
<td><span data-x="global attributes">globals</span>;
Expand Down Expand Up @@ -122202,7 +122187,6 @@ interface <dfn interface>External</dfn> {
<th><code>fieldset</code></th>
<td>Group of form controls</td>
<td><span data-x="Flow content">flow</span>;
<span data-x="Sectioning root">sectioning root</span>;
<span data-x="category-listed">listed</span>;
<span data-x="Form-associated element">form-associated</span>;
<span data-x="Palpable content">palpable</span></td>
Expand Down Expand Up @@ -122230,7 +122214,6 @@ interface <dfn interface>External</dfn> {
<th><code>figure</code></th>
<td>Figure with optional caption</td>
<td><span data-x="Flow content">flow</span>;
<span data-x="Sectioning root">sectioning root</span>;
<span data-x="Palpable content">palpable</span></td>
<td><span data-x="Flow content">flow</span></td>
<td><code>figcaption</code>*;
Expand Down Expand Up @@ -122272,7 +122255,7 @@ interface <dfn interface>External</dfn> {

<tr>
<th><code>h1</code>, <code>h2</code>, <code>h3</code>, <code>h4</code>, <code>h5</code>, <code>h6</code></th>
<td>Section heading</td>
<td>Heading</td>
<td><span data-x="Flow content">flow</span>;
<span data-x="Heading content">heading</span>;
<span data-x="Palpable content">palpable</span></td>
Expand Down Expand Up @@ -122307,9 +122290,8 @@ interface <dfn interface>External</dfn> {

<tr>
<th><code>hgroup</code></th>
<td>heading group</td>
<td>Generic Heading container</td>
<td><span data-x="Flow content">flow</span>;
<span data-x="Heading content">heading</span>;
<span data-x="Palpable content">palpable</span></td>
<td>
<code>legend</code>;
Expand Down Expand Up @@ -123119,7 +123101,7 @@ interface <dfn interface>External</dfn> {
<tr>
<th><code>td</code></th>
<td>Table cell</td>
<td><span data-x="Sectioning root">sectioning root</span></td>
<td>none</td>
<td><code>tr</code></td>
<td><span data-x="Flow content">flow</span></td>
<td><span data-x="global attributes">globals</span>;
Expand Down Expand Up @@ -123606,19 +123588,6 @@ interface <dfn interface>External</dfn> {
<code>input</code> (if the <code data-x="attr-input-type">type</code> attribute is <em>not</em> in the <span data-x="attr-input-type-hidden">Hidden</span> state);
<code>video</code> (if the <code data-x="attr-media-controls">controls</code> attribute is present)

<tr>
<td> <span data-x="sectioning root">Sectioning roots</span>
<td>
<code>blockquote</code>;
<code>body</code>;
<code>details</code>;
<code>dialog</code>;
<code>fieldset</code>;
<code>figure</code>;
<code>td</code>
<td>
&mdash;

<tr>
<td> <span data-x="form-associated element">Form-associated elements</span>
<td>
Expand Down