Bug 133188 - AX: fix coordinate mapping for iOS accessibility
Summary: AX: fix coordinate mapping for iOS accessibility
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: chris fleizach
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-05-22 13:19 PDT by chris fleizach
Modified: 2014-05-24 12:31 PDT (History)
12 users (show)

See Also:


Attachments
patch (21.38 KB, patch)
2014-05-22 13:38 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
patch (21.35 KB, patch)
2014-05-22 13:43 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
patch (21.40 KB, patch)
2014-05-22 17:14 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
patch (21.35 KB, patch)
2014-05-23 16:40 PDT, chris fleizach
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chris fleizach 2014-05-22 13:19:56 PDT
The conversion routines that accessibility is using to convert from rootToScreen and back are not "scene reference" aware.

That means those methods convert to the screen space, but VoiceOver and others are expecting it in scene reference space.

We need another conversion mechanism to handle this discrepancy

<rdar://problem/16888499>
Comment 1 chris fleizach 2014-05-22 13:38:11 PDT
Created attachment 231907 [details]
patch
Comment 2 WebKit Commit Bot 2014-05-22 13:40:31 PDT
Attachment 231907 [details] did not pass style-queue:


ERROR: Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm:338:  When wrapping a line, only indent 4 spaces.  [whitespace/indent] [3]
Total errors found: 1 in 23 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 chris fleizach 2014-05-22 13:43:22 PDT
Created attachment 231908 [details]
patch
Comment 4 chris fleizach 2014-05-22 17:14:51 PDT
Created attachment 231922 [details]
patch
Comment 5 Sam Weinig 2014-05-23 11:29:34 PDT
Is there a way we can do this without adding a new sync message? Can the UIProcess push the data needed for the transform down?
Comment 6 chris fleizach 2014-05-23 16:40:53 PDT
Created attachment 232003 [details]
patch
Comment 7 Simon Fraser (smfr) 2014-05-23 16:54:13 PDT
Comment on attachment 232003 [details]
patch

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

> Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm:613
> +IntPoint WebChromeClient::accessibilityScreenToRootView(const IntPoint& p) const
> +{
> +    return p;
> +}
> +
> +IntRect WebChromeClient::rootViewToAccessibilityScreen(const IntRect& r) const
> +{
> +    return r;
> +}
> +#endif

p -> point and r -> rect please.

> Source/WebKit2/WebProcess/WebPage/WebPage.cpp:2312
> +IntPoint WebPage::accessibilityScreenToRootView(const IntPoint& point)
> +{
> +    IntPoint windowPoint;
> +    sendSync(Messages::WebPageProxy::AccessibilityScreenToRootView(point), Messages::WebPageProxy::AccessibilityScreenToRootView::Reply(windowPoint));
> +    return windowPoint;
> +}
>  
> +IntRect WebPage::rootViewToAccessibilityScreen(const IntRect& rect)
> +{
> +    IntRect screenRect;
> +    sendSync(Messages::WebPageProxy::RootViewToAccessibilityScreen(rect), Messages::WebPageProxy::RootViewToAccessibilityScreen::Reply(screenRect));
> +    return screenRect;
> +}
> +#endif

Do we really have to use sync messages here? Can we push the to-screen mapping into the UI process?
Comment 8 Anders Carlsson 2014-05-23 16:58:09 PDT
Comment on attachment 232003 [details]
patch

Would it be possible to keep a conversion matrix in the web process to avoid having to send sync messages?
Comment 9 chris fleizach 2014-05-23 17:05:22 PDT
(In reply to comment #7)
> (From update of attachment 232003 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=232003&action=review
> 
> > Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm:613
> > +IntPoint WebChromeClient::accessibilityScreenToRootView(const IntPoint& p) const
> > +{
> > +    return p;
> > +}
> > +
> > +IntRect WebChromeClient::rootViewToAccessibilityScreen(const IntRect& r) const
> > +{
> > +    return r;
> > +}
> > +#endif
> 
> p -> point and r -> rect please.
> 
> > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:2312
> > +IntPoint WebPage::accessibilityScreenToRootView(const IntPoint& point)
> > +{
> > +    IntPoint windowPoint;
> > +    sendSync(Messages::WebPageProxy::AccessibilityScreenToRootView(point), Messages::WebPageProxy::AccessibilityScreenToRootView::Reply(windowPoint));
> > +    return windowPoint;
> > +}
> >  
> > +IntRect WebPage::rootViewToAccessibilityScreen(const IntRect& rect)
> > +{
> > +    IntRect screenRect;
> > +    sendSync(Messages::WebPageProxy::RootViewToAccessibilityScreen(rect), Messages::WebPageProxy::RootViewToAccessibilityScreen::Reply(screenRect));
> > +    return screenRect;
> > +}
> > +#endif
> 
> Do we really have to use sync messages here? Can we push the to-screen mapping into the UI process?

This is gonna be a bit tough. VoiceOver will message a WebAXObjectWrapper for it's frame, for example, (communicating directly to the WebProcess) and it's expecting an answer to be returned immediately.

for example the rootToScreenView() is also synchronous (which is why it's usable for AX code)
Comment 10 chris fleizach 2014-05-23 17:06:09 PDT
(In reply to comment #8)
> (From update of attachment 232003 [details])
> Would it be possible to keep a conversion matrix in the web process to avoid having to send sync messages?

The conversion code is not simple. It's spread across AX code and UIKit and accounts for a number of conversions. I can email you offline what needs to happen
Comment 11 chris fleizach 2014-05-24 12:00:53 PDT
Thanks Sam!
Comment 12 WebKit Commit Bot 2014-05-24 12:31:19 PDT
Comment on attachment 232003 [details]
patch

Clearing flags on attachment: 232003

Committed r169310: <http://trac.webkit.org/changeset/169310>
Comment 13 WebKit Commit Bot 2014-05-24 12:31:23 PDT
All reviewed patches have been landed.  Closing bug.