<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[169310] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/169310">169310</a></dd>
<dt>Author</dt> <dd>cfleizach@apple.com</dd>
<dt>Date</dt> <dd>2014-05-24 12:30:49 -0700 (Sat, 24 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>AX: fix coordinate mapping for iOS accessibility
https://bugs.webkit.org/show_bug.cgi?id=133188

Reviewed by Sam Weinig.

Source/WebCore:
Make WebCore aware of the accessibility point/rect conversion methods.

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
(-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
* loader/EmptyClients.h:
* page/Chrome.cpp:
(WebCore::Chrome::accessibilityScreenToRootView):
(WebCore::Chrome::rootViewToAccessibilityScreen):
* page/Chrome.h:
* page/ChromeClient.h:
* platform/HostWindow.h:

Source/WebKit/mac:
* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::accessibilityScreenToRootView):
(WebChromeClient::rootViewToAccessibilityScreen):

Source/WebKit2:
Add in accessibility conversion methods that will check if the methods are present
(if accessibility is not on, they won't be)
and use those to convert points into the right coordinate space that VoiceOver is expecting.

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::accessibilityScreenToRootView):
(WebKit::WebPageProxy::rootViewToAccessibilityScreen):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::accessibilityScreenToRootView):
(WebKit::PageClientImpl::rootViewToAccessibilityScreen):
* UIProcess/mac/PageClientImpl.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::accessibilityScreenToRootView):
(WebKit::WebChromeClient::rootViewToAccessibilityScreen):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::accessibilityScreenToRootView):
(WebKit::WebPage::rootViewToAccessibilityScreen):
* WebProcess/WebPage/WebPage.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreaccessibilityiosWebAccessibilityObjectWrapperIOSmm">trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientsh">trunk/Source/WebCore/loader/EmptyClients.h</a></li>
<li><a href="#trunkSourceWebCorepageChromecpp">trunk/Source/WebCore/page/Chrome.cpp</a></li>
<li><a href="#trunkSourceWebCorepageChromeh">trunk/Source/WebCore/page/Chrome.h</a></li>
<li><a href="#trunkSourceWebCorepageChromeClienth">trunk/Source/WebCore/page/ChromeClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformHostWindowh">trunk/Source/WebCore/platform/HostWindow.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebChromeClienth">trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebChromeClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageClienth">trunk/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSh">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSmm">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacPageClientImplh">trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWKAccessibilityWebPageObjectIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebCore/ChangeLog        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2014-05-24  Chris Fleizach  &lt;cfleizach@apple.com&gt;
+
+        AX: fix coordinate mapping for iOS accessibility
+        https://bugs.webkit.org/show_bug.cgi?id=133188
+
+        Reviewed by Sam Weinig.
+
+        Make WebCore aware of the accessibility point/rect conversion methods.
+
+        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+        (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
+        (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]):
+        * loader/EmptyClients.h:
+        * page/Chrome.cpp:
+        (WebCore::Chrome::accessibilityScreenToRootView):
+        (WebCore::Chrome::rootViewToAccessibilityScreen):
+        * page/Chrome.h:
+        * page/ChromeClient.h:
+        * platform/HostWindow.h:
+
</ins><span class="cx"> 2014-05-24  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Subpixel rendering: Non-compositing transforms with subpixel coordinates paint to wrong position.
</span></span></pre></div>
<a id="trunkSourceWebCoreaccessibilityiosWebAccessibilityObjectWrapperIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -1128,7 +1128,7 @@
</span><span class="cx">         
</span><span class="cx">         if (page) {
</span><span class="cx">             IntRect rect = IntRect(intPoint, IntSize(0, 0));
</span><del>-            intPoint = page-&gt;chrome().rootViewToScreen(rect).location();
</del><ins>+            intPoint = page-&gt;chrome().rootViewToAccessibilityScreen(rect).location();
</ins><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         cgPoint = (CGPoint)intPoint;
</span><span class="lines">@@ -1180,7 +1180,7 @@
</span><span class="cx">             page = parent-&gt;page();
</span><span class="cx">         
</span><span class="cx">         if (page)
</span><del>-            rect = page-&gt;chrome().rootViewToScreen(rect);
</del><ins>+            rect = page-&gt;chrome().rootViewToAccessibilityScreen(rect);
</ins><span class="cx">         
</span><span class="cx">         frame = (CGRect)rect;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.h (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.h        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebCore/loader/EmptyClients.h        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -139,6 +139,10 @@
</span><span class="cx"> 
</span><span class="cx">     virtual IntPoint screenToRootView(const IntPoint&amp; p) const override { return p; }
</span><span class="cx">     virtual IntRect rootViewToScreen(const IntRect&amp; r) const override { return r; }
</span><ins>+#if PLATFORM(IOS)
+    virtual IntPoint accessibilityScreenToRootView(const IntPoint&amp; p) const override { return p; };
+    virtual IntRect rootViewToAccessibilityScreen(const IntRect&amp; r) const override { return r; };
+#endif
</ins><span class="cx">     virtual PlatformPageClient platformPageClient() const override { return 0; }
</span><span class="cx">     virtual void contentsSizeChanged(Frame*, const IntSize&amp;) const override { }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Chrome.cpp (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Chrome.cpp        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebCore/page/Chrome.cpp        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -114,7 +114,19 @@
</span><span class="cx"> {
</span><span class="cx">     return m_client.rootViewToScreen(rect);
</span><span class="cx"> }
</span><ins>+    
+#if PLATFORM(IOS)
+IntPoint Chrome::accessibilityScreenToRootView(const IntPoint&amp; point) const
+{
+    return m_client.accessibilityScreenToRootView(point);
+}
</ins><span class="cx"> 
</span><ins>+IntRect Chrome::rootViewToAccessibilityScreen(const IntRect&amp; rect) const
+{
+    return m_client.rootViewToAccessibilityScreen(rect);
+}
+#endif
+
</ins><span class="cx"> PlatformPageClient Chrome::platformPageClient() const
</span><span class="cx"> {
</span><span class="cx">     return m_client.platformPageClient();
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Chrome.h (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Chrome.h        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebCore/page/Chrome.h        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -78,6 +78,10 @@
</span><span class="cx"> #endif
</span><span class="cx">     virtual IntPoint screenToRootView(const IntPoint&amp;) const override;
</span><span class="cx">     virtual IntRect rootViewToScreen(const IntRect&amp;) const override;
</span><ins>+#if PLATFORM(IOS)
+    virtual IntPoint accessibilityScreenToRootView(const IntPoint&amp;) const override;
+    virtual IntRect rootViewToAccessibilityScreen(const IntRect&amp;) const override;
+#endif
</ins><span class="cx">     virtual PlatformPageClient platformPageClient() const override;
</span><span class="cx">     virtual void scrollbarsModeDidChange() const override;
</span><span class="cx">     virtual void setCursor(const Cursor&amp;) override;
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ChromeClient.h (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ChromeClient.h        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebCore/page/ChromeClient.h        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -166,6 +166,10 @@
</span><span class="cx"> #endif
</span><span class="cx">     virtual IntPoint screenToRootView(const IntPoint&amp;) const = 0;
</span><span class="cx">     virtual IntRect rootViewToScreen(const IntRect&amp;) const = 0;
</span><ins>+#if PLATFORM(IOS)
+    virtual IntPoint accessibilityScreenToRootView(const IntPoint&amp;) const = 0;
+    virtual IntRect rootViewToAccessibilityScreen(const IntRect&amp;) const = 0;
+#endif    
</ins><span class="cx">     virtual PlatformPageClient platformPageClient() const = 0;
</span><span class="cx">     virtual void scrollbarsModeDidChange() const = 0;
</span><span class="cx"> #if ENABLE(CURSOR_SUPPORT)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformHostWindowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/HostWindow.h (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/HostWindow.h        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebCore/platform/HostWindow.h        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -58,7 +58,11 @@
</span><span class="cx">     // Methods for doing coordinate conversions to and from screen coordinates.
</span><span class="cx">     virtual IntPoint screenToRootView(const IntPoint&amp;) const = 0;
</span><span class="cx">     virtual IntRect rootViewToScreen(const IntRect&amp;) const = 0;
</span><del>-
</del><ins>+#if PLATFORM(IOS)
+    virtual IntPoint accessibilityScreenToRootView(const IntPoint&amp;) const = 0;
+    virtual IntRect rootViewToAccessibilityScreen(const IntRect&amp;) const = 0;
+#endif
+    
</ins><span class="cx">     // Method for retrieving the native client of the page.
</span><span class="cx">     virtual PlatformPageClient platformPageClient() const = 0;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit/mac/ChangeLog        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2014-05-24  Chris Fleizach  &lt;cfleizach@apple.com&gt;
+
+        AX: fix coordinate mapping for iOS accessibility
+        https://bugs.webkit.org/show_bug.cgi?id=133188
+
+        Reviewed by Sam Weinig.
+
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::accessibilityScreenToRootView):
+        (WebChromeClient::rootViewToAccessibilityScreen):
+
</ins><span class="cx"> 2014-05-23  Jeremy Jones  &lt;jeremyj@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Hide fullscreen immediately when switching tabs.
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -101,6 +101,10 @@
</span><span class="cx"> 
</span><span class="cx">     virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&amp;) const override;
</span><span class="cx">     virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&amp;) const override;
</span><ins>+#if PLATFORM(IOS)
+    virtual WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&amp;) const override;
+    virtual WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&amp;) const override;
+#endif
</ins><span class="cx">     virtual PlatformPageClient platformPageClient() const override;
</span><span class="cx">     virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&amp;) const override;
</span><span class="cx">     virtual void scrollRectIntoView(const WebCore::IntRect&amp;) const override;
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebChromeClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -600,6 +600,18 @@
</span><span class="cx">     return r;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS)
+IntPoint WebChromeClient::accessibilityScreenToRootView(const IntPoint&amp; p) const
+{
+    return p;
+}
+
+IntRect WebChromeClient::rootViewToAccessibilityScreen(const IntRect&amp; r) const
+{
+    return r;
+}
+#endif
+
</ins><span class="cx"> PlatformPageClient WebChromeClient::platformPageClient() const
</span><span class="cx"> {
</span><span class="cx">     return 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit2/ChangeLog        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2014-05-24  Chris Fleizach  &lt;cfleizach@apple.com&gt;
+
+        AX: fix coordinate mapping for iOS accessibility
+        https://bugs.webkit.org/show_bug.cgi?id=133188
+
+        Reviewed by Sam Weinig.
+
+        Add in accessibility conversion methods that will check if the methods are present 
+        (if accessibility is not on, they won't be)
+        and use those to convert points into the right coordinate space that VoiceOver is expecting.
+
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::accessibilityScreenToRootView):
+        (WebKit::WebPageProxy::rootViewToAccessibilityScreen):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::accessibilityScreenToRootView):
+        (WebKit::PageClientImpl::rootViewToAccessibilityScreen):
+        * UIProcess/mac/PageClientImpl.h:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::accessibilityScreenToRootView):
+        (WebKit::WebChromeClient::rootViewToAccessibilityScreen):
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+        * WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm:
+        (-[WKAccessibilityWebPageObject accessibilityHitTest:]):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::accessibilityScreenToRootView):
+        (WebKit::WebPage::rootViewToAccessibilityScreen):
+        * WebProcess/WebPage/WebPage.h:
+
</ins><span class="cx"> 2014-05-24  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r165841): Messages sent before the child process is launched are never sent after r165841
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -196,6 +196,10 @@
</span><span class="cx">     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&amp;) = 0;
</span><span class="cx">     virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&amp;) = 0;
</span><span class="cx">     virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&amp;) = 0;
</span><ins>+#if PLATFORM(IOS)
+    virtual WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&amp;) = 0;
+    virtual WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&amp;) = 0;
+#endif
</ins><span class="cx">     
</span><span class="cx">     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&amp;, bool wasEventHandled) = 0;
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -3039,6 +3039,18 @@
</span><span class="cx">     result = m_pageClient.rootViewToScreen(viewRect);
</span><span class="cx"> }
</span><span class="cx">     
</span><ins>+#if PLATFORM(IOS)
+void WebPageProxy::accessibilityScreenToRootView(const IntPoint&amp; screenPoint, IntPoint&amp; windowPoint)
+{
+    windowPoint = m_pageClient.accessibilityScreenToRootView(screenPoint);
+}
+
+void WebPageProxy::rootViewToAccessibilityScreen(const IntRect&amp; viewRect, IntRect&amp; result)
+{
+    result = m_pageClient.rootViewToAccessibilityScreen(viewRect);
+}
+#endif
+    
</ins><span class="cx"> void WebPageProxy::runBeforeUnloadConfirmPanel(const String&amp; message, uint64_t frameID, bool&amp; shouldClose)
</span><span class="cx"> {
</span><span class="cx">     WebFrameProxy* frame = m_process-&gt;webFrame(frameID);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -1191,6 +1191,10 @@
</span><span class="cx">     void getWindowFrame(WebCore::FloatRect&amp;);
</span><span class="cx">     void screenToRootView(const WebCore::IntPoint&amp; screenPoint, WebCore::IntPoint&amp; windowPoint);
</span><span class="cx">     void rootViewToScreen(const WebCore::IntRect&amp; viewRect, WebCore::IntRect&amp; result);
</span><ins>+#if PLATFORM(IOS)
+    void accessibilityScreenToRootView(const WebCore::IntPoint&amp; screenPoint, WebCore::IntPoint&amp; windowPoint);
+    void rootViewToAccessibilityScreen(const WebCore::IntRect&amp; viewRect, WebCore::IntRect&amp; result);
+#endif
</ins><span class="cx">     void runBeforeUnloadConfirmPanel(const String&amp; message, uint64_t frameID, bool&amp; shouldClose);
</span><span class="cx">     void didChangeViewportProperties(const WebCore::ViewportAttributes&amp;);
</span><span class="cx">     void pageDidScroll();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -63,6 +63,12 @@
</span><span class="cx">     GetWindowFrame() -&gt; (WebCore::FloatRect windowFrame)
</span><span class="cx">     ScreenToRootView(WebCore::IntPoint screenPoint) -&gt; (WebCore::IntPoint windowPoint)
</span><span class="cx">     RootViewToScreen(WebCore::IntRect rect) -&gt; (WebCore::IntRect screenFrame)
</span><ins>+
+#if PLATFORM(IOS)
+    AccessibilityScreenToRootView(WebCore::IntPoint screenPoint) -&gt; (WebCore::IntPoint windowPoint)
+    RootViewToAccessibilityScreen(WebCore::IntRect rect) -&gt; (WebCore::IntRect screenFrame)
+#endif
+
</ins><span class="cx">     RunBeforeUnloadConfirmPanel(String message, uint64_t frameID) -&gt; (bool shouldClose)
</span><span class="cx">     PageDidScroll()
</span><span class="cx">     RunOpenPanel(uint64_t frameID, WebCore::FileChooserSettings parameters)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -87,6 +87,8 @@
</span><span class="cx">     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&amp;) override;
</span><span class="cx">     virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&amp;) override;
</span><span class="cx">     virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&amp;) override;
</span><ins>+    virtual WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&amp;) override;
+    virtual WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&amp;) override;
</ins><span class="cx">     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&amp;, bool wasEventHandled) override;
</span><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><span class="cx">     virtual void doneWithTouchEvent(const NativeWebTouchEvent&amp;, bool wasEventHandled) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -52,6 +52,8 @@
</span><span class="cx"> 
</span><span class="cx"> @interface UIView (IPI)
</span><span class="cx"> - (UIScrollView *)_scroller;
</span><ins>+- (CGPoint)accessibilityConvertPointFromSceneReferenceCoordinates:(CGPoint)point;
+- (CGRect)accessibilityConvertRectToSceneReferenceCoordinates:(CGRect)rect;
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -321,7 +323,23 @@
</span><span class="cx"> {
</span><span class="cx">     return enclosingIntRect([m_contentView convertRect:rect toView:nil]);
</span><span class="cx"> }
</span><del>-
</del><ins>+    
+IntPoint PageClientImpl::accessibilityScreenToRootView(const IntPoint&amp; point)
+{
+    CGPoint rootViewPoint = point;
+    if ([m_contentView respondsToSelector:@selector(accessibilityConvertPointFromSceneReferenceCoordinates:)])
+        rootViewPoint = [m_contentView accessibilityConvertPointFromSceneReferenceCoordinates:rootViewPoint];
+    return IntPoint(rootViewPoint);
+}
+    
+IntRect PageClientImpl::rootViewToAccessibilityScreen(const IntRect&amp; rect)
+{
+    CGRect rootViewRect = rect;
+    if ([m_contentView respondsToSelector:@selector(accessibilityConvertRectToSceneReferenceCoordinates:)])
+        rootViewRect = [m_contentView accessibilityConvertRectToSceneReferenceCoordinates:rootViewRect];
+    return enclosingIntRect(rootViewRect);
+}
+    
</ins><span class="cx"> void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent&amp;, bool)
</span><span class="cx"> {
</span><span class="cx">     notImplemented();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacPageClientImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -104,7 +104,11 @@
</span><span class="cx">     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&amp;);
</span><span class="cx">     virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&amp;);
</span><span class="cx">     virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&amp;);
</span><del>-
</del><ins>+#if PLATFORM(IOS)
+    virtual WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&amp;) = 0;
+    virtual WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&amp;) = 0;
+#endif
+        
</ins><span class="cx">     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&amp;, bool wasEventHandled);
</span><span class="cx"> 
</span><span class="cx">     virtual PassRefPtr&lt;WebPopupMenuProxy&gt; createPopupMenuProxy(WebPageProxy*);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -486,7 +486,19 @@
</span><span class="cx"> {
</span><span class="cx">     return m_page-&gt;rootViewToScreen(rect);
</span><span class="cx"> }
</span><ins>+    
+#if PLATFORM(IOS)
+IntPoint WebChromeClient::accessibilityScreenToRootView(const IntPoint&amp; point) const
+{
+    return m_page-&gt;accessibilityScreenToRootView(point);
+}
</ins><span class="cx"> 
</span><ins>+IntRect WebChromeClient::rootViewToAccessibilityScreen(const IntRect&amp; rect) const
+{
+    return m_page-&gt;rootViewToAccessibilityScreen(rect);
+}
+#endif
+
</ins><span class="cx"> PlatformPageClient WebChromeClient::platformPageClient() const
</span><span class="cx"> {
</span><span class="cx">     notImplemented();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -117,6 +117,10 @@
</span><span class="cx"> #endif
</span><span class="cx">     virtual WebCore::IntPoint screenToRootView(const WebCore::IntPoint&amp;) const override;
</span><span class="cx">     virtual WebCore::IntRect rootViewToScreen(const WebCore::IntRect&amp;) const override;
</span><ins>+#if PLATFORM(IOS)
+    virtual WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&amp;) const override;
+    virtual WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&amp;) const override;
+#endif
</ins><span class="cx">     virtual PlatformPageClient platformPageClient() const override;
</span><span class="cx">     virtual void contentsSizeChanged(WebCore::Frame*, const WebCore::IntSize&amp;) const override;
</span><span class="cx">     virtual void scrollRectIntoView(const WebCore::IntRect&amp;) const override; // Currently only Mac has a non empty implementation.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWKAccessibilityWebPageObjectIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WKAccessibilityWebPageObjectIOS.mm        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -31,7 +31,9 @@
</span><span class="cx"> #import &quot;WebFrame.h&quot;
</span><span class="cx"> #import &quot;WebPage.h&quot;
</span><span class="cx"> #import &lt;WebCore/IntPoint.h&gt;
</span><ins>+#import &lt;WebCore/MainFrame.h&gt;
</ins><span class="cx"> #import &lt;WebCore/FrameView.h&gt;
</span><ins>+#import &lt;WebCore/Page.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> /* 
</span><span class="cx">  The implementation of this class will be augmented by an accesibility bundle that is loaded only when accessibility is requested to be enabled.
</span><span class="lines">@@ -72,7 +74,7 @@
</span><span class="cx">     if (!m_page)
</span><span class="cx">         return nil;
</span><span class="cx">     
</span><del>-    WebCore::IntPoint convertedPoint = m_page-&gt;screenToRootView(WebCore::IntPoint(point));
</del><ins>+    WebCore::IntPoint convertedPoint = m_page-&gt;accessibilityScreenToRootView(WebCore::IntPoint(point));
</ins><span class="cx">     return [[self accessibilityRootObjectWrapper] accessibilityHitTest:convertedPoint];
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -2291,7 +2291,23 @@
</span><span class="cx">     sendSync(Messages::WebPageProxy::RootViewToScreen(rect), Messages::WebPageProxy::RootViewToScreen::Reply(screenRect));
</span><span class="cx">     return screenRect;
</span><span class="cx"> }
</span><ins>+    
+#if PLATFORM(IOS)
+IntPoint WebPage::accessibilityScreenToRootView(const IntPoint&amp; point)
+{
+    IntPoint windowPoint;
+    sendSync(Messages::WebPageProxy::AccessibilityScreenToRootView(point), Messages::WebPageProxy::AccessibilityScreenToRootView::Reply(windowPoint));
+    return windowPoint;
+}
</ins><span class="cx"> 
</span><ins>+IntRect WebPage::rootViewToAccessibilityScreen(const IntRect&amp; rect)
+{
+    IntRect screenRect;
+    sendSync(Messages::WebPageProxy::RootViewToAccessibilityScreen(rect), Messages::WebPageProxy::RootViewToAccessibilityScreen::Reply(screenRect));
+    return screenRect;
+}
+#endif
+
</ins><span class="cx"> IntRect WebPage::windowResizerRect() const
</span><span class="cx"> {
</span><span class="cx">     if (m_windowResizerSize.isEmpty())
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (169309 => 169310)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-05-24 14:50:42 UTC (rev 169309)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2014-05-24 19:30:49 UTC (rev 169310)
</span><span class="lines">@@ -426,11 +426,17 @@
</span><span class="cx"> 
</span><span class="cx">     void hidePageBanners();
</span><span class="cx">     void showPageBanners();
</span><ins>+    
</ins><span class="cx"> #endif // !PLATFORM(IOS)
</span><span class="cx"> 
</span><span class="cx">     WebCore::IntPoint screenToRootView(const WebCore::IntPoint&amp;);
</span><span class="cx">     WebCore::IntRect rootViewToScreen(const WebCore::IntRect&amp;);
</span><del>-
</del><ins>+    
+#if PLATFORM(IOS)
+    WebCore::IntPoint accessibilityScreenToRootView(const WebCore::IntPoint&amp;);
+    WebCore::IntRect rootViewToAccessibilityScreen(const WebCore::IntRect&amp;);
+#endif
+    
</ins><span class="cx">     PassRefPtr&lt;WebImage&gt; scaledSnapshotWithOptions(const WebCore::IntRect&amp;, double additionalScaleFactor, SnapshotOptions);
</span><span class="cx">     PassRefPtr&lt;WebImage&gt; snapshotAtSize(const WebCore::IntRect&amp;, const WebCore::IntSize&amp; bitmapSize, SnapshotOptions);
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>