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 13880 - Something has to be fixed in the outline algorithm. It works fine if the root is a sectioning (root/content) element, although steps 5 and 6 are vacuous in this case. If on the other hand the root is an arbitrary element, this algorithm only produces an o
Summary: Something has to be fixed in the outline algorithm. It works fine if the root...
Status: RESOLVED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-23 22:34 UTC by contributor
Modified: 2011-10-12 22:45 UTC (History)
6 users (show)

See Also:


Attachments

Description contributor 2011-08-23 22:34:18 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html
Multipage: http://www.whatwg.org/C#outlines
Complete: http://www.whatwg.org/c#outlines

Comment:
Something has to be fixed in the outline algorithm. It works fine if the root
is a sectioning (root/content) element, although steps 5 and 6 are vacuous in
this case. If on the other hand the root is an arbitrary element, this
algorithm only produces an outline for the first sectioning descendent and, in
step 6, associates all remaining nodes with the first section of that outline,
which doesn't make sense. I suggest the following modifications: 1) The part
in step 4 which says "The walk is over" should instead reset the
currentOutlinee and currentSection to null, and allow the walk to continue; 2)
remove steps 5, 6, and 8 completely (nodes that are not associated in step 4
simply do not belong to any section, e.g., a <head> element). That produces
the same result as the current algorithm if the root is a sectioning element,
but it also produces the expected result if root is an arbitary node (e.g. a
document). (Also, the DOM walk implementation suggested at the end is wrong if
the root has a nextSibling…)

Posted from: 98.220.236.126
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/534.48.3 (KHTML, like Gecko) Version/5.1 Safari/534.48.3
Comment 1 Ian 'Hixie' Hickson 2011-10-12 22:37:11 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Partially Accepted
Change Description: see diff given below
Rationale: Agreed that the algorithm needed cleaning up.
Comment 2 Ian 'Hixie' Hickson 2011-10-12 22:42:21 UTC
(The algorithm only applies to sectioning content or sectioning root elements, because you can't reliably construct an outline from elsewhere. Consider:

   <div id=a>
     <h3>...</h3>
     <div id=b>
       <h4>...</h4>
       <h3>...</h3>
     </div>
   </div>

Consider making an outline for id=a then for id=b. Notice how the results would be different, because when you lack the context of id=a, it looks like the <h4> and <h3> are at the same level, but in fact the h4 is one level deeper than the h3.
Comment 3 contributor 2011-10-12 22:45:26 UTC
Checked in as WHATWG revision r6677.
Check-in comment: Clarify the outline algorithm to indicate that it only applies to sectioning content and sectioning root elements.
http://html5.org/tools/web-apps-tracker?from=6676&to=6677