Title: [106678] trunk/Source
Revision
106678
Author
bda...@apple.com
Date
2012-02-03 11:29:13 -0800 (Fri, 03 Feb 2012)

Log Message

https://bugs.webkit.org/show_bug.cgi?id=77691
Fix PlatformScreen layering violation and PlatformScreenMac's incorrect use 
of device scale

Reviewed by Andy Estes.

Source/WebCore: 

Make screenAvailableRect() and screenRect() take a Widget again instead of a 
FrameView since taking a FrameView is a layering violation.
* WebCore.exp.in:
* platform/PlatformScreen.h:
(WebCore):
* platform/blackberry/PlatformScreenBlackBerry.cpp:
(WebCore::screenAvailableRect):
(WebCore::screenRect):
* platform/chromium/PlatformScreenChromium.cpp:
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/chromium/PlatformSupport.h:
(WebCore):
(PlatformSupport):
* platform/efl/PlatformScreenEfl.cpp:
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/qt/PlatformScreenQt.cpp:
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/win/PlatformScreenWin.cpp:
(WebCore::screenRect):
(WebCore::screenAvailableRect):
* platform/wx/ScreenWx.cpp:
(WebCore::screenRect):
(WebCore::screenAvailableRect):

It's wrong for the deviceScaleFactor to be taken into consideration here at 
all.
* platform/mac/PlatformScreenMac.mm:
(WebCore::screenRect):
(WebCore::screenAvailableRect):
(WebCore::toUserSpace):
(WebCore::toDeviceSpace):

Source/WebKit/chromium: 

These two functions now take a Widget again rather than a FrameView.
* src/PlatformSupport.cpp:
(WebCore::PlatformSupport::screenRect):
(WebCore::PlatformSupport::screenAvailableRect):

Source/WebKit/mac: 

toUserSpace() and toDeviceSpace() don't need to take device scale. Also 
restore a comment that I needlessly removed.
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::setWindowRect):
(WebChromeClient::windowRect):

Source/WebKit2: 

toUserSpace() and toDeviceSpace() don't need to take device scale.
* UIProcess/API/mac/WKView.mm:
(-[WKView _convertToDeviceSpace:]):
(-[WKView _convertToUserSpace:]):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (106677 => 106678)


--- trunk/Source/WebCore/ChangeLog	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebCore/ChangeLog	2012-02-03 19:29:13 UTC (rev 106678)
@@ -1,3 +1,49 @@
+2012-02-03  Beth Dakin  <bda...@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=77691
+        Fix PlatformScreen layering violation and PlatformScreenMac's incorrect use 
+        of device scale
+
+        Reviewed by Andy Estes.
+
+        Make screenAvailableRect() and screenRect() take a Widget again instead of a 
+        FrameView since taking a FrameView is a layering violation.
+        * WebCore.exp.in:
+        * platform/PlatformScreen.h:
+        (WebCore):
+        * platform/blackberry/PlatformScreenBlackBerry.cpp:
+        (WebCore::screenAvailableRect):
+        (WebCore::screenRect):
+        * platform/chromium/PlatformScreenChromium.cpp:
+        (WebCore::screenRect):
+        (WebCore::screenAvailableRect):
+        * platform/chromium/PlatformSupport.h:
+        (WebCore):
+        (PlatformSupport):
+        * platform/efl/PlatformScreenEfl.cpp:
+        (WebCore::screenRect):
+        (WebCore::screenAvailableRect):
+        * platform/gtk/PlatformScreenGtk.cpp:
+        (WebCore::screenRect):
+        (WebCore::screenAvailableRect):
+        * platform/qt/PlatformScreenQt.cpp:
+        (WebCore::screenRect):
+        (WebCore::screenAvailableRect):
+        * platform/win/PlatformScreenWin.cpp:
+        (WebCore::screenRect):
+        (WebCore::screenAvailableRect):
+        * platform/wx/ScreenWx.cpp:
+        (WebCore::screenRect):
+        (WebCore::screenAvailableRect):
+
+        It's wrong for the deviceScaleFactor to be taken into consideration here at 
+        all.
+        * platform/mac/PlatformScreenMac.mm:
+        (WebCore::screenRect):
+        (WebCore::screenAvailableRect):
+        (WebCore::toUserSpace):
+        (WebCore::toDeviceSpace):
+
 2012-02-03  Dan Bernstein  <m...@apple.com>
 
         <rdar://problem/10352073> Floating image leaves hole in previous column when wrapped to next column

