AX: Webkit2 not sending UAZoomFocusChanged notifications
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Mar 2011 18:18:51 +0000 (18:18 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Mar 2011 18:18:51 +0000 (18:18 +0000)
https://bugs.webkit.org/show_bug.cgi?id=55916

Reviewed by Darin Adler.

Needed to implement the windowToScreen() method so that the right frame
could be calculated to send for zoom focus changes.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@80569 268f45cc-cd09-0410-ab3c-d52691b4dbfc

14 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/API/qt/qwkpage.cpp
Source/WebKit2/UIProcess/API/qt/qwkpage_p.h
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/win/WebView.cpp
Source/WebKit2/UIProcess/win/WebView.h
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h

index 486984c..b0b52bf 100644 (file)
@@ -1,3 +1,33 @@
+2011-03-08  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        AX: Webkit2 not sending UAZoomFocusChanged notifications
+        https://bugs.webkit.org/show_bug.cgi?id=55916
+
+        Needed to implement the windowToScreen() method so that the right frame
+        could be calculated to send for zoom focus changes.
+
+        * UIProcess/API/mac/PageClientImpl.h:
+        * UIProcess/API/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::windowToScreen):
+        * UIProcess/API/qt/qwkpage.cpp:
+        (QWKPagePrivate::windowToScreen):
+        * UIProcess/API/qt/qwkpage_p.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::windowToScreen):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/win/WebView.cpp:
+        (WebKit::WebView::windowToScreen):
+        * UIProcess/win/WebView.h:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::windowToScreen):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::windowToScreen):
+        * WebProcess/WebPage/WebPage.h:
+
 2011-03-08  John Sullivan  <sullivan@apple.com>
 
         Reviewed by Darin Adler.
index e01cf66..51b6461 100644 (file)
@@ -74,7 +74,8 @@ private:
 
     virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&);
     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
-
+    virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&);
+    
     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled);
 
     virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
index 88bb9a4..81859dc 100644 (file)
@@ -303,6 +303,14 @@ FloatRect PageClientImpl::convertToUserSpace(const FloatRect& rect)
 {
     return [m_wkView _convertToUserSpace:rect];
 }
+    
+IntRect PageClientImpl::windowToScreen(const IntRect& rect)
+{
+    NSRect tempRect = rect;
+    tempRect = [m_wkView convertRect:tempRect toView:nil];
+    tempRect.origin = [[m_wkView window] convertBaseToScreen:tempRect.origin];
+    return enclosingIntRect(tempRect);
+}
 
 void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool wasEventHandled)
 {
index 05c7b8b..ebab5db 100644 (file)
@@ -222,6 +222,11 @@ FloatRect QWKPagePrivate::convertToDeviceSpace(const FloatRect& rect)
     return rect;
 }
 
+IntRect QWKPagePrivate::windowToScreen(const IntRect& rect)
+{
+    return rect;
+}
+
 FloatRect QWKPagePrivate::convertToUserSpace(const FloatRect& rect)
 {
     return rect;
index 1a626a1..ba6c8d1 100644 (file)
@@ -77,6 +77,8 @@ public:
     virtual void clearAllEditCommands();
     virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&);
     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
+    virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&);
+
     virtual void doneWithKeyEvent(const WebKit::NativeWebKeyboardEvent&, bool wasEventHandled);
     virtual void selectionChanged(bool, bool, bool, bool);
     virtual PassRefPtr<WebKit::WebPopupMenuProxy> createPopupMenuProxy(WebKit::WebPageProxy*);
index 59e02ca..765885e 100644 (file)
@@ -107,7 +107,8 @@ public:
 #endif
     virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&) = 0;
     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&) = 0;
-
+    virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) = 0;
+    
     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) = 0;
 
     virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*) = 0;
index 3813a39..76e9597 100644 (file)
@@ -1889,6 +1889,11 @@ void WebPageProxy::getWindowFrame(FloatRect& newWindowFrame)
     newWindowFrame = m_pageClient->convertToUserSpace(m_uiClient.windowFrame(this));
 }
 
