[whatwg] WA 1.0 - document outline suggestion

Ian Hickson ian at hixie.ch
Thu May 24 14:18:48 PDT 2007

On Wed, 16 Nov 2005, ROBO Design wrote:
> I see the WA 1.0 specification contains a great deal of prose describing 
> in minute detail how to build a conforming document outline, based on 
> sections and headings [1]. Very good.
> Why not also add in DOM: document.outline ? [...]
> I believe that there's an interest in document outlining since the 
> editor(s) of the specification dedicated part of their time in writing 
> 2.5.11. section [1]. This is why I believe necessary to benefit web 
> authors too.
> The use case of the above for authors: easy way of providing an accurate 
> table of contents to users, in page. They would no longer be required to 
> write advanced, prone to errors, scripts to generate the TOC based on 
> the algorithms described in the WA 1.0, nor they would be required to 
> write easy scripts that can be easily broken :).
> As a final conclusion: my suggestion as a whole may not be desired (at 
> first), but it's like drag and drop, like menus and more. Table of 
> contents are something you see very often. Each TOC has its own way 
> today. Defining the algorithm of document outlining is actually 
> something very good which tries to bring order. Having DOM manipulation 
> of the outline would encourage authors to use the more accurate way of 
> generating a TOC in page. I am also aware that parts of the suggestion 
> might be exaggerated (like .item(str) and .flat(N)).

Thanks for the idea.

I don't think a document outline DOM API is something that has a great 
deal of demand. It's also something that could be implemented in a 
JavaScript library or on the serverside. Generally speaking we want to 
keep the APIs in the spec to a minimum, limiting them to primitives that 
are useful for a broad range of purposes, rather than having many 
special-purpose APIs. So I haven't added the outline DOM idea to the spec.

The main reason for having this section is to enable scripts and user 
agents to create outlines in user interfaces without ambiguity about what 
is a section. This is an area that has historically been very much 
underdefined. We shall have to see, with implementation experience, 
whether this is useful or not, and what UA implementors will do with it.

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

More information about the whatwg mailing list