Modified: trunk/Source/WebCore/WebCore.exp.in (106677 => 106678)


--- trunk/Source/WebCore/WebCore.exp.in	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebCore/WebCore.exp.in	2012-02-03 19:29:13 UTC (rev 106678)
@@ -220,7 +220,7 @@
 __ZN7WebCore11globalPointERK8_NSPointP8NSWindow
 __ZN7WebCore11memoryCacheEv
 __ZN7WebCore11startOfWordERKNS_15VisiblePositionENS_9EWordSideE
-__ZN7WebCore11toUserSpaceERK7_NSRectP8NSWindowf
+__ZN7WebCore11toUserSpaceERK7_NSRectP8NSWindow
 __ZN7WebCore11writeToFileEiPKci
 __ZN7WebCore12ChromeClient23paintCustomOverhangAreaEPNS_15GraphicsContextERKNS_7IntRectES5_S5_
 __ZN7WebCore12EditingStyleD1Ev
@@ -329,7 +329,7 @@
 __ZN7WebCore13TypingCommand39insertParagraphSeparatorInQuotedContentEPNS_8DocumentE
 __ZN7WebCore13createWrapperEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_4NodeE
 __ZN7WebCore13directoryNameERKN3WTF6StringE
-__ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindowf
+__ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow
 __ZN7WebCore13toHTMLElementEPNS_21FormAssociatedElementE
 __ZN7WebCore13toJSDOMWindowEN3JSC7JSValueE
 __ZN7WebCore14CachedResource12removeClientEPNS_20CachedResourceClientE

Modified: trunk/Source/WebCore/platform/PlatformScreen.h (106677 => 106678)


--- trunk/Source/WebCore/platform/PlatformScreen.h	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebCore/platform/PlatformScreen.h	2012-02-03 19:29:13 UTC (rev 106678)
@@ -40,7 +40,6 @@
 namespace WebCore {
 
     class FloatRect;
-    class FrameView;
     class Widget;
 
     int screenHorizontalDPI(Widget*);
@@ -49,14 +48,14 @@
     int screenDepthPerComponent(Widget*);
     bool screenIsMonochrome(Widget*);
 
-    FloatRect screenRect(FrameView*);
-    FloatRect screenAvailableRect(FrameView*);
+    FloatRect screenRect(Widget*);
+    FloatRect screenAvailableRect(Widget*);
 
 #if PLATFORM(MAC)
     NSScreen *screenForWindow(NSWindow *);
 
-    FloatRect toUserSpace(const NSRect&, NSWindow *destination, float deviceScaleFactor);
-    NSRect toDeviceSpace(const FloatRect&, NSWindow *source, float deviceScaleFactor);
+    FloatRect toUserSpace(const NSRect&, NSWindow *destination);
+    NSRect toDeviceSpace(const FloatRect&, NSWindow *source);
 
     NSPoint flipScreenPoint(const NSPoint&, NSScreen *);
 #endif

Modified: trunk/Source/WebCore/platform/blackberry/PlatformScreenBlackBerry.cpp (106677 => 106678)


--- trunk/Source/WebCore/platform/blackberry/PlatformScreenBlackBerry.cpp	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebCore/platform/blackberry/PlatformScreenBlackBerry.cpp	2012-02-03 19:29:13 UTC (rev 106678)
@@ -20,7 +20,6 @@
 #include "PlatformScreen.h"
 
 #include "FloatRect.h"
-#include "FrameView.h"
 #include "Widget.h"
 
 #include <BlackBerryPlatformScreen.h>
@@ -42,12 +41,12 @@
     return 24;
 }
 
-FloatRect screenAvailableRect(FrameView* frameView)
+FloatRect screenAvailableRect(Widget* widget)
 {
     return FloatRect(FloatPoint(), FloatSize(IntSize(BlackBerry::Platform::Graphics::Screen::size())));
 }
 
