Re: element.createOutline vs <outline> or <toc> [was: adding a note to 4.3.10.1 Creating an outline]

On Fri, Feb 28, 2014 at 12:00 PM, Michael[tm] Smith <mike@w3.org> wrote:
> Hi Silvia,
>
> Silvia Pfeiffer <silviapfeiffer1@gmail.com>, 2014-02-27 22:07 +1100:
>
>> Was it ever discussed to introduce an actual <outline> element (or
>> maybe more appropriately a <toc> element)?
>
> It wasn't as far as I remember.
>
> It's not clear to me exactly what the generated content of such an element
> would end up being. An <ol>? Or a <ul>? Or what? How would Web authors be
> able to style it? (Would the contents be a shadow DOM or.. what?)

It's no different to other composite elements with a shadow DOM. All
the <ol>, <ul> etc would be inside the control. It would be stylable
like other shadow dom objects (once we've figured that out).


> And what precedents do we have for an element like <outline> or <toc>?
> (that is, one that would inject some text content into one part of a
> document by constructing it from some other parts of the  document)

Wikipedia (in fact: mediawiki more generally) is a cow path IMO. See
e.g. http://en.wikipedia.org/wiki/2014_Winter_Olympics .
The "Contents" section is not a section created by the Web page
developer, but auto-created (in this case: by the CMS).
__TOC__ is the markup used in mediawiki.

I don't think we currently have elements like this, but we also didn't
have videos and their video controls.
I think, though, that we have plenty of examples of sites using this
feature. And seeing that we already have the content for it from the
outline algorithm, it should be fairly logical how to build it
(including hyperlinks to page offsets to the outline elements if they
have an id tag).


> So I think rather than an element it would be a lot clearer and easier to
> just start out by adding an element.createOutline method that simply
> constructs an Outline object and returns it. Web authors could then take
> that object and do whatever they want with it as far a markup and styling
> and putting something back into the DOM.

I think there's a use case for both actually.


> I think Web authors would still want such a thing even if we were ever to
> also provide an <outline> or <toc> element.

Agreed.

Silvia.

Received on Friday, 28 February 2014 01:38:55 UTC