Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule epub-type-has-matching-role for Epigraphs #234

Closed
wolfmatthewj opened this issue May 21, 2019 · 20 comments
Closed

Rule epub-type-has-matching-role for Epigraphs #234

wolfmatthewj opened this issue May 21, 2019 · 20 comments
Assignees
Milestone

Comments

@wolfmatthewj
Copy link

wolfmatthewj commented May 21, 2019

The following snippet brings up an epub-type-has-matching-role error from Ace:

section xmlns="http://www.w3.org/1999/xhtml" class="main-document-section" xmlns:epub="http://www.idpf.org/2007/ops" epub:type="epigraph" role="doc-chapter"

Up until we started using EPUBCheck 4.2.1 this week, I had been putting role="doc-epigraph" on these sections. But it looks like that role is supposed to go on blockquote only? Not sure if this is an Ace or an EPUBCheck error, to be honest.

@rdeltour
Copy link
Member

rdeltour commented Jul 5, 2019

Not sure if this is an Ace or an EPUBCheck error, to be honest.

It's more a spec issue, in fact.

Currently, doc-epigraph is not allowed on section elements, as per the ARIA in HTML specification, so EPUBCheck is correct in reporting that.

At the same time, Ace will report a "best practice" issue when an epub:type is used without its matching ARIA role (when there is one).

That said, whether doc-epigraph should be allowed on section elements is still open for debate by the Digital Publishing Working Group, and this situation might change in the future.

In the meantime, there are several options to work around this issue:

  • do not use the "epigraph" epub:type
  • use the "epigraph" epub:type on blockquote elements
  • use the "epigraph" epub:type on any semantically neutral element (like div), which would allow you to have a structure like the following:
<section>
  <div epub:type="epigraph" role="doc-epigraph"></div>
</section

@rdeltour
Copy link
Member

rdeltour commented Jul 5, 2019

I'm closing this issue as wontfix. We can reopen if/when the specs change. Feel free to keep commenting anyway!

@rdeltour rdeltour closed this as completed Jul 5, 2019
@wolfmatthewj
Copy link
Author

Thanks for the explanation, and the workarounds!

@laudrain
Copy link

Any news from the spec front ?

@rdeltour
Copy link
Member

Any news from the spec front ?

Not that I know… We need to work on this in the Publishing WG.

@laudrain
Copy link

laudrain commented Oct 1, 2019

@rdeltour you probably mean the EPUB3 CG?
The line epigraph in the role mapping table should allow for this role on HTML section tag.
@mattgarrish is it possible to update this mapping?

@rdeltour
Copy link
Member

rdeltour commented Oct 1, 2019

@rdeltour you probably mean the EPUB3 CG?

No, I meant the Publishing WG, as anything related to DPUB ARIA is supposed to happen there no?
But well, it's the same people in that case so I doubt it makes any difference 😁

@pkra
Copy link
Contributor

pkra commented Oct 1, 2019

@laudrain @laudrain since this is ARIA-in-HTML territory, you could also file an issue at https://github.com/w3c/html-aria/. For comparison, I recently filed w3c/html-aria#173 which is the same kind of issue (and received a positive response).

@mattgarrish
Copy link

There isn't any reason why it shouldn't be allowed on section. The ARIA mappings were done based on the examples in the spec, I believe, so we periodically encounter these kinds of issues where not all the uses are accounted for.

I can't make the changes, though. As @pkra has already said, you need to open an issue on that specification. It might be simplest just to comment on his issue that it also is used on section.

After that, you also need to get the validator updated. (Romain sometimes updates ace checking in advance, but we need the code base officially updated and that usually requires the mappings be corrected first.)

@pkra
Copy link
Contributor

pkra commented Oct 1, 2019

@mattgarrish a new issue is probably better since w3c/html-aria#173 is about role=doc-dedication on aside elements. I'll be happy to help pushing both items forward on the ARIA end.

@mattgarrish
Copy link

mattgarrish commented Oct 1, 2019

is about role=doc-dedication on aside elements

D'oh, my brain hasn't warmed up yet. For some reason I thought this was about dedication, too... :)

@laudrain
Copy link

laudrain commented Oct 1, 2019

This epigragh case is the only one line in the mapping where an epub:type value is mapped to a role value with no element allowed on.
It may be an oversight.

@pkra
Copy link
Contributor

pkra commented Oct 1, 2019

@laudrain that's not quite correct. Some elements have "any role", in particular blockquote (https://www.w3.org/TR/html-aria/#p-pre-blockquote) which is the example in DPUB ARIA (https://w3c.github.io/dpub-aria/#doc-epigraph).

@pkra
Copy link
Contributor

pkra commented Oct 1, 2019

I've filed w3c/html-aria#177

@laudrain
Copy link

@pkra I am refering to the document https://idpf.github.io/epub-guides/epub-aria-authoring/ where I see only one line where an epub:type value is mapped to a role value (ni-on empty and different from "No Role") and has an empty cell in column "Elements Allowed On". It is the line for epigraph.

I support @mattgarrish comment:

There isn't any reason why it shouldn't be allowed on section.

@laudrain
Copy link

And yes in https://w3c.github.io/dpub-aria/, doc-epigraph is said to-have:

Superclass Role: | section
https://w3c.github.io/dpub-aria/#doc-epigraph

So it may be that this was not reported to the mapping in https://idpf.github.io/epub-guides/epub-aria-authoring/ which BTW is uesed by Ace a s a reference.

@mattgarrish @rdeltour could this mapping be fixed and Ace also ?

@pkra
Copy link
Contributor

pkra commented Nov 19, 2019

w3c/html-aria#177 has been fixed.

@laudrain
Copy link

@pkra great, thanks !
Now I think that EPUB Type to ARIA Role Authoring Guide has to be changed, and after that Ace checks.

@rdeltour
Copy link
Member

I'm reopening this issue, so that we can fix it in the next Ace version.

@danielweck
Copy link
Member

Fixed in Axe and Ace:
daisy/axe-core#4
#314

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants