Title: [106822] branches/safari-534.54-branch/Source

Diff

Modified: branches/safari-534.54-branch/Source/WebCore/ChangeLog (106821 => 106822)


--- branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-02-06 19:13:27 UTC (rev 106821)
+++ branches/safari-534.54-branch/Source/WebCore/ChangeLog	2012-02-06 19:24:50 UTC (rev 106822)
@@ -1,3 +1,53 @@
+2011-02-06  Lucas Forschler  <[email protected]>
+
+    Merge 106678
+
+    2012-02-03  Beth Dakin  <[email protected]>
+
+            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):
+
 2011-02-01  Lucas Forschler  <[email protected]>
 
     Merge 106286

Modified: branches/safari-534.54-branch/Source/WebCore/WebCore.exp.in (106821 => 106822)


--- branches/safari-534.54-branch/Source/WebCore/WebCore.exp.in	2012-02-06 19:13:27 UTC (rev 106821)
+++ branches/safari-534.54-branch/Source/WebCore/WebCore.exp.in	2012-02-06 19:24:50 UTC (rev 106822)
@@ -220,7 +220,7 @@
 __ZN7WebCore11globalPointERK8_NSPointP8NSWindow
 __ZN7WebCore11memoryCacheEv
 __ZN7WebCore11startOfWordERKNS_15VisiblePositionENS_9EWordSideE
-__ZN7WebCore11toUserSpaceERK7_NSRectP8NSWindowf
+__ZN7WebCore11toUserSpaceERK7_NSRectP8NSWindow
 __ZN7WebCore11writeToFileEiPKci
 __ZN7WebCore12ChromeClient20paintCustomScrollbarEPNS_15GraphicsContextERKNS_9FloatRectENS_20ScrollbarControlSizeEjNS_13ScrollbarPartEbffj
 __ZN7WebCore12ChromeClient23paintCustomOverhangAreaEPNS_15GraphicsContextERKNS_7IntRectES5_S5_
@@ -327,7 +327,7 @@
 __ZN7WebCore13TypingCommand39insertParagraphSeparatorInQuotedContentEPNS_8DocumentE
 __ZN7WebCore13createWrapperEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_4NodeE
 __ZN7WebCore13directoryNameERKN3WTF6StringE
-__ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindowf
+__ZN7WebCore13toDeviceSpaceERKNS_9FloatRectEP8NSWindow
 __ZN7WebCore13toHTMLElementEPNS_21FormAssociatedElementE
 __ZN7WebCore13toJSDOMWindowEN3JSC7JSValueE
 __ZN7WebCore14CachedResource12removeClientEPNS_20CachedResourceClientE

Modified: branches/safari-534.54-branch/Source/WebCore/platform/PlatformScreen.h (106821 => 106822)


--- branches/safari-534.54-branch/Source/WebCore/platform/PlatformScreen.h	2012-02-06 19:13:27 UTC (rev 106821)
+++ branches/safari-534.54-branch/Source/WebCore/platform/PlatformScreen.h	2012-02-06 19:24:50 UTC (rev 106822)
@@ -43,21 +43,20 @@
 namespace WebCore {
 
     class FloatRect;
-    class FrameView;
     class Widget;
 
     int screenDepth(Widget*);
     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: branches/safari-534.54-branch/Source/WebCore/platform/mac/PlatformScreenMac.mm (106821 => 106822)


--- branches/safari-534.54-branch/Source/WebCore/platform/mac/PlatformScreenMac.mm	2012-02-06 19:13:27 UTC (rev 106821)
+++ branches/safari-534.54-branch/Source/WebCore/platform/mac/PlatformScreenMac.mm	2012-02-06 19:24:50 UTC (rev 106822)
@@ -28,8 +28,9 @@
 
 #import "FloatRect.h"
 #import "Frame.h"
-#import "FrameView.h"
 #import "Page.h"
+#import "Widget.h"
+#import "NotImplemented.h"
 
 namespace WebCore {
 
@@ -51,16 +52,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)
@@ -76,18 +77,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: branches/safari-534.54-branch/Source/WebCore/platform/win/PlatformScreenWin.cpp (106821 => 106822)


--- branches/safari-534.54-branch/Source/WebCore/platform/win/PlatformScreenWin.cpp	2012-02-06 19:13:27 UTC (rev 106821)
+++ branches/safari-534.54-branch/Source/WebCore/platform/win/PlatformScreenWin.cpp	2012-02-06 19:24:50 UTC (rev 106822)
@@ -93,15 +93,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: branches/safari-534.54-branch/Source/WebKit/mac/ChangeLog (106821 => 106822)


--- branches/safari-534.54-branch/Source/WebKit/mac/ChangeLog	2012-02-06 19:13:27 UTC (rev 106821)
+++ branches/safari-534.54-branch/Source/WebKit/mac/ChangeLog	2012-02-06 19:24:50 UTC (rev 106822)
@@ -1,3 +1,21 @@
+2011-02-06  Lucas Forschler  <[email protected]>
+
+    Merge 106678
+
+    2012-02-03  Beth Dakin  <[email protected]>
+
+            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):
+
 2011-02-01  Lucas Forschler  <[email protected]>
 
     Merge 106271

Modified: branches/safari-534.54-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm (106821 => 106822)


--- branches/safari-534.54-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm	2012-02-06 19:13:27 UTC (rev 106821)
+++ branches/safari-534.54-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm	2012-02-06 19:24:50 UTC (rev 106822)
@@ -154,16 +154,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: branches/safari-534.54-branch/Source/WebKit2/ChangeLog (106821 => 106822)


--- branches/safari-534.54-branch/Source/WebKit2/ChangeLog	2012-02-06 19:13:27 UTC (rev 106821)
+++ branches/safari-534.54-branch/Source/WebKit2/ChangeLog	2012-02-06 19:24:50 UTC (rev 106822)
@@ -1,3 +1,20 @@
+2011-02-06  Lucas Forschler  <[email protected]>
+
+    Merge 106678
+
+    2012-02-03  Beth Dakin  <[email protected]>
+
+            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:]):
+
 2011-02-02  Lucas Forschler  <[email protected]>
 
     Merge 106508

Modified: branches/safari-534.54-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm (106821 => 106822)


--- branches/safari-534.54-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2012-02-06 19:13:27 UTC (rev 106821)
+++ branches/safari-534.54-branch/Source/WebKit2/UIProcess/API/mac/WKView.mm	2012-02-06 19:24:50 UTC (rev 106822)
@@ -2141,12 +2141,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
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to