W3C home > Mailing lists > Public > public-html@w3.org > March 2013

Re: <outline> element or element.createOutline() method [was: Validity constraints on <section>]

From: Silvia Pfeiffer <silviapfeiffer1@gmail.com>
Date: Fri, 22 Mar 2013 08:04:40 +1100
Message-ID: <CAHp8n2miKOGqHur2xy=uZ48=7mrivSKR70Pp7hc2yoViE235nQ@mail.gmail.com>
To: "Michael[tm] Smith" <mike@w3.org>
Cc: Robin Berjon <robin@w3.org>, public-html <public-html@w3.org>, Léonie Watson <tink@tink.co.uk>
On Fri, Mar 22, 2013 at 7:47 AM, Michael[tm] Smith <mike@w3.org> wrote:

> Silvia Pfeiffer <silviapfeiffer1@gmail.com>, 2013-03-22 07:36 +1100:
>
> > How about something more constructive such as an explicit <outline>
> element
> > that creates a table of contents through the outline algorithm.
>
> I think just adding a createOutline method would be better. It would return
> an Outline object that's a tree of Section objects. The developer could
> then choose what HTML they want to use to actually get the outline into the
> DOM (e.g., ul/li or ol/li or whatever).
>
> You could do document.document.element.createOutline() to get an Outline
> object for the whole document, or
> document.getElementById("foo").createOutline()
> (or with querySelector or whatever) to create an Outline object for some
> portion of a document (one use case being if you want to generate
> per-section or per-chapter TOCs in a long document).
>


We could do both. The <outline> element would create a shadow dom, but a
createOutline() method would just create the list of sections and leave
formatting to the developer. All of those limitations could also apply to
<outline> within a section.

Just brainstorming here - this needs properly thinking through. But it also
means that the outline algorithm suddenly becomes useful and is not just a
suggestion for how to create an outline from the DOM.

Silvia.
Received on Thursday, 21 March 2013 21:05:33 GMT

This archive was generated by hypermail 2.3.1 : Thursday, 21 March 2013 21:05:34 GMT