Bug 171180 - AX: ARIA "region" role which lacks an accessible name should not be treated as a landmark
Summary: AX: ARIA "region" role which lacks an accessible name should not be treated a...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joanmarie Diggs
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-04-22 17:44 PDT by Joanmarie Diggs
Modified: 2017-04-28 19:07 PDT (History)
9 users (show)

See Also:


Attachments
Patch (22.63 KB, patch)
2017-04-28 16:14 PDT, Joanmarie Diggs
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joanmarie Diggs 2017-04-22 17:44:14 PDT
The ARIA spec states, "Authors must give each element with role region a brief label that describes the purpose of the content in the region." https://rawgit.com/w3c/aria/master/aria/aria.html#region

The Core AAM states, "Special case: if the region does not have an accessible name, do not expose the element as a landmark. Use the native host language role of the element instead." https://rawgit.com/w3c/aria/master/core-aam/core-aam.html#role-map-region
Comment 1 Radar WebKit Bug Importer 2017-04-22 17:44:33 PDT
<rdar://problem/31775830>
Comment 2 Joanmarie Diggs 2017-04-28 16:14:58 PDT
Created attachment 308612 [details]
Patch
Comment 3 chris fleizach 2017-04-28 17:10:07 PDT
Comment on attachment 308612 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=308612&action=review

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:2128
> +    if (role == LandmarkRegionRole && !hasAttribute(aria_labelAttr) && !hasAttribute(aria_labelledbyAttr))

do we think this is exhaustive !hasAttribute(aria_labelAttr) && !hasAttribute(aria_labelledbyAttr)
or are there are ways we should verify it has a label?
Comment 4 Joanmarie Diggs 2017-04-28 17:45:16 PDT
(In reply to chris fleizach from comment #3)
> Comment on attachment 308612 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=308612&action=review
> 
> > Source/WebCore/accessibility/AccessibilityNodeObject.cpp:2128
> > +    if (role == LandmarkRegionRole && !hasAttribute(aria_labelAttr) && !hasAttribute(aria_labelledbyAttr))
> 
> do we think this is exhaustive !hasAttribute(aria_labelAttr) &&
> !hasAttribute(aria_labelledbyAttr)
> or are there are ways we should verify it has a label?

It's admittedly not exhaustive. How exhaustive do you think we should be? Add alt and title? Or something else?
Comment 5 chris fleizach 2017-04-28 18:03:01 PDT
Comment on attachment 308612 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=308612&action=review

>>> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:2128
>>> +    if (role == LandmarkRegionRole && !hasAttribute(aria_labelAttr) && !hasAttribute(aria_labelledbyAttr))
>> 
>> do we think this is exhaustive !hasAttribute(aria_labelAttr) && !hasAttribute(aria_labelledbyAttr)
>> or are there are ways we should verify it has a label?
> 
> It's admittedly not exhaustive. How exhaustive do you think we should be? Add alt and title? Or something else?

I don't know. I just wanted to bring it up to make sure we considered the other cases. 
I don't want to encourage devs to keep using title attribute though so maybe this is good enough
Comment 6 Joanmarie Diggs 2017-04-28 18:44:44 PDT
(In reply to chris fleizach from comment #5)

> I don't know. I just wanted to bring it up to make sure we considered the
> other cases. 

I appreciate your doing so.

> I don't want to encourage devs to keep using title attribute though so maybe
> this is good enough

Agreed. The ARIA spec language tries to steer them in the direction of label/labelled-by:

<quote>
Authors must give each element with role region a brief label that describes the purpose of the content in the region. Authors should reference a visible label with aria-labelledby if a visible label is present. Authors should include the label inside of a heading whenever possible. The heading may be an instance of the standard host language heading element or an instance of an element with role heading.
</quote>

And if it's not good enough and a bug is filed, assign it to me, and I'll add the additional cases as appropriate.

Thanks for the review!
Comment 7 WebKit Commit Bot 2017-04-28 19:07:24 PDT
Comment on attachment 308612 [details]
Patch

Clearing flags on attachment: 308612

Committed r215968: <http://trac.webkit.org/changeset/215968>
Comment 8 WebKit Commit Bot 2017-04-28 19:07:26 PDT
All reviewed patches have been landed.  Closing bug.