Bug 162041

Summary: AX: Add accessibility support for details element on iOS
Product: WebKit Reporter: Nan Wang <n_wang>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, cfleizach, commit-queue, dmazzoni, jcraig, jdiggs, mario, n_wang, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch
none
patch
none
patch
none
patch none

Description Nan Wang 2016-09-15 16:03:41 PDT
The details/summary elements are poorly supported on iOS.

Issues:
1. There's no expanded/collapsed status announced from VoiceOver.
2. Impossible to navigate through them using VoiceOver. VO cursor is jumping randomly.

<rdar://problem/27914836>
Comment 1 Nan Wang 2016-09-15 16:23:13 PDT
Created attachment 289013 [details]
patch
Comment 2 chris fleizach 2016-09-15 17:34:30 PDT
Comment on attachment 289013 [details]
patch

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

> Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:1840
> +    for (AccessibilityObject* parent = object; parent; parent = parent->parentObject()) {

can we make a function that takes a lambda for running up the parent chain and returning a match object?
and then replace all such places with that ?

> Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:1871
> +            // webkit.org/b/162041 Taking focus onto elements inside a details node will cause VO focusing onto random items.

why is this the case?
should we put this check inside canSetFocusAttribute() instead
Comment 3 Nan Wang 2016-09-15 17:40:07 PDT
Comment on attachment 289013 [details]
patch

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

Thanks, will address other issues.

>> Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:1871
>> +            // webkit.org/b/162041 Taking focus onto elements inside a details node will cause VO focusing onto random items.
> 
> why is this the case?
> should we put this check inside canSetFocusAttribute() instead

There must be something special with the details element that I haven't had chance to dig into. I think on iOS it's ok to not set focus inside details element when VO tries to focus on it.
Comment 4 Nan Wang 2016-09-15 17:42:30 PDT
Comment on attachment 289013 [details]
patch

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

>>> Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:1871
>>> +            // webkit.org/b/162041 Taking focus onto elements inside a details node will cause VO focusing onto random items.
>> 
>> why is this the case?
>> should we put this check inside canSetFocusAttribute() instead
> 
> There must be something special with the details element that I haven't had chance to dig into. I think on iOS it's ok to not set focus inside details element when VO tries to focus on it.

I put it here because this will only affect iOS.
Comment 5 chris fleizach 2016-09-15 17:54:02 PDT
Comment on attachment 289013 [details]
patch

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

>>>> Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:1871
>>>> +            // webkit.org/b/162041 Taking focus onto elements inside a details node will cause VO focusing onto random items.
>>> 
>>> why is this the case?
>>> should we put this check inside canSetFocusAttribute() instead
>> 
>> There must be something special with the details element that I haven't had chance to dig into. I think on iOS it's ok to not set focus inside details element when VO tries to focus on it.
> 
> I put it here because this will only affect iOS.

ok seems reasonable
Comment 6 Nan Wang 2016-09-15 18:52:46 PDT
Created attachment 289027 [details]
patch

- updated function to take a lambda to search for matched parent object.
Comment 7 Nan Wang 2016-09-15 19:40:15 PDT
Will look into the patch build issue
Comment 8 Nan Wang 2016-09-15 20:29:21 PDT
Created attachment 289029 [details]
patch

Fixed the patch
Comment 9 Nan Wang 2016-09-19 10:58:07 PDT
Created attachment 289241 [details]
patch

Updated style for matchFunc
Comment 10 WebKit Commit Bot 2016-09-19 11:34:33 PDT
Comment on attachment 289241 [details]
patch

Clearing flags on attachment: 289241

Committed r206102: <http://trac.webkit.org/changeset/206102>
Comment 11 WebKit Commit Bot 2016-09-19 11:34:38 PDT
All reviewed patches have been landed.  Closing bug.