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 Monday, 19 March 2018 18:57:05 UTC