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

text elements not listed elsewhere allow name from subtree #282

Closed
asurkov opened this issue Feb 19, 2020 · 17 comments · Fixed by #283
Closed

text elements not listed elsewhere allow name from subtree #282

asurkov opened this issue Feb 19, 2020 · 17 comments · Fixed by #283

Comments

@asurkov
Copy link
Contributor

asurkov commented Feb 19, 2020

text elements not listed elsewhere like time, strong, etc allow name from subtree [1], these elements are often not exposed to the accessible tree as individual objects but if they are, they are not interactive and thus shouldn't be treated different from HTML:p (section and grouping content elements). Also the spec doesn't match Chrome/Firefox/Safari implementations.

If no objections, then I suggest to remove 'Otherwise use the text element's subtree.' from 5.17.1.

cc'ing @joanmarie, @aleventhal @cookiecrook @jcsteh

[1] https://w3c.github.io/html-aam/#text-level-elements-not-listed-elsewhere

@scottaohara
Copy link
Member

Seems that many of these elements should fall under #160 and should have naming prohibited.

While understood this doesn't match chrome/firefox/safari, removing the name from subtree step would then mean title would provide an accessible name for all these elements, and not a description, which also doesn't seem right.

@stevefaulkner
Copy link
Contributor

stevefaulkner commented Feb 20, 2020

We are talking about implementation behavior in regards to use of subtree in accname calculation: if the dominant/interoperable behaviour in implementations diverges from what is defined I suggest it be removed as @asurkov suggests. On @scottaohara's point title would still be a fallback accname in cases where no aria-label/labelledby provided, this is the case currently for some other elements, i don't see an issue with this. I am a little confused as the issue #160 cited, i thought is about author rules not browser implementations?

Anyway having a quick look at the behaviour (test case throws up questions):

Why is a span with an aria-label or title exposed differently in Windows Firefox and chrome/edge?
Firefox= iA2 text-frame Chrome/edge = iA2 section Are these 2 roles equivalent?