+void WebPageProxy::windowToScreen(const IntRect& viewRect, IntRect& result)
+{
+    result = m_pageClient->windowToScreen(viewRect);
+}
+    
 void WebPageProxy::runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose)
 {
     WebFrameProxy* frame = process()->webFrame(frameID);
index ce56cea..b6bcd08 100644 (file)
@@ -534,6 +534,7 @@ private:
     void getIsResizable(bool& isResizable);
     void setWindowFrame(const WebCore::FloatRect&);
     void getWindowFrame(WebCore::FloatRect&);
+    void windowToScreen(const WebCore::IntRect& viewRect, WebCore::IntRect& result);
     void runBeforeUnloadConfirmPanel(const String& message, uint64_t frameID, bool& shouldClose);
     void didChangeViewportData(const WebCore::ViewportArguments&);
     void pageDidScroll();
index 8692f14..c481126 100644 (file)
@@ -48,6 +48,7 @@ messages -> WebPageProxy {
     GetIsResizable() -> (bool isResizable)
     SetWindowFrame(WebCore::FloatRect windowFrame)
     GetWindowFrame() -> (WebCore::FloatRect windowFrame)
+    WindowToScreen(WebCore::IntRect rect) -> (WebCore::IntRect screenFrame)
     RunBeforeUnloadConfirmPanel(WTF::String message, uint64_t frameID) -> (bool shouldClose)
     PageDidScroll()
     RunOpenPanel(uint64_t frameID, WebKit::WebOpenPanelParameters::Data parameters)
index 62e0c42..7cee0d1 100644 (file)
@@ -806,6 +806,11 @@ FloatRect WebView::convertToDeviceSpace(const FloatRect& rect)
     return rect;
 }
 
+IntRect WebView::windowToScreen(const IntRect& rect)
+{
+    return rect;
+}
+
 FloatRect WebView::convertToUserSpace(const FloatRect& rect)
 {
     return rect;
index 28aedd6..d2b79a0 100644 (file)
@@ -151,6 +151,7 @@ private:
     virtual void clearAllEditCommands();
     virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&);
     virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
+    virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&);
     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled);
     virtual void compositionSelectionChanged(bool);
     virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
index d4c357d..dd0a356 100644 (file)
@@ -385,10 +385,9 @@ IntPoint WebChromeClient::screenToWindow(const IntPoint&) const
     return IntPoint();
 }
 
-IntRect WebChromeClient::windowToScreen(const IntRect&) const
+IntRect WebChromeClient::windowToScreen(const IntRect& rect) const
 {
-    notImplemented();
-    return IntRect();
+    return m_page->windowToScreen(rect);
 }
 
 PlatformPageClient WebChromeClient::platformPageClient() const
index ff567bd..d160f86 100644 (file)
@@ -1176,6 +1176,13 @@ void WebPage::setUserAgent(const String& userAgent)
 {
     m_userAgent = userAgent;
 }
+    
+IntRect WebPage::windowToScreen(const IntRect& rect)
+{
+    IntRect screenRect;
+    sendSync(Messages::WebPageProxy::WindowToScreen(rect), Messages::WebPageProxy::WindowToScreen::Reply(screenRect));
+    return screenRect;
+}
 
 IntRect WebPage::windowResizerRect() const
 {
index 8ce6405..270ec98 100644 (file)
@@ -238,6 +238,7 @@ public:
     void installPageOverlay(PassRefPtr<PageOverlay>);
     void uninstallPageOverlay(PageOverlay*);
     bool hasPageOverlay() const { return m_pageOverlay; }
+    WebCore::IntRect windowToScreen(const WebCore::IntRect&);
 
     PassRefPtr<WebImage> snapshotInViewCoordinates(const WebCore::IntRect&, ImageOptions);
     PassRefPtr<WebImage> snapshotInDocumentCoordinates(const WebCore::IntRect&, ImageOptions);