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

Unique role rule fires when aria-labelledby points to unique elements. #303

Closed
seanharrison opened this issue Jan 9, 2020 · 6 comments
Closed

Comments

@seanharrison
Copy link

Please provide the following details if possible or relevant:

  • [1.1.1] the version of Ace impacted by the issue (as returned by the ace -v command).
  • [10.5.2] the version of Node used to run Ace (as returned by the node -v command).
  • [Debian 10] your operating system and version.
  • [] if the issue is a bug when running Ace: the error message as produced in the log file (you can enable debug logging with the --verbose option).
  • [] if the issue is about the HTML report: the browser(s) and version(s) you used.
  • [] if possible, let us know if you can share a sample input file to help us reproduce the issue.

Here is a snippet from the error output in the JSON report:

        {
          "@type": "earl:assertion",
          "earl:result": {
            "earl:outcome": "fail",
            "dct:description": "The landmark must have a unique aria-label, aria-labelledby, or title to make landmarks distinguishable",
            "earl:pointer": {
              "cfi": [
                "/4/2[ch66_sec_001]/60[ch66_sec_002]",
                "/4/2[ch66_sec_001]/70[ch66_sec_003]",
                "/4/2[ch66_sec_001]/94[ch66_sec_004]"
              ],
              "css": [
                "#ch66_sec_002",
                "#ch66_sec_003",
                "#ch66_sec_004"
              ]
            },
            "html": "<aside xmlns=\"http://www.w3.org/1999/xhtml\" id=\"ch66_sec_002\" class=\"tip\" aria-labelledby=\"ch66_h1_002\" role=\"complementary\"> <!--##--> <aside xmlns=\"http://www.w3.org/1999/xhtml\" id=\"ch66_sec_003\" class=\"tip\" aria-labelledby=\"ch66_h1_003\" role=\"complementary\"> <!--##--> <aside xmlns=\"http://www.w3.org/1999/xhtml\" id=\"ch66_sec_004\" class=\"tip\" aria-labelledby=\"ch66_h1_004\" role=\"complementary\">"
          },
          "earl:assertedBy": "aXe",
          "earl:mode": "automatic",
          "earl:test": {
            "earl:impact": "moderate",
            "dct:title": "landmark-unique",
            "dct:description": "Landmarks must have a unique role or role/label/title (i.e. accessible name) combination",
            "help": {
              "url": "http://kb.daisy.org/publishing/",
              "dct:title": "(no specific entry)",
              "dct:description": "Ensures landmarks are unique"
            },
            "rulesetTags": [
              "cat.semantics",
              "best-practice"
            ]
          }
        }

However:

  • all of the elements in the EPUB that have role="complementary" have an aria-labelledby attribute
  • all of these aria-labelledby attributes point to different elements
  • the text of all of the aria-labelledby elements is unique
  • I have verified all of this programmatically.

I conclude that DAISY Ace is erroneously raising this issue; perhaps it isn't processing the aria-labelledby attributes as though it were a title or aria-label?

@rdeltour
Copy link
Member

rdeltour commented Jan 9, 2020

Thanks for the report, and the thorough inspection of your content! Would it be possible to share an EPUB to help us reproduce the error?

@arthompson-koganpage
Copy link

EPUB and DAISY Ace report: https://koganpage.box.com/s/q9gif8e4r2cov8odssmqg8q909a35gb8.

@danielweck
Copy link
Member