and then on Mac The accname exposure differs across browser (resulting in different VO announcements (no name for span with title):
chrome: group with accname from aria-label or title
Safari: 'group' with accname from aria-label, not from title

Labeling of span in both browsers means that when exposed as a group, the text is not announced until the user has navigated into the group, seems like a real PITA (Pain In The Ass) and makes it less usable. So we have divergent behaviour across OS/browser/AT 👎

@asurkov
Copy link
Contributor Author

asurkov commented Feb 20, 2020

Seems that many of these elements should fall under #160 and should have naming prohibited.

While understood this doesn't match chrome/firefox/safari, removing the name from subtree step would then mean title would provide an accessible name for all these elements, and not a description, which also doesn't seem right.

many of these elements indeed fall under #160 description, however I'm not sure whether that issue should be fixed at all. If author puts @title on an element having no semantics like HTML:span, then I suppose it's made on purpose - indeed it creates a tooltip on mouseover, so the user can interact with the element. Also it affects (or should affect) on accessible name, since the element may be considered interactive. As an example, Firefox creates an accessible object for such elements, while otherwise it wouldn't, i.e if any HTML element has title attribute on it then Firefox creates an accessible object and expose @title as accessible name.

Anyway, #160 is a different issue and can be (should be) handled separately. This issue will align the spec with implementations which is good :)

@asurkov
Copy link
Contributor Author

asurkov commented Feb 20, 2020

We are talking about implementation behavior in regards to use of subtree in accname calculation: if the dominant/interoperable behaviour in implementations diverges from what is defined I suggest it be removed as @asurkov suggests. On @scottaohara's point title would still be a fallback accname in cases where no aria-label/labelledby provided, this is the case currently for some other elements, i don't see an issue with this.

me neither, I suppose it's not different from AT perspective if author puts aria-label on these elements.

I am a little confused as the issue #160 cited, i thought is about author rules not browser implementations?

Anyway having a quick look at the behaviour (test case throws up questions):

Why is a span with an aria-label or title exposed differently in Windows Firefox and chrome/edge?
Firefox= iA2 text-frame Chrome/edge = iA2 section Are these 2 roles equivalent?

I bet they aren't. Not sure if HTML-aam spec covers this (if not then it should), but implementations should be aligned.

and then on Mac The accname exposure differs across browser (resulting in different VO announcements (no name for span with title):
chrome: group with accname from aria-label or title
Safari: 'group' with accname from aria-label, not from title

I don't recall NSAccessibility, but your findings suggest that title and aria-label exposed differently on mac. Not sure, but perhaps it has a reason? cc'ing @cookiecrook

@scottaohara
Copy link
Member

still not sure i agree that title should be used for accessible name for these elements when there's subtree content which is how these should typically be exposed. Also not sure how this jives with annotations work over in the ARIA spec.

See current working definition of aria-description that notes its related concept is the title attribute of the host language.

A place to start for annotations information (for those who may be unfamiliar) would be ARIA issue 1109.

If none of this matters in context of this issue, then I'll be happy to go muddle over other things :) but just figured it was worth pointing out regarding the annotation work / wondering if it'd be at all possible to just indicate these elements are represented by their subtree, and shouldn't be named instead. or is that too out there of an idea to be feasible?

@JAWS-test
Copy link

I don't understand the whole discussion, since I assume that Accname is the specification that governs all this. In HTML-AAM, only the results derived from Accname are described in an easily understandable way. That means that the chapter in HTML-AAM cannot be changed without changing Accname, unless both specifications contradict each other. If something is to be changed in Accname, it should be discussed there, right?

Apart from that, according to Accname, for all elements that are allowed to have a name, the name is always derived from the subtree (unless there is an aria-label, aria-labelledby, or other higher-level label). Only if there is no label the label can be determined from the title.

@asurkov
Copy link
Contributor Author

asurkov commented Feb 21, 2020

still not sure i agree that title should be used for accessible name for these elements when there's subtree content which is how these should typically be exposed. Also not sure how this jives with annotations work over in the ARIA spec.

See current working definition of aria-description that notes its related concept is the title attribute of the host language.

A place to start for annotations information (for those who may be unfamiliar) would be ARIA issue 1109.

aria-desription like HTML title attribute are indeed represent a concept of accessible description. However, accessible name is a primary characteristic the AT deals with, so an element having no name but having description is less typical/accessible than an element with name but without description. So historically the browsers repaired accessible name if none was provided explicitly (like HTML label or aria-label), and they used HTML title attribute as a last resort (that's why HTML-aam spec lists HTML title attribute in the end for each element).

If none of this matters in context of this issue, then I'll be happy to go muddle over other things :) but just figured it was worth pointing out regarding the annotation work / wondering if it'd be at all possible to just indicate these elements are represented by their subtree, and shouldn't be named instead. or is that too out there of an idea to be feasible?

I'd say it's not typical for HTML:time and all other elements (not listed elsewhere) to have title attribute or aria-label, because as you correctly noticed these elements are represented by their subtrees, but if they do, then I suppose that was author intention and the browsers should attempt to build an accessible name for those. I'd say these elements are like HTML:p elements (grouping/section content elements), and I'd expect them treated similarly.

@asurkov
Copy link
Contributor Author

asurkov commented Feb 21, 2020

I don't understand the whole discussion, since I assume that Accname is the specification that governs all this. In HTML-AAM, only the results derived from Accname are described in an easily understandable way.

correct

That means that the chapter in HTML-AAM cannot be changed without changing Accname, unless both specifications contradict each other.

not necessary, because accname spec delegates name computation rules from native markup. Previously (iirc) it also allowed to specify which elements support name computation from subtree. However now I see accname regulates that by listing roles that allow name from content, https://www.w3.org/TR/wai-aria/#namefromcontent. Also see accname alg F https://www.w3.org/TR/accname-1.1/#mapping_additional_nd_te

So actually it makes another reason why elements not listed elsewhere shouldn't support name computation from content: these elements have no mapping to ARIA roles and thus don't support name from content.

@scottaohara
Copy link
Member

Thank you @asurkov !

@JAWS-test
Copy link

JAWS-test commented Feb 25, 2020

In ARIA we have some roles that must not be named: https://w3c.github.io/aria/#namefromprohibited.

It would make sense if all equivalent HTML elements were also not allowed to be named (whether with title attribute, content or aria-label/aria-labelledby).

The question is, what should screen readers output when unnamed elements get the focus, are displayed in the element overview, or are reached with quick navigation? In all these cases, it would be better to output the content or part of the content instead of not outputting anything at all. This already works in the screen readers, but in my opinion it is not specified

asurkov added a commit that referenced this issue Feb 25, 2020
…name from content

Text level elements are not mapped to ARIA roles, but ARIA name computation alg strictly defines roles which allow name from content; also the behavior doens't match implementations
@asurkov
Copy link
Contributor Author

asurkov commented Feb 25, 2020

Thank you @asurkov !

I filed PR for the change #283

@asurkov
Copy link
Contributor Author

asurkov commented Feb 25, 2020

In ARIA we have some roles that must not be named: https://w3c.github.io/aria/#namefromprohibited.

It would make sense if all equivalent HTML elements were also not allowed to be named (whether with title attribute, content or aria-label/aria-labelledby).

Seems like we should, but also perhaps a different issue. Shall I go and file it?

@JAWS-test
Copy link

Shall I go and file it?

Yes

@scottaohara
Copy link
Member

I would again submit that's what #160 should be for. Consider prohibiting naming of elements. Yes.

@asurkov
Copy link
Contributor Author

asurkov commented Feb 26, 2020

I would again submit that's what #160 should be for. Consider prohibiting naming of elements. Yes.

It it about JAWS-test comment or this issue or both?

@scottaohara
Copy link
Member

Specifically about JAWS-Test's comment, but both really. Certain elements, including the ones in this thread, really shouldn't be named and should be represented by the contents of their subtree.

A bit of clarity there though. The naming prohibited in ARIA 1.2 is not a MUST, as naming such elements/roles is done in the wild now and it was not ARIA's intent to completely remove any naming mechanisms for those elements, but rather to inform authors that the elements shouldn't receive a name due to lack of consistently in it being exposed / desire that these elements really shoudn't be named.

My comment was more to the point that we dont' need another issue filed for prohibiting of naming, as 160 already exists. Per our earlier discussion in this thread, it was mentioned that 160 should be treated separately and I agree we should stick to that.

@asurkov
Copy link
Contributor Author

asurkov commented Mar 2, 2020

A bit of clarity there though. The naming prohibited in ARIA 1.2 is not a MUST, as naming such elements/roles is done in the wild now and it was not ARIA's intent to completely remove any naming mechanisms for those elements, but rather to inform authors that the elements shouldn't receive a name due to lack of consistently in it being exposed / desire that these elements really shoudn't be named.

Ok, good, it makes sense. Let's keep the discussion at #160 issue then?

What do we do about this issue and PR #283 in particular? Do we still want to align the spec with implementations before #160 is sorted out?

scottaohara added a commit that referenced this issue Jun 29, 2020
…name from content (#283)

Text level elements are not mapped to ARIA roles, but ARIA name computation alg strictly defines roles which allow name from content; also the behavior doens't match implementations

Co-authored-by: Scott O'Hara <scottaohara@users.noreply.github.com>
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

Successfully merging a pull request may close this issue.

4 participants