<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>13880</bug_id>
          
          <creation_ts>2011-08-23 22:34:18 +0000</creation_ts>
          <short_desc>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</short_desc>
          <delta_ts>2011-10-12 22:45:26 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#outlines</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>eoconnor</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>philipj</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>55742</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-08-23 22:34:18 +0000</bug_when>
    <thetext>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&apos;t make sense. I suggest the following modifications: 1) The part
in step 4 which says &quot;The walk is over&quot; 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 &lt;head&gt; 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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58159</commentid>
    <comment_count>1</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-12 22:37:11 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58160</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2011-10-12 22:42:21 +0000</bug_when>
    <thetext>(The algorithm only applies to sectioning content or sectioning root elements, because you can&apos;t reliably construct an outline from elsewhere. Consider:

   &lt;div id=a&gt;
     &lt;h3&gt;...&lt;/h3&gt;
     &lt;div id=b&gt;
       &lt;h4&gt;...&lt;/h4&gt;
       &lt;h3&gt;...&lt;/h3&gt;
     &lt;/div&gt;
   &lt;/div&gt;

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 &lt;h4&gt; and &lt;h3&gt; are at the same level, but in fact the h4 is one level deeper than the h3.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>58161</commentid>
    <comment_count>3</comment_count>
    <who name="">contributor</who>
    <bug_when>2011-10-12 22:45:26 +0000</bug_when>
    <thetext>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&amp;to=6677</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>