Thank you for sharing the EPUB!
I ran the a11y evaluation with the latest version of Ace shipped in Ace App (v1.2.0-beta.6).
(NPM https://www.npmjs.com/package/@daisy/ace/v/1.2.0-beta.6 built from PR #236 )

I am getting the same report:

        {
          "@type": "earl:assertion",
          "earl:result": {
            "earl:outcome": "fail",
            "dct:description": "The landmark must have a unique aria-label, aria-labelledby, or title to make landmarks distinguishable",
            "earl:pointer": {
              "cfi": [
                "/4/2[ch66_sec_001]/60[ch66_sec_002]",
                "/4/2[ch66_sec_001]/70[ch66_sec_003]",
                "/4/2[ch66_sec_001]/94[ch66_sec_004]"
              ],
              "css": [
                "#ch66_sec_002",
                "#ch66_sec_003",
                "#ch66_sec_004"
              ]
            },
            "html": "<aside xmlns=\"http://www.w3.org/1999/xhtml\" id=\"ch66_sec_002\" class=\"tip\" aria-labelledby=\"ch66_h1_002\" role=\"complementary\"> <!--##--> <aside xmlns=\"http://www.w3.org/1999/xhtml\" id=\"ch66_sec_003\" class=\"tip\" aria-labelledby=\"ch66_h1_003\" role=\"complementary\"> <!--##--> <aside xmlns=\"http://www.w3.org/1999/xhtml\" id=\"ch66_sec_004\" class=\"tip\" aria-labelledby=\"ch66_h1_004\" role=\"complementary\">"
          },
          "earl:assertedBy": "aXe",
          "earl:mode": "automatic",
          "earl:test": {
            "earl:impact": "moderate",
            "dct:title": "landmark-unique",
            "dct:description": "Landmarks must have a unique role or role/label/title (i.e. accessible name) combination",
            "help": {
              "url": "http://kb.daisy.org/publishing/docs/script/aria.html",
              "dct:title": "ARIA",
              "dct:description": "Ensures landmarks are unique"
            },
            "rulesetTags": [
              "cat.semantics",
              "best-practice"
            ]
          }
        }

@rdeltour
Copy link
Member

rdeltour commented Jan 9, 2020

I reviewed the EPUB, and I don’t think the report is erroneous.

The uniqueness rule applies to the landmarks’ accessible name. In other words, it’s not the labelling element that should be unique, but its content. The idea is that a screen reader can expose a list of landmark titles to the user, for quick navigation. If all these titles are identical, the user doesn’t know where to navigate.

In the shared EPUB, many landmarks end up having the same accessible name. For instance, in 11_chapter01.xhtml line 16:

<aside id="ch01_sec_003" class="tip" aria-labelledby="ch01_h1_003" role="complementary">
<p id="ch01_h1_003" class="title" epub:type="title">Words of wisdom</p>

and line 29:

<aside id="ch01_sec_005" class="tip" aria-labelledby="ch01_h1_005" role="complementary">
<p id="ch01_h1_005" class="title" epub:type="title">Words of wisdom</p>

Even if both aside elements are labelled by different elements, the resulting accessible name is the same, "Words of wisdom", which wouldn’t differentiate them in a navigation by landmarks.

Possible solutions can be:

  • ignore this rule altogether, it is after all a "best practice" and is not strictly required to meet accessibility standards.
  • instead of an aria-labelledby attribute, you could set a differentiating accessible name with an aria-label attribute.
  • you could prepend some kind of differentiating screen-reader-only content to the aside labels, which would be exposed to screen readers but hidden to visual users.

Note that from a recent screen reader usage survey by WebAIM, even though under 3% of users prefer landmarks-based navigation to headings-based navigation, some 26% of screen reader users do navigate by landmarks often when they're available, and 56% sometimes. This survey is primarily about the Web, so I don’t know to which extent it can be extrapolated to ebooks, but still. For this reason, I wouldn't particularly recommend the first option (even if it might meet some level of WCAG conformance, it's not the most accessible).

@seanharrison
Copy link
Author

My apologies for the false alarm — you are right, the aria-labelledby text for the landmarks is not unique in our EPUB. I thought it was when I posted the issue, but I hadn't checked carefully enough.

@rdeltour
Copy link
Member

rdeltour commented Jan 9, 2020

My apologies for the false alarm

No problem, you're welcome :-)

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

4 participants