w3c / epub-specs

Shared workspace for EPUB 3 specifications.
Other
306 stars 60 forks source link

Sample codes use roles on html body #2528

Closed Ship10 closed 1 year ago

Ship10 commented 1 year ago

Sample codes in EPUB Accessibility Techniques 1.1 Section 4.3.2 use roles on html body.

<html … >
   …
   <body
       role="doc-part">
      <h1>Part 1</h1>
   </body>
</html>

Should there be a section wrapper to apply roles? And I wonder if it is necessary to add another heading ahead of the section wrapper to get a conforming outline.

mattgarrish commented 1 year ago

It looks like the example dates to when we were still discussing epub:type for semantics.

It's not that it's not necessary to add a part wrapper as the lead-in text says, but that it's invalid because roles are not allowed on the body element (or only a couple are, and none from DPUB-ARIA).

I think we could end the section without showing the invalid example, or we could move the role to a wrapper section. I'd expect a publisher would opt to use aria-label rather than put in a visible heading, though.

mattgarrish commented 1 year ago

(Reminder to myself when I amend the document, but the section heading should say not to repeat roles. "Semantics" correlates to epub:type use.)