REGRESSION(r145169): [Mac][WK2] http/tests/security/cross-frame-access-put.html fails.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Mar 2013 03:30:26 +0000 (03:30 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Mar 2013 03:30:26 +0000 (03:30 +0000)
<http://webkit.org/b/111815>
<rdar://problem/13380145>

Reviewed by Anders Carlsson.

Source/WebKit2:

Call getWindowFrame() to see if the UI client wants to override the window frame before sending
a WindowAndViewFramesChanged message to the web process.
This fixes a glitch in WTR and the Web Inspector where incorrect window frames were being used.

* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::windowAndViewFramesChanged):

Tools:

Add PlatformWebView::didInitializeClients() and call it after setting up all the clients
after creating a PlatformWebView. Otherwise, the initial WindowAndViewFramesChanged message
will be sent before there's a UI client set up to adjust the frame with WTR's fake origin.

* WebKitTestRunner/PlatformWebView.h:
(PlatformWebView):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::createWebViewWithOptions):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::didInitializeClients):

LayoutTests:

* platform/mac-wk2/TestExpectations:

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

12 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm
Tools/ChangeLog
Tools/WebKitTestRunner/PlatformWebView.h
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp
Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp
Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp

index 79011f8..06a646d 100644 (file)
@@ -1,3 +1,13 @@
+2013-03-14  Andreas Kling  <akling@apple.com>
+
+        REGRESSION(r145169): [Mac][WK2] http/tests/security/cross-frame-access-put.html fails.
+        <http://webkit.org/b/111815>
+        <rdar://problem/13380145>
+
+        Reviewed by Anders Carlsson.
+
+        * platform/mac-wk2/TestExpectations:
+
 2013-03-14  John Bauman  <jbauman@chromium.org>
 
         plugins/plugin-clip-subframe.html is flaky
index fe56897..f0899a4 100644 (file)
@@ -317,8 +317,6 @@ webkit.org/b/107356 fast/css/sticky/sticky-top-zoomed.html [ ImageOnlyFailure ]
 
 webkit.org/b/109890 [ Debug ] platform/mac-wk2/plugins/destroy-during-async-npp-new.html [ Crash ]
 
-webkit.org/b/111815 http/tests/security/cross-frame-access-put.html [ Failure ]
-
 ### END OF (1) Classified failures with bug reports
 ########################################
 
index ad58597..2682506 100644 (file)
@@ -1,3 +1,18 @@
+2013-03-14  Andreas Kling  <akling@apple.com>
+
+        REGRESSION(r145169): [Mac][WK2] http/tests/security/cross-frame-access-put.html fails.
+        <http://webkit.org/b/111815>
+        <rdar://problem/13380145>
+
+        Reviewed by Anders Carlsson.
+
+        Call getWindowFrame() to see if the UI client wants to override the window frame before sending
+        a WindowAndViewFramesChanged message to the web process.
+        This fixes a glitch in WTR and the Web Inspector where incorrect window frames were being used.
+
+        * UIProcess/mac/WebPageProxyMac.mm:
+        (WebKit::WebPageProxy::windowAndViewFramesChanged):
+
 2013-03-14  Andy Estes  <aestes@apple.com>
 
         [WebKit2] Only preprocess sandbox profiles if we're building for the OS X SDK
index 80c157d..7b0b750 100644 (file)
@@ -143,7 +143,13 @@ void WebPageProxy::windowAndViewFramesChanged(const FloatRect& windowFrameInScre
     if (!isValid())
         return;
 
-    process()->send(Messages::WebPage::WindowAndViewFramesChanged(windowFrameInScreenCoordinates, viewFrameInWindowCoordinates, accessibilityViewCoordinates), m_pageID);
+    // If the UI client overrides getWindowFrame(), we call it here to make sure we send the appropriate window frame.  
+    FloatRect adjustedWindowFrameInScreenCoordinates;
+    getWindowFrame(adjustedWindowFrameInScreenCoordinates);
+    if (adjustedWindowFrameInScreenCoordinates.isEmpty())
+        adjustedWindowFrameInScreenCoordinates = windowFrameInScreenCoordinates;
+
+    process()->send(Messages::WebPage::WindowAndViewFramesChanged(adjustedWindowFrameInScreenCoordinates, viewFrameInWindowCoordinates, accessibilityViewCoordinates), m_pageID);
 }
 
 void WebPageProxy::viewExposedRectChanged(const FloatRect& exposedRect)
