Bug 196988 - [ContentChangeObserver] Use aria role as a hint whether a tap should result in a synthetic click
Summary: [ContentChangeObserver] Use aria role as a hint whether a tap should result i...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-16 14:55 PDT by zalan
Modified: 2019-04-17 11:57 PDT (History)
13 users (show)

See Also:


Attachments
Patch (9.97 KB, patch)
2019-04-16 15:29 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (10.02 KB, patch)
2019-04-17 10:08 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2019-04-16 14:55:26 PDT
role="checkbox" e.g.
Comment 1 Radar WebKit Bug Importer 2019-04-16 14:56:01 PDT
<rdar://problem/49955328>
Comment 2 zalan 2019-04-16 15:29:18 PDT
Created attachment 367581 [details]
Patch
Comment 3 chris fleizach 2019-04-16 15:45:19 PDT
Comment on attachment 367581 [details]
Patch

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

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:569
> +static bool isAriaRoleForImmediateClick(AccessibilityRole role)

feels like this might better live in AccessibilityObject. There's an existing

bool AccessibilityObject::isARIAControl(AccessibilityRole ariaRole) that might be appropriate

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:572
> +        || role == AccessibilityRole::Link || role == AccessibilityRole::List || role == AccessibilityRole::ListBox || role == AccessibilityRole::ListBoxOption || role == AccessibilityRole::ListItem 

not sure we want to tap ListBox

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:575
> +        || role == AccessibilityRole::SearchField || role == AccessibilityRole::Slider || role == AccessibilityRole::SliderThumb || role ==AccessibilityRole::SpinButton || role == AccessibilityRole::SpinButtonPart

spacing 
role ==AccessibilityRole::SpinButton

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:576
> +        || role == AccessibilityRole::TextArea || role == AccessibilityRole::TextField || role == AccessibilityRole::ToggleButton;

do we want to tap text areas and text fields?

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:577
> +}

this might be better written as a switch statement

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:590
> +    return isAriaRoleForImmediateClick(AccessibilityObject::ariaRoleToWebCoreRole(ariaRoleString));

ariaRoleToWebCoreRole should handle null and empty strings. you can probably remove this if
Comment 4 zalan 2019-04-17 10:08:59 PDT
Created attachment 367641 [details]
Patch
Comment 5 zalan 2019-04-17 10:10:50 PDT
(In reply to chris fleizach from comment #3)
> Comment on attachment 367581 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=367581&action=review
> 
> > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:569
> > +static bool isAriaRoleForImmediateClick(AccessibilityRole role)
> 
> feels like this might better live in AccessibilityObject. There's an existing
> 
> bool AccessibilityObject::isARIAControl(AccessibilityRole ariaRole) that
> might be appropriate
I didn't know about isARIAControl and isARIAInput! Thanks!

> > Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:590
> > +    return isAriaRoleForImmediateClick(AccessibilityObject::ariaRoleToWebCoreRole(ariaRoleString));
> 
> ariaRoleToWebCoreRole should handle null and empty strings. you can probably
> remove this if
Good idea.
Comment 6 WebKit Commit Bot 2019-04-17 11:57:57 PDT
Comment on attachment 367641 [details]
Patch

Clearing flags on attachment: 367641

Committed r244392: <https://trac.webkit.org/changeset/244392>
Comment 7 WebKit Commit Bot 2019-04-17 11:57:59 PDT
All reviewed patches have been landed.  Closing bug.