Bug 180866 - AX: macOS VoiceOver doesn't announce when details element is expanded when using role group
Summary: AX: macOS VoiceOver doesn't announce when details element is expanded when us...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Safari 11
Hardware: Mac OS X 10.11
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-12-15 08:59 PST by Anika Henke
Modified: 2018-05-29 23:31 PDT (History)
12 users (show)

See Also:


Attachments
patch (4.24 KB, patch)
2018-05-29 18:34 PDT, Nan Wang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anika Henke 2017-12-15 08:59:01 PST
When you expand a details element which has the ARIA role "group" or access one which is already expanded, it wrongly announces that it is collapsed in VoiceOver on OS X 11.

Steps to reproduce:
1. Activate VoiceOver on OS X
2. Open http://jsbin.com/cequcu in Safari
3. Navigate to the first details element ("Open this")
4. Hit the space bar to open the element

Result:
VoiceOver says "Open this, collapsed, summary".

Expected:
VoiceOver should say "Open this, expanded, summary" like it does in the second example (which doesn't include the group role).

Although the group role is the default implicit role of the details element [http://w3c.github.io/html/interactive-elements.html#elementdef-details] and it is recommended not to use it in such a case [http://w3c.github.io/html/dom.html#do-not-set], it should also not make the element behave any differently.
Comment 1 Radar WebKit Bug Importer 2017-12-15 09:00:39 PST
<rdar://problem/36074338>
Comment 2 Nan Wang 2018-05-29 18:34:46 PDT
Created attachment 341546 [details]
patch
Comment 3 chris fleizach 2018-05-29 19:00:29 PDT
Comment on attachment 341546 [details]
patch

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

> Source/WebCore/accessibility/AccessibilityObject.cpp:-2800
> -            return object.roleValue() == AccessibilityRole::Details;

What if someone made a details element into a landmark. Would we still expose expanded status?

Also is the attribute name exposed in this case?

We might want to list out the allowed roles a details can have and still have an expanded status
Comment 4 Nan Wang 2018-05-29 19:59:02 PDT
(In reply to chris fleizach from comment #3)
> Comment on attachment 341546 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=341546&action=review
> 
> > Source/WebCore/accessibility/AccessibilityObject.cpp:-2800
> > -            return object.roleValue() == AccessibilityRole::Details;
> 
> What if someone made a details element into a landmark. Would we still
> expose expanded status?

Yes I think so.

> 
> Also is the attribute name exposed in this case?
> 
> We might want to list out the allowed roles a details can have and still
> have an expanded status

I don't see a list of allowed roles in any spec for details element. Do you have any suggestions? 

Or I can only allow details element with group role for this particular case
Comment 5 WebKit Commit Bot 2018-05-29 21:01:20 PDT
Comment on attachment 341546 [details]
patch

Clearing flags on attachment: 341546

Committed r232285: <https://trac.webkit.org/changeset/232285>
Comment 6 WebKit Commit Bot 2018-05-29 21:01:22 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Darin Adler 2018-05-29 21:44:47 PDT
Comment on attachment 341546 [details]
patch

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

> Source/WebCore/accessibility/AccessibilityObject.cpp:2800
> +            return object.node() && is<HTMLDetailsElement>(object.node());

No need to do a null check if using is<>, which returns false for null. So it would be better to just write:

    return is<HTMLDetailsElement>(object.node());
Comment 8 Nan Wang 2018-05-29 23:31:11 PDT
(In reply to Darin Adler from comment #7)
> Comment on attachment 341546 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=341546&action=review
> 
> > Source/WebCore/accessibility/AccessibilityObject.cpp:2800
> > +            return object.node() && is<HTMLDetailsElement>(object.node());
> 
> No need to do a null check if using is<>, which returns false for null. So
> it would be better to just write:
> 
>     return is<HTMLDetailsElement>(object.node());

Ok updated
https://trac.webkit.org/changeset/232287/