Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Accname discussion: What is the accessible name of the below #98

Closed
jnurthen opened this issue Feb 2, 2021 · 4 comments
Closed

Accname discussion: What is the accessible name of the below #98

jnurthen opened this issue Feb 2, 2021 · 4 comments

Comments

@jnurthen
Copy link
Member

jnurthen commented Feb 2, 2021

To facilitate discussion of https://lists.w3.org/Archives/Public/public-aria/2021Jan/0052.html it was decided to post into separate github issues. Please also see #97

What should the accessible name be for the button (#test)

<div id="p">
<button id="test" aria-labelledby="p" >Screen Text</button>
</div>

Please post your answer and reasoning - referencing the steps in the ACCNAME spec which result in your decision.

@joanmarie joanmarie transferred this issue from w3c/aria Feb 2, 2021
@JAWS-test
Copy link

JAWS-test commented Feb 3, 2021

Since aria-labelledby is not evaluated recursively, the second reference to the button uses its text contents instead of aria-labelledby (Step 2A, Step 2F).

Correctly do this: IE 11, Firefox and https://whatsock.github.io/w3c-alternative-text-computation/Editable%20Live%20Input%20AccName%20Test.html

Wrong: Chrome and Edge, where the button has no label.

There is no difference to <button id="p" aria-labelledby="p" >screen text</button>. And this also works correctly in Chrome and Edge.

A reference to itself is no problem according to the specification (see Example 2). Only a recursive reference to itself is forbidden

@cookiecrook
Copy link
Contributor

@JAWS-test wrote:

Correctly do this: IE 11, Firefox and https://whatsock.github.io/w3c-alternative-text-computation/Editable%20Live%20Input%20AccName%20Test.html

Wrong: Chrome and Edge, where the button has no label.

There is no difference to screen text. And this also works correctly in Chrome and Edge.

There is disagreement or ambiguity about what is "correct" so there's a case to be made that each is right or wrong.

Please focus the discussion on what the algorithm should do, regardless of what the browsers currently do.

@JAWS-test
Copy link

JAWS-test commented Feb 5, 2021

@cookiecrook

Please focus the discussion on what the algorithm should do, regardless of what the browsers currently do

I did. In the first paragraph I wrote: Step 2A, Step 2F

A bit more specific would be:

  • Step 1: current node = button
  • Step 2B: use aria-labelledby, current node = div
  • Step 2F: Get the name of the div and its child elements
  • current node = button, ignore the aria-labelledby at the button this time
    • due to the prohibition of recursion ("Each node in the subtree is consulted only once. If text has been collected from a descendant, but is referenced by another IDREF in some descendant node, then that second, or subsequent, reference is not followed. This is done to avoid infinite loops") AND
    • due to the prohibition of multiple following of aria-labelledby references (see Example 1)
  • Step 2F: Get the text content of the button

@joanmarie
Copy link
Contributor

Answer: "Screen Text"

Step 1
root node = button (test)
current node = button (test)

Step 2: Compute text for current node button (test)
Step 2B applies: computing a name and current node (test) has aria-labelledby
For each IDREF, return to step 2 and append its text alternative. Then return the result.

Processing IDREF p:
Step 2F applies: the current node (p) is referenced by aria-labelledby
For each child of current node (p) return to step 2 and append its text alternative. Then return the result.

Processing child node test:
This time 2B does not apply: it IS already part of an aria-labelledby traversal
2F applies: The current node's role allows name from content.
Child result: "Screen Text"

IDREFs result: "Screen Text"

@w3c w3c locked and limited conversation to collaborators Feb 16, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants