RE: Another AccName sanity check: presentational role and name computation

Hi,
In reading this, and comparing it with the spec text, I still think my interpretation is correct.

For example, the relevant node that includes aria-label="Eli" is specifically this one:

<span role="presentation" aria-label="Eli">

So this is the only node that it applies to, because role=presentation or none only apply to that node and not to any of its children.

So if I change this to expose aria-label regardless of the presentational role, it will also expose the following node in the same way:

<img role="presentation" aria-label="Eli">

And the same for 

<img role="presentation" alt="Eli">

Is this what you expect?

Thanks,
Bryan

Bryan Garaventa
Accessibility Fellow
Level Access, Inc.
Bryan.Garaventa@LevelAccess.com
415.624.2709 (o)
www.LevelAccess.com

-----Original Message-----
From: Joanmarie Diggs <jdiggs@igalia.com> 
Sent: Monday, March 19, 2018 11:56 AM
To: Bryan Garaventa <bryan.garaventa@levelaccess.com>
Cc: ARIA Working Group <public-aria@w3.org>
Subject: Another AccName sanity check: presentational role and name computation

Hey again Bryan and others interested in AccName.

I'm now working on the test cases where the expected result includes "Garaventa the weird." Both Firefox and WebKit have results which include "Eli" instead of "Garaventa." Looking at the AccName algorithm, I think Firefox and WebKit are correct.

Searching the algorithm, I see only one mention of the presentational role, namely in step 2D, which states:

<quote>
Otherwise, if the current node's native markup provides an attribute (e.g. title) or element (e.g. HTML label) that defines a text alternative, return that alternative in the form of a flat string as defined by the host language, unless the element is marked as presentational (role="presentation" or role="none").

Comment:
For example, in HTML, the img element's alt attribute defines a text alternative string, and the label element provides text for the referenced form element. In SVG2, the desc and title elements provide a description of their parent element.
</quote>

Looking at your test case, the markup relevant to which name is chosen is this bit:

    <span role="presentation" aria-label="Eli">
      <span aria-label="Garaventa">Zambino</span>
    </span>

While the presentational role is applied to the outer span, my understanding of an attribute provided by the node's native markup is something specific to HTML. The aria-label attribute can be used on HTML of course; but the aria-label attribute is not *provided by* HTML. So my read of step 2D is that technically "Eli" should be chosen.

Furthermore, in the case where the thing being calculated is a name, I don't think we'd get to step 2D because step 2C states:

<quote>
Otherwise, if computing a name, and if the current node has an aria-label attribute whose value is not the empty string, nor, when trimmed of white space, is not the empty string:

* If traversal of the current node is due to recursion and the current
  node is an embedded control as defined in step 2E, ignore aria-label
  and skip to rule 2E.

* Otherwise, return the value of aria-label.
</quote>

Step 2C doesn't say anything about the presentational role. And the current node is not an embedded control as defined in step 2E. So why don't we want to use the aria-label value of "Eli"?

If I'm missing something please explain. Thanks in advance for your help with this!!

--joanie

Received on Tuesday, 27 March 2018 17:48:26 UTC