index 649cc22..889be20 100644 (file)
@@ -1,3 +1,23 @@
+2013-03-14  Andreas Kling  <akling@apple.com>
+
+        REGRESSION(r145169): [Mac][WK2] http/tests/security/cross-frame-access-put.html fails.
+        <http://webkit.org/b/111815>
+        <rdar://problem/13380145>
+
+        Reviewed by Anders Carlsson.
+
+        Add PlatformWebView::didInitializeClients() and call it after setting up all the clients
+        after creating a PlatformWebView. Otherwise, the initial WindowAndViewFramesChanged message
+        will be sent before there's a UI client set up to adjust the frame with WTR's fake origin.
+
+        * WebKitTestRunner/PlatformWebView.h:
+        (PlatformWebView):
+        * WebKitTestRunner/TestController.cpp:
+        (WTR::TestController::createOtherPage):
+        (WTR::TestController::createWebViewWithOptions):
+        * WebKitTestRunner/mac/PlatformWebViewMac.mm:
+        (WTR::PlatformWebView::didInitializeClients):
+
 2013-03-14  Jinwoo Song  <jinwoo7.song@samsung.com>
 
         [EFL][MiniBrowser] Add a search field to the MiniBrowser
index 37cdfcf..b9fa678 100644 (file)
@@ -81,6 +81,8 @@ public:
 
     WKRect windowFrame();
     void setWindowFrame(WKRect);
+
+    void didInitializeClients();
     
     void addChromeInputField();
     void removeChromeInputField();
index 0f28d03..be7620f 100644 (file)
@@ -241,6 +241,8 @@ WKPageRef TestController::createOtherPage(WKPageRef oldPage, WKURLRequestRef, WK
     };
     WKPageSetPageUIClient(newPage, &otherPageUIClient);
 
+    view->didInitializeClients();
+
     WKRetain(newPage);
     return newPage;
 }
@@ -482,6 +484,8 @@ void TestController::createWebViewWithOptions(WKDictionaryRef options)
         0, // unableToImplementPolicy
     };
     WKPageSetPagePolicyClient(m_mainWebView->page(), &pagePolicyClient);
+
+    m_mainWebView->didInitializeClients();
 }
 
 void TestController::ensureViewSupportsOptions(WKDictionaryRef options)
index c3bc857..f6e4745 100644 (file)
@@ -150,5 +150,9 @@ bool PlatformWebView::viewSupportsOptions(WKDictionaryRef options) const
     return m_usingFixedLayout == (options ? WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(options, useFixedLayoutKey.get()))) : false);
 }
 
+void PlatformWebView::didInitializeClients()
+{
+}
+
 } // namespace WTR
 
index 2a3a3bb..75052ff 100644 (file)
@@ -121,5 +121,9 @@ WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage()
     return 0;
 }
 
+void PlatformWebView::didInitializeClients()
+{
+}
+
 } // namespace WTR
 
index 7dc2655..f863684 100644 (file)
@@ -168,6 +168,14 @@ void PlatformWebView::setWindowFrame(WKRect frame)
     [m_window setFrame:NSMakeRect(frame.origin.x, frame.origin.y, frame.size.width, frame.size.height) display:YES];
 }
 
+void PlatformWebView::didInitializeClients()
+{
+    // Set a temporary 1x1 window frame to force a WindowAndViewFramesChanged notification. <rdar://problem/13380145>
+    WKRect wkFrame = windowFrame();
+    [m_window setFrame:NSMakeRect(0, 0, 1, 1) display:YES];
+    setWindowFrame(wkFrame);
+}
+
 void PlatformWebView::addChromeInputField()
 {
     NSTextField* textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)];
index 8f30299..37fd98e 100644 (file)
@@ -185,6 +185,10 @@ bool PlatformWebView::viewSupportsOptions(WKDictionaryRef options) const
     return m_usingFixedLayout == (options ? WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(options, useFixedLayoutKey.get()))) : false);
 }
 
+void PlatformWebView::didInitializeClients()
+{
+}
+
 } // namespace WTR
 
 #include "PlatformWebViewQt.moc"
index 91a03d2..e5de871 100644 (file)
@@ -118,4 +118,8 @@ WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage()
     return 0;
 }
 
+void PlatformWebView::didInitializeClients()
+{
+}
+
 } // namespace WTR