-FloatRect screenRect(FrameView* frameView)
+FloatRect screenRect(Widget* widget)
 {
     return FloatRect(FloatPoint(), FloatSize(IntSize(BlackBerry::Platform::Graphics::Screen::size())));
 }

Modified: trunk/Source/WebCore/platform/chromium/PlatformScreenChromium.cpp (106677 => 106678)


--- trunk/Source/WebCore/platform/chromium/PlatformScreenChromium.cpp	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebCore/platform/chromium/PlatformScreenChromium.cpp	2012-02-03 19:29:13 UTC (rev 106678)
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "PlatformScreen.h"
 
-#include "FrameView.h"
 #include "IntRect.h"
 #include "PlatformSupport.h"
 
@@ -62,14 +61,14 @@
     return PlatformSupport::screenIsMonochrome(widget);
 }
 
-FloatRect screenRect(FrameView* frameView)
+FloatRect screenRect(Widget* widget)
 {
-    return PlatformSupport::screenRect(frameView);
+    return PlatformSupport::screenRect(widget);
 }
 
-FloatRect screenAvailableRect(FrameView* frameView)
+FloatRect screenAvailableRect(Widget* widget)
 {
-    return PlatformSupport::screenAvailableRect(frameView);
+    return PlatformSupport::screenAvailableRect(widget);
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/chromium/PlatformSupport.h (106677 => 106678)


--- trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-02-03 19:29:13 UTC (rev 106678)
@@ -71,7 +71,6 @@
 class Cursor;
 class Document;
 class Frame;
-class FrameView;
 class GamepadList;
 class GeolocationServiceBridge;
 class GeolocationServiceChromium;
@@ -246,8 +245,8 @@
     static int screenDepth(Widget*);
     static int screenDepthPerComponent(Widget*);
     static bool screenIsMonochrome(Widget*);
-    static IntRect screenRect(FrameView*);
-    static IntRect screenAvailableRect(FrameView*);
+    static IntRect screenRect(Widget*);
+    static IntRect screenAvailableRect(Widget*);
 
     // SharedTimers -------------------------------------------------------
     static void setSharedTimerFiredFunction(void (*func)());

Modified: trunk/Source/WebCore/platform/efl/PlatformScreenEfl.cpp (106677 => 106678)


--- trunk/Source/WebCore/platform/efl/PlatformScreenEfl.cpp	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebCore/platform/efl/PlatformScreenEfl.cpp	2012-02-03 19:29:13 UTC (rev 106678)
@@ -34,7 +34,6 @@
 #include "config.h"
 #include "PlatformScreen.h"
 
-#include "FrameView.h"
 #include "NotImplemented.h"
 #include "PlatformString.h"
 #include "Widget.h"
@@ -74,23 +73,23 @@
     return false;
 }
 
-FloatRect screenRect(FrameView* frameView)
+FloatRect screenRect(Widget* widget)
 {
-    if (!frameView)
+    if (!widget)
         return FloatRect();
 
     int x, y, w, h;
-    Evas* e = frameView->evas();
+    Evas* e = widget->evas();
 
     ecore_evas_screen_geometry_get(ecore_evas_ecore_evas_get(e), &x, &y, &w, &h);
 
     return FloatRect(x, y, w, h);
 }
 
-FloatRect screenAvailableRect(FrameView* frameView)
+FloatRect screenAvailableRect(Widget* widget)
 {
     notImplemented();
-    return screenRect(frameView);
+    return screenRect(widget);
 }
 
 }

Modified: trunk/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp (106677 => 106678)


--- trunk/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebCore/platform/gtk/PlatformScreenGtk.cpp	2012-02-03 19:29:13 UTC (rev 106678)
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "PlatformScreen.h"
 
-#include "FrameView.h"
 #include "GtkVersioning.h"
 #include "HostWindow.h"
 #include "NotImplemented.h"
@@ -101,9 +100,9 @@
     return gtk_widget_has_screen(widget) ? gtk_widget_get_screen(widget) : gdk_screen_get_default();
 }
 
