w3c / wpub

W3C Web Publications
https://w3c.github.io/wpub/
Other
78 stars 19 forks source link

Other link-like elements allowed in the (HTML) TOC? #377

Closed iherman closed 5 years ago

iherman commented 5 years ago

The current HTML TOC model and algorithm restricts the actual "links" to content to the HTML <a> element. The question is whether it is worth and possible to expand it to:

  1. <img>
  2. <audio> and <video>
  3. <object>

(<object> may be important for SVG content; including SVG via the <img> element may restrict SVG.)

iherman commented 5 years ago

Extending the current structure to an <img> seems algorithmically straightforward. Not so for the others; these elements, though usable as simple links, also give the possibility to provide much richer possibilities via sub-elements (see the relevant HTML spec for details) which may be difficult to include into the algorithm. It would probably be necessary to "restrict" the usage of these element for the simple cases for the purpose of the TOC.

rdeltour commented 5 years ago

these elements, though usable as simple links

What do you mean?

Is there a real-life example of such a ToC, without these elements being wrapped in a elements in the first place?

iherman commented 5 years ago

@rdeltour

Is there a real-life example of such a ToC, without these elements being wrapped in a elements in the first place?

I do not know, I am just asking... If there is no real-life example then we can safely drop this. But it is worth asking...

rdeltour commented 5 years ago

OK 🙂 What I'm not sure I understand is how these elements (media elements, img, and object) would constitue a "link", more than any other flow content elements: are you thinking about interpreting these as links to the referenced media resources, e.g. in an audio book or comic book? If yes, then I think we should stick to HTML's semantics, with only a representing a link in the ToC.

We could, however, amend the algorithm to allow SVG links in an SVG-marked-up ToC?

iherman commented 5 years ago

Yes, I though of extracting links from these elements indeed.

iherman commented 5 years ago

All in all... @rdeltour made me realize that this was probably a stupid idea. I will close the issue, to avoid muddling the waters...

To use an SVG marked up TOC may be a nice idea if it is realistic. If so, it should be a separate issue, though.