Title: [88669] trunk/Source/WebKit2
Revision
88669
Author
[email protected]
Date
2011-06-13 12:10:16 -0700 (Mon, 13 Jun 2011)

Log Message

kAXTextMarkerForPositionParametrizedAttribute does not work correctly in WK2
https://bugs.webkit.org/show_bug.cgi?id=62547

Reviewed by Darin Adler.

Implement the missing screenToWindow method for WK2.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::screenToWindow):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::screenToWindow):
* UIProcess/API/qt/qwkpage.cpp:
(QWKPagePrivate::screenToWindow):
* UIProcess/API/qt/qwkpage_p.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::screenToWindow):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/win/WebView.cpp:
(WebKit::WebView::screenToWindow):
* UIProcess/win/WebView.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::screenToWindow):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::screenToWindow):
* WebProcess/WebPage/WebPage.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (88668 => 88669)


--- trunk/Source/WebKit2/ChangeLog	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/ChangeLog	2011-06-13 19:10:16 UTC (rev 88669)
@@ -1,3 +1,35 @@
+2011-06-13  Chris Fleizach  <[email protected]>
+
+        Reviewed by Darin Adler.
+
+        kAXTextMarkerForPositionParametrizedAttribute does not work correctly in WK2
+        https://bugs.webkit.org/show_bug.cgi?id=62547
+
+        Implement the missing screenToWindow method for WK2.
+
+        * UIProcess/API/gtk/PageClientImpl.cpp:
+        (WebKit::PageClientImpl::screenToWindow):
+        * UIProcess/API/gtk/PageClientImpl.h:
+        * UIProcess/API/mac/PageClientImpl.h:
+        * UIProcess/API/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::screenToWindow):
+        * UIProcess/API/qt/qwkpage.cpp:
+        (QWKPagePrivate::screenToWindow):
+        * UIProcess/API/qt/qwkpage_p.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::screenToWindow):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/win/WebView.cpp:
+        (WebKit::WebView::screenToWindow):
+        * UIProcess/win/WebView.h:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::screenToWindow):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::screenToWindow):
+        * WebProcess/WebPage/WebPage.h:
+
 2011-06-13  Sam Weinig  <[email protected]>
 
         Reviewed by Darin Adler.

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp (88668 => 88669)


--- trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp	2011-06-13 19:10:16 UTC (rev 88669)
@@ -185,6 +185,12 @@
     return viewRect;
 }
 
+IntPoint PageClientImpl::screenToWindow(const IntPoint& point)
+{
+    notImplemented();
+    return point;
+}
+
 IntRect PageClientImpl::windowToScreen(const IntRect& rect)
 {
     return convertWidgetRectToScreenRect(m_viewWidget, rect);

Modified: trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h (88668 => 88669)


--- trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h	2011-06-13 19:10:16 UTC (rev 88669)
@@ -75,6 +75,7 @@
     virtual void executeUndoRedo(WebPageProxy::UndoOrRedo);
     virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&);
     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
+    virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&);
     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled);
     virtual void didNotHandleKeyEvent(const NativeWebKeyboardEvent&);

Modified: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h (88668 => 88669)


--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h	2011-06-13 19:10:16 UTC (rev 88669)
@@ -79,6 +79,7 @@
 
     virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&);
     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
+    virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&);
     
     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled);

Modified: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm (88668 => 88669)


--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm	2011-06-13 19:10:16 UTC (rev 88669)
@@ -278,6 +278,12 @@
 {
     return [m_wkView _convertToUserSpace:rect];
 }
+   
+IntPoint PageClientImpl::screenToWindow(const IntPoint& point)
+{
+    NSPoint windowCoord = [[m_wkView window] convertScreenToBase:point];
+    return IntPoint([m_wkView convertPoint:windowCoord fromView:nil]);
+}
     
 IntRect PageClientImpl::windowToScreen(const IntRect& rect)
 {

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp (88668 => 88669)


--- trunk/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qwkpage.cpp	2011-06-13 19:10:16 UTC (rev 88669)
@@ -228,6 +228,11 @@
     return rect;
 }
 
+IntPoint QWKPagePrivate::screenToWindow(const IntPoint& point)
+{
+    return point;
+}
+
 IntRect QWKPagePrivate::windowToScreen(const IntRect& rect)
 {
     return rect;

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qwkpage_p.h (88668 => 88669)


--- trunk/Source/WebKit2/UIProcess/API/qt/qwkpage_p.h	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qwkpage_p.h	2011-06-13 19:10:16 UTC (rev 88669)
@@ -78,6 +78,7 @@
     virtual void executeUndoRedo(WebPageProxy::UndoOrRedo);
     virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&);
     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
+    virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&);
 
     virtual void doneWithKeyEvent(const WebKit::NativeWebKeyboardEvent&, bool wasEventHandled);

Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (88668 => 88669)


--- trunk/Source/WebKit2/UIProcess/PageClient.h	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h	2011-06-13 19:10:16 UTC (rev 88669)
@@ -127,6 +127,7 @@
 #endif
     virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) = 0;
     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) = 0;
+    virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) = 0;
     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) = 0;
     
     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) = 0;

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (88668 => 88669)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2011-06-13 19:10:16 UTC (rev 88669)
@@ -2068,7 +2068,12 @@
 {
     newWindowFrame = m_pageClient->convertToUserSpace(m_uiClient.windowFrame(this));
 }
-
+    
+void WebPageProxy::screenToWindow(const IntPoint& screenPoint, IntPoint& windowPoint)
+{
+    windowPoint = m_pageClient->screenToWindow(screenPoint);
+}
+    
 void WebPageProxy::windowToScreen(const IntRect& viewRect, IntRect& result)
 {
     result = m_pageClient->windowToScreen(viewRect);

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (88668 => 88669)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2011-06-13 19:10:16 UTC (rev 88669)
@@ -613,6 +613,7 @@
     void getIsResizable(bool& isResizable);
     void setWindowFrame(const WebCore::FloatRect&);
     void getWindowFrame(WebCore::FloatRect&);
+    void screenToWindow(const WebCore::IntPoint& screenPoint, WebCore::IntPoint& windowPoint);
     void windowToScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
     void runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose);
     void didChangeViewportData(const WebCore::ViewportArguments&);

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (88668 => 88669)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2011-06-13 19:10:16 UTC (rev 88669)
@@ -52,6 +52,7 @@
     GetIsResizable() -> (bool isResizable)
     SetWindowFrame(WebCore::FloatRect windowFrame)
     GetWindowFrame() -> (WebCore::FloatRect windowFrame)
+    ScreenToWindow(WebCore::IntPoint screenPoint) -> (WebCore::IntPoint windowPoint)
     WindowToScreen(WebCore::IntRect rect) -> (WebCore::IntRect screenFrame)
     RunBeforeUnloadConfirmPanel(WTF::String message, uint64_t frameID) -> (bool shouldClose)
     PageDidScroll()

Modified: trunk/Source/WebKit2/UIProcess/win/WebView.cpp (88668 => 88669)


--- trunk/Source/WebKit2/UIProcess/win/WebView.cpp	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/UIProcess/win/WebView.cpp	2011-06-13 19:10:16 UTC (rev 88669)
@@ -1131,6 +1131,11 @@
     return rect;
 }
 
+IntPoint WebView::screenToWindow(const IntPoint& point)
+{
+    return point;
+}
+
 IntRect WebView::windowToScreen(const IntRect& rect)
 {
     return rect;

Modified: trunk/Source/WebKit2/UIProcess/win/WebView.h (88668 => 88669)


--- trunk/Source/WebKit2/UIProcess/win/WebView.h	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/UIProcess/win/WebView.h	2011-06-13 19:10:16 UTC (rev 88669)
@@ -192,6 +192,7 @@
     virtual void executeUndoRedo(WebPageProxy::UndoOrRedo);
     virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&);
     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
+    virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
     virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&);
     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled);
     virtual void compositionSelectionChanged(bool);

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (88668 => 88669)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2011-06-13 19:10:16 UTC (rev 88669)
@@ -407,10 +407,9 @@
 }
 #endif
 
-IntPoint WebChromeClient::screenToWindow(const IntPoint&) const
+IntPoint WebChromeClient::screenToWindow(const IntPoint& point) const
 {
-    notImplemented();
-    return IntPoint();
+    return m_page->screenToWindow(point);
 }
 
 IntRect WebChromeClient::windowToScreen(const IntRect& rect) const

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (88668 => 88669)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2011-06-13 19:10:16 UTC (rev 88669)
@@ -1358,6 +1358,13 @@
 {
     m_userAgent = userAgent;
 }
+  
+IntPoint WebPage::screenToWindow(const IntPoint& point)
+{
+    IntPoint windowPoint;
+    sendSync(Messages::WebPageProxy::ScreenToWindow(point), Messages::WebPageProxy::ScreenToWindow::Reply(windowPoint));
+    return windowPoint;
+}
     
 IntRect WebPage::windowToScreen(const IntRect& rect)
 {

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (88668 => 88669)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2011-06-13 19:09:32 UTC (rev 88668)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2011-06-13 19:10:16 UTC (rev 88669)
@@ -268,6 +268,7 @@
     void installPageOverlay(PassRefPtr<PageOverlay>);
     void uninstallPageOverlay(PageOverlay*, bool fadeOut);
     bool hasPageOverlay() const { return m_pageOverlay; }
+    WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
     WebCore::IntRect windowToScreen(const WebCore::IntRect&);
 
     PassRefPtr<WebImage> snapshotInViewCoordinates(const WebCore::IntRect&, ImageOptions);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to