-FloatRect screenRect(FrameView* frameView)
+FloatRect screenRect(Widget* widget)
 {
-    GtkWidget* container = frameView ? GTK_WIDGET(frameView->root()->hostWindow()->platformPageClient()) : 0;
+    GtkWidget* container = widget ? GTK_WIDGET(widget->root()->hostWindow()->platformPageClient()) : 0;
     if (container)
         container = getToplevel(container);
 
@@ -119,11 +118,11 @@
     return FloatRect(geometry.x, geometry.y, geometry.width, geometry.height);
 }
 
-FloatRect screenAvailableRect(FrameView* frameView)
+FloatRect screenAvailableRect(Widget* widget)
 {
-    GtkWidget* container = frameView ? GTK_WIDGET(frameView->root()->hostWindow()->platformPageClient()) : 0;
+    GtkWidget* container = widget ? GTK_WIDGET(widget->root()->hostWindow()->platformPageClient()) : 0;
     if (container && !gtk_widget_get_realized(container))
-        return screenRect(frameView);
+        return screenRect(widget);
 
     GdkScreen* screen = container ? getScreen(container) : gdk_screen_get_default();
     if (!screen)

Modified: trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm (106677 => 106678)


--- trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebCore/platform/mac/PlatformScreenMac.mm	2012-02-03 19:29:13 UTC (rev 106678)
@@ -28,8 +28,8 @@
 
 #import "FloatRect.h"
 #import "Frame.h"
-#import "FrameView.h"
 #import "Page.h"
+#import "Widget.h"
 #import "NotImplemented.h"
 
 namespace WebCore {
@@ -64,16 +64,16 @@
 // These functions scale between screen and page coordinates because _javascript_/DOM operations 
 // assume that the screen and the page share the same coordinate system.
 
-FloatRect screenRect(FrameView* frameView)
+FloatRect screenRect(Widget* widget)
 {
-    NSWindow *window = frameView ? [frameView->platformWidget() window] : nil;
-    return toUserSpace([screenForWindow(window) frame], window, WebCore::deviceScaleFactor(frameView->frame()));
+    NSWindow *window = widget ? [widget->platformWidget() window] : nil;
+    return toUserSpace([screenForWindow(window) frame], window);
 }
 
-FloatRect screenAvailableRect(FrameView* frameView)
+FloatRect screenAvailableRect(Widget* widget)
 {
-    NSWindow *window = frameView ? [frameView->platformWidget() window] : nil;
-    return toUserSpace([screenForWindow(window) visibleFrame], window, WebCore::deviceScaleFactor(frameView->frame()));
+    NSWindow *window = widget ? [widget->platformWidget() window] : nil;
+    return toUserSpace([screenForWindow(window) visibleFrame], window);
 }
 
 NSScreen *screenForWindow(NSWindow *window)
@@ -89,18 +89,16 @@
     return nil;
 }
 
-FloatRect toUserSpace(const NSRect& rect, NSWindow *destination, float deviceScaleFactor)
+FloatRect toUserSpace(const NSRect& rect, NSWindow *destination)
 {
     FloatRect userRect = rect;
     userRect.setY(NSMaxY([screenForWindow(destination) frame]) - (userRect.y() + userRect.height())); // flip
-    userRect.scale(1 / deviceScaleFactor); // scale down
     return userRect;
 }
 
-NSRect toDeviceSpace(const FloatRect& rect, NSWindow *source, float deviceScaleFactor)
+NSRect toDeviceSpace(const FloatRect& rect, NSWindow *source)
 {
     FloatRect deviceRect = rect;
-    deviceRect.scale(deviceScaleFactor); // scale up
     deviceRect.setY(NSMaxY([screenForWindow(source) frame]) - (deviceRect.y() + deviceRect.height())); // flip
     return deviceRect;
 }

Modified: trunk/Source/WebCore/platform/qt/PlatformScreenQt.cpp (106677 => 106678)


--- trunk/Source/WebCore/platform/qt/PlatformScreenQt.cpp	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebCore/platform/qt/PlatformScreenQt.cpp	2012-02-03 19:29:13 UTC (rev 106678)
@@ -102,15 +102,15 @@
     return QApplication::desktop()->screen(screenNumber(w))->colorCount() == 2;
 }
 
