nlbdev / nordic-accessible-epub-guidelines

2 stars 2 forks source link

Sections without headings, should we handle them differently? #35

Closed AndersEkl closed 7 months ago

AndersEkl commented 1 year ago

Originally written by @josteinaj

The untitled sections needs a title in the navigation document. But I would prefer to not have the title of the untitled sections living only in the navigation document.

An alternative would be to use the hidden attirubute on a h1-h6 element:

<h3 hidden="">This headline is hidden</h3>

This would not render the headline visibly or for screen readers. The text would not be searchable. It should not have a id attribute, since it is not navigable. The parent section element will have a navigable id that is referenced from the navigation document.

This would also make it easy to generate a new navigation document based on the content, which can be useful in automated processes.

See also: https://github.com/nlbdev/epub3-guidelines-update/issues/71

Comment by @martinpub

Great input @josteinaj, didn't think about untitled sections. In 2020-1 we use aria-label to enter the name of untitled sections in the content documents, and a rule that it should match with the nav toc. Of course, using aria-label will also construct the section as a landmark, in the same way as aria-labelledby, so this is an issue.

For titled subsections that should not be landmarks, maybe we still need an explicit link between the section and the heading element?

For untitled sections, I'm not sure a hidden heading element will be enough for our accessibility production, but an upgrade could very well just turn it into a regular heading, in which way it will be the same technically as regular headings.

Let us return to this issue in the guidelines review work. (I hope to be able to give that some resources soon, but not entirely sure currently.)

Comment by @AndersEkl

The Knowledge base suggests simply using aria-label for sections without headings. Using hidden content seems to be discouraged.

I am in the process of transferring issues from this repo to the new one. I will transfer this one as well, so that we can conclude the discussion later on.

jonaslil commented 7 months ago

Looking at this issue. 2020-1 requires aria-labels for untitled sections and says that these labels should be used in the toc nav in the absence of a heading. The use of aria-labels for untitled sections is in line with the Daisy KB, so I suppose we don't want to change this. The new rule for constructing page titles also relies on the aria-label if no heading is present.

A script that (re-)generates the toc could make use of the aria-labels, and conversion scripts could turn them into regular headings if needed.

jonaslil commented 7 months ago

This is related to #62, which has been resolved.