This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 7527 - Allow implementations to generate meaningful default, implied headings for some sections.
Summary: Allow implementations to generate meaningful default, implied headings for so...
Status: CLOSED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: All All
: P3 normal
Target Milestone: LC
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://whatwg.org/specs/web-apps/curr...
Whiteboard:
Keywords: NE
Depends on:
Blocks:
 
Reported: 2009-09-07 12:00 UTC by contributor
Modified: 2010-10-04 14:57 UTC (History)
5 users (show)

See Also:


Attachments

Description contributor 2009-09-07 12:00:06 UTC
Section: http://whatwg.org/specs/web-apps/current-work/#outlines

Comment:
Allow implementations to generate meaningful default, implied headings for some sections.

Posted from: 213.236.208.22
Comment 1 Lachlan Hunt 2009-09-07 12:10:19 UTC
See IRC discussion.

http://krijnhoetmer.nl/irc-logs/whatwg/20090906#l-236
Comment 2 Lachlan Hunt 2009-09-07 13:14:21 UTC
The current algorithm doesn't handle this case very intuitively:

<section>
  <p>Lots of introductory content...
  <section>
    <h1>Heading A</h1>
    <p>Now a subsection>
  </section>
  <h1>Heading B</h1>
  <p>And a new section
</section>


This currently generates an outline like:

+--Heading B
   |
   +--Heading A

This is unintuitive because the source order puts heading B after the section with heading A, so it doesn't make sense that Heading B is placed structurally above heading A.  This mismatch between source order and heading outline would be confusing in, for example, a generated table of contents.

Intuitively, the outline should look equivalent to that generated by this:

<section>
  <p>Lots of introductory content...
  <section>
    <h1>Heading A</h1>
    <p>Now a subsection>
  </section>
</section>
<section>
  <h1>Heading B</h1>
  <p>And a new section
</section>

Which results in the outline like this:


+--[Untitled Section]
|  |
|  +--Heading A
|
+--Heading B

To handle this case more effectively, the algorithm should be modified in the following way:

When entering a sectioning content element or a sectioning root element

--> If current outlinee is not null:
    * If current section does not have a heading, generate a default implied
      heading for the section.
      (e.g. "Navigation" for <nav>, "Article" for <article>, etc. [1])
    * push current outlinee onto the stack.

--> (leave the rest of these steps as is)

[1] The exact text for the default heading is not important. It should probably be based on factors like the user's native language or whatever language is supported by the tool, and be appropriate for the context in which it will be used.  Maybe it could even be based on the sectioning element's title attribute if it has one, or some other information available in the context.
Comment 3 contributor 2009-09-22 10:42:29 UTC
Checked in as WHATWG revision r3962.
Check-in comment: Update the outline algorithm to generate implicit headings, and to create a new section for headings that come after subsections that come before the first heading of their parent section.
http://html5.org/tools/web-apps-tracker?from=3961&to=3962