-FloatRect screenRect(FrameView* frameView)
+FloatRect screenRect(Widget* widget)
 {
-    QRect r = QApplication::desktop()->screenGeometry(screenNumber(frameView));
+    QRect r = QApplication::desktop()->screenGeometry(screenNumber(widget));
     return FloatRect(r.x(), r.y(), r.width(), r.height());
 }
 
-FloatRect screenAvailableRect(FrameView* frameView)
+FloatRect screenAvailableRect(Widget* widget)
 {
-    QRect r = QApplication::desktop()->availableGeometry(screenNumber(frameView));
+    QRect r = QApplication::desktop()->availableGeometry(screenNumber(widget));
     return FloatRect(r.x(), r.y(), r.width(), r.height());
 }
 

Modified: trunk/Source/WebCore/platform/win/PlatformScreenWin.cpp (106677 => 106678)


--- trunk/Source/WebCore/platform/win/PlatformScreenWin.cpp	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebCore/platform/win/PlatformScreenWin.cpp	2012-02-03 19:29:13 UTC (rev 106678)
@@ -106,15 +106,15 @@
 #endif
 }
 
-FloatRect screenRect(FrameView* frameView)
+FloatRect screenRect(Widget* widget)
 {
-    MONITORINFOEX monitorInfo = monitorInfoForWidget(frameView);
+    MONITORINFOEX monitorInfo = monitorInfoForWidget(widget);
     return monitorInfo.rcMonitor;
 }
 
-FloatRect screenAvailableRect(FrameView* frameView)
+FloatRect screenAvailableRect(Widget* widget)
 {
-    MONITORINFOEX monitorInfo = monitorInfoForWidget(frameView);
+    MONITORINFOEX monitorInfo = monitorInfoForWidget(widget);
     return monitorInfo.rcWork;
 }
 

Modified: trunk/Source/WebCore/platform/wx/ScreenWx.cpp (106677 => 106678)


--- trunk/Source/WebCore/platform/wx/ScreenWx.cpp	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebCore/platform/wx/ScreenWx.cpp	2012-02-03 19:29:13 UTC (rev 106678)
@@ -28,7 +28,6 @@
 #include "Screen.h"
 #include "IntRect.h"
 #include "FloatRect.h"
-#include "FrameView.h"
 #include "NotImplemented.h"
 #include "Widget.h"
 
@@ -49,7 +48,7 @@
     return 0;
 }
     
