Re: Outline algorithm

On Thu, 6 Mar 2008, James Graham wrote:
> 
> The section that starts
> 
> Otherwise, if the element being entered has a rank equal to or greater 
> than the heading of the current section, then create a new section and 
> append it to the outline of the current outlinee element
> 
> Doesn't seem to work well for documents like <h1><h2><h3><h2>; the last 
> <h2> becomes a sibling of the <h1> (which is the last section of the 
> current outline element).
>
> [...]
> 
> I'm also slightly confused about the next section down, which starts 
> "Otherwise, run these substeps". This seems to be invoked only if the 
> rank of the element is less than the rank of current section's heading, 
> so the step that starts "If the element being entered has a rank lower 
> than the rank of the heading of the candidate section" will always be 
> true on the first iteration.

Fixed. The first "otherwise" section was too aggressive, which, as you 
point out, prevented the second "otherwise" clause from affecting the 
bits it was supposed to.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Tuesday, 17 June 2008 22:44:08 UTC