daisy / ace

Ace by DAISY, an Accessibility Checker for EPUB
MIT License
75 stars 22 forks source link

Overriden <body> element not flagged #344

Closed ThomasR128 closed 3 years ago

ThomasR128 commented 3 years ago

Related to https://github.com/daisy/ace/issues/214:

The EPUB Type to ARIA Role Authoring Guide says: “The body element has the implied role document, and no other roles can be defined on the element. Changing the role of the body element can affect the ability to read the content for users of assistive technologies.”

Ace 1.1.2 however does not flag a <body epub:type="bodymatter"> markup although “[…]this practice is both invalid and harmful with ARIA roles.”

danielweck commented 3 years ago

I believe the intent of the document your referenced was based on the assumption that epub:type ascribes a semantic role with similar usage to ARIA roles, but this is in fact not quite the case. In fact we patch Deque Axe to ensure that epub:type attributes are not used to resolve semantic roles. The DPUB ARIA mappings establish equivalency between different terms from one vocabulary space to the other, but this just means that good authoring practice consists in providing roles for screen readers, etc. whereas epub:type attributes are only meant to be consumed by reading systems. In that light, I think it is fine to have bodymatter on the body (plus, this seems quite a widespread authoring technique).

danielweck commented 3 years ago

Note that epub:type bodymatter has no equivalent role in DPUB ARIA mappings:

https://idpf.github.io/epub-guides/epub-aria-authoring/#sec-mappings

https://w3c.github.io/publ-cg/guides/aria-mapping.html#mapping-table

https://www.w3.org/TR/dpub-aam-1.0/#mapping_role_table

danielweck commented 3 years ago

Note that as bodymatter has no DPUB ARIA mapping, Ace does not report an error indicating a missing role attribute to match the epub:type semantics. Consequently, epub:type=bodymatter itself is safe on the body element, as this is only a hint to reading systems, not a strong semantic role used by assistive technologies. I am closing this issue, but feel free to continue the discussion and re-open if necessary.

ThomasR128 commented 3 years ago

@danielweck Thanks for clarifying, this was obviously a misunderstanding on my part (still new to this). I had read the "Do Not Override the body Element" statement much like a MUST NOT in a W3C spec. It might be helpful to rephrase this as "… with Aria roles like xyz" (those that’d wreak havoc) or "… except for …"

"Deque Axe" = Daisy Ace? (auto-correct doing its thing, I suppose…)

danielweck commented 3 years ago

"Deque Axe" = Daisy Ace?

Ah, DAISY Ace uses DeQue Axe internally to run the checks at the level of each individual XHTML publication document.

danielweck commented 3 years ago

this was obviously a misunderstanding on my part (still new to this).

The DPUB ARIA specifications are still evolving, so don't worry you are not alone being slightly confused about the current state of affairs ;)

https://w3c.github.io/dpub-aria/#changelog