-FloatRect screenRect(FrameView* frameView)
+FloatRect screenRect(Widget* widget)
 {
 /*
     int displayNum;
@@ -78,7 +77,7 @@
     return wxColourDisplay();
 }
 
-FloatRect screenAvailableRect(FrameView* frameView)
+FloatRect screenAvailableRect(Widget* widget)
 {
 /*
     Widget* widget = widget->widget();

Modified: trunk/Source/WebKit/chromium/ChangeLog (106677 => 106678)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-02-03 19:29:13 UTC (rev 106678)
@@ -1,3 +1,16 @@
+2012-02-03  Beth Dakin  <bda...@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=77691
+        Fix PlatformScreen layering violation and PlatformScreenMac's incorrect use 
+        of device scale
+
+        Reviewed by Andy Estes.
+
+        These two functions now take a Widget again rather than a FrameView.
+        * src/PlatformSupport.cpp:
+        (WebCore::PlatformSupport::screenRect):
+        (WebCore::PlatformSupport::screenAvailableRect):
+
 2012-02-03  John Knottenbelt  <jknot...@chromium.org>
 
         [skia] Fix unit test PlatformContextSkiaTest.trackOpaqueOvalTest

Modified: trunk/Source/WebKit/chromium/src/PlatformSupport.cpp (106677 => 106678)


--- trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-02-03 19:29:13 UTC (rev 106678)
@@ -1092,17 +1092,17 @@
     return client->screenInfo().isMonochrome;
 }
 
-IntRect PlatformSupport::screenRect(FrameView* frameView)
+IntRect PlatformSupport::screenRect(Widget* widget)
 {
-    WebWidgetClient* client = toWebWidgetClient(frameView);
+    WebWidgetClient* client = toWebWidgetClient(widget);
     if (!client)
         return IntRect();
     return client->screenInfo().rect;
 }
 
-IntRect PlatformSupport::screenAvailableRect(FrameView* frameView)
+IntRect PlatformSupport::screenAvailableRect(Widget* widget)
 {
-    WebWidgetClient* client = toWebWidgetClient(frameView);
+    WebWidgetClient* client = toWebWidgetClient(widget);
     if (!client)
         return IntRect();
     return client->screenInfo().availableRect;

Modified: trunk/Source/WebKit/mac/ChangeLog (106677 => 106678)


--- trunk/Source/WebKit/mac/ChangeLog	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebKit/mac/ChangeLog	2012-02-03 19:29:13 UTC (rev 106678)
@@ -1,3 +1,17 @@
+2012-02-03  Beth Dakin  <bda...@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=77691
+        Fix PlatformScreen layering violation and PlatformScreenMac's incorrect use 
+        of device scale
+
+        Reviewed by Andy Estes.
+
+        toUserSpace() and toDeviceSpace() don't need to take device scale. Also 
+        restore a comment that I needlessly removed.
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::setWindowRect):
+        (WebChromeClient::windowRect):
+
 2012-02-01  Dan Bernstein  <m...@apple.com>
 
         WebKit/mac part of <rdar://problem/10442663> Paginated display does not respect page-break-{before,after}

Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm (106677 => 106678)


--- trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm	2012-02-03 19:29:13 UTC (rev 106678)
@@ -150,16 +150,19 @@
     delete this;
 }
 
+// These functions scale between window and WebView coordinates because _javascript_/DOM operations 
+// assume that the WebView and the window share the same coordinate system.
+
 void WebChromeClient::setWindowRect(const FloatRect& rect)
 {
-    NSRect windowRect = toDeviceSpace(rect, [m_webView window], [m_webView _backingScaleFactor]);
+    NSRect windowRect = toDeviceSpace(rect, [m_webView window]);
     [[m_webView _UIDelegateForwarder] webView:m_webView setFrame:windowRect];
 }
 
 FloatRect WebChromeClient::windowRect()
 {
     NSRect windowRect = [[m_webView _UIDelegateForwarder] webViewFrame:m_webView];
-    return toUserSpace(windowRect, [m_webView window], [m_webView _backingScaleFactor]);
+    return toUserSpace(windowRect, [m_webView window]);
 }
 
 // FIXME: We need to add API for setting and getting this.

Modified: trunk/Source/WebKit2/ChangeLog (106677 => 106678)


--- trunk/Source/WebKit2/ChangeLog	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebKit2/ChangeLog	2012-02-03 19:29:13 UTC (rev 106678)
@@ -1,3 +1,16 @@
+2012-02-03  Beth Dakin  <bda...@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=77691
+        Fix PlatformScreen layering violation and PlatformScreenMac's incorrect use 
+        of device scale
+
+        Reviewed by Andy Estes.
+
+        toUserSpace() and toDeviceSpace() don't need to take device scale.
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _convertToDeviceSpace:]):
+        (-[WKView _convertToUserSpace:]):
+
 2012-02-03  No'am Rosenthal  <noam.rosent...@nokia.com>
 
         [Qt][Texmap] Refactor TextureMapper API to use ImageBuffers when possible.

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (106677 => 106678)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2012-02-03 19:27:57 UTC (rev 106677)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2012-02-03 19:29:13 UTC (rev 106678)
@@ -2279,12 +2279,12 @@
 
 - (NSRect)_convertToDeviceSpace:(NSRect)rect
 {
-    return toDeviceSpace(rect, [self window], _data->_page->deviceScaleFactor());
+    return toDeviceSpace(rect, [self window]);
 }
 
 - (NSRect)_convertToUserSpace:(NSRect)rect
 {
-    return toUserSpace(rect, [self window], _data->_page->deviceScaleFactor());
+    return toUserSpace(rect, [self window]);
 }
 
 // Any non-zero value will do, but using something recognizable might help us debug some day.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to