[mac] WKTR windows still don't stay off screen sometimes
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jun 2012 22:45:18 +0000 (22:45 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jun 2012 22:45:18 +0000 (22:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=90214
<rdar://problem/11760263>

Reviewed by Simon Fraser.

In some cases, the system itself will consult [WebKitTestRunnerWindow frame], so we should refrain from
overriding it and instead provide a different method to use when we want the web-facing "fake" window origin
(for PlatformWebView::windowFrame()).

* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(-[WebKitTestRunnerWindow frameRespectingFakeOrigin]):
(WTR::PlatformWebView::windowFrame):

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

Tools/ChangeLog
Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm

index 0fda680..d4bc177 100644 (file)
@@ -1,3 +1,19 @@
+2012-06-28  Tim Horton  <timothy_horton@apple.com>
+
+        [mac] WKTR windows still don't stay off screen sometimes
+        https://bugs.webkit.org/show_bug.cgi?id=90214
+        <rdar://problem/11760263>
+
+        Reviewed by Simon Fraser.
+
+        In some cases, the system itself will consult [WebKitTestRunnerWindow frame], so we should refrain from
+        overriding it and instead provide a different method to use when we want the web-facing "fake" window origin
+        (for PlatformWebView::windowFrame()).
+
+        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+        (-[WebKitTestRunnerWindow frameRespectingFakeOrigin]):
+        (WTR::PlatformWebView::windowFrame):
+
 2012-06-28  Martin Robinson  <mrobinson@igalia.com>
 
         [GTK] Add unit tests for GtkInputMethodFilter
index d8b5bf7..c9bcc3d 100644 (file)
     [super setFrame:NSMakeRect(currentFrame.origin.x, currentFrame.origin.y, windowFrame.size.width, windowFrame.size.height) display:displayViews];
 }
 
-- (NSRect)frame
+- (NSRect)frameRespectingFakeOrigin
 {
-    NSRect currentFrame = [super frame];
+    NSRect currentFrame = [self frame];
 
     if (_shouldUseFakeOrigin)
         return NSMakeRect(_fakeOrigin.x, _fakeOrigin.y, currentFrame.size.width, currentFrame.size.height);
 
     return currentFrame;
 }
+
 @end
 
 namespace WTR {
@@ -126,7 +127,7 @@ void PlatformWebView::focus()
 
 WKRect PlatformWebView::windowFrame()
 {
-    NSRect frame = [m_window frame];
+    NSRect frame = [m_window frameRespectingFakeOrigin];
 
     WKRect wkFrame;
     wkFrame.origin.x = frame.origin.x;