Title: [102717] trunk/Source/WebKit2
Revision
102717
Author
[email protected]
Date
2011-12-13 15:59:24 -0800 (Tue, 13 Dec 2011)

Log Message

REGRESSION (r102652): New window opens with zero size at produbanco.com
<http://webkit.org/b/74418> and <rdar://problem/10565998>

Reviewed by Anders Carlsson.

Don't use the cached window frame if it's empty (meaning we haven't received
a WindowAndViewFramesChanged message yet.) Instead use the synchronous
GetWindowFrame (WP->UIP) message.

This situation occurs when opening a new window via window.open(), in which
WebCore::createWindow() will query the windowRect() on the new window.

I spent a long time trying to write a layout test for this but couldn't come
up with something reliable. The windowRect() is non-empty before we get a
chance to run JS in/on the new window, and we can't check against the
requested geometry since it varies depending on whether the window manager
has shown the new window yet.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::windowRect):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (102716 => 102717)


--- trunk/Source/WebKit2/ChangeLog	2011-12-13 23:54:03 UTC (rev 102716)
+++ trunk/Source/WebKit2/ChangeLog	2011-12-13 23:59:24 UTC (rev 102717)
@@ -1,3 +1,26 @@
+2011-12-13  Andreas Kling  <[email protected]>
+
+        REGRESSION (r102652): New window opens with zero size at produbanco.com
+        <http://webkit.org/b/74418> and <rdar://problem/10565998>
+
+        Reviewed by Anders Carlsson.
+
+        Don't use the cached window frame if it's empty (meaning we haven't received
+        a WindowAndViewFramesChanged message yet.) Instead use the synchronous
+        GetWindowFrame (WP->UIP) message.
+
+        This situation occurs when opening a new window via window.open(), in which
+        WebCore::createWindow() will query the windowRect() on the new window.
+
+        I spent a long time trying to write a layout test for this but couldn't come
+        up with something reliable. The windowRect() is non-empty before we get a
+        chance to run JS in/on the new window, and we can't check against the
+        requested geometry since it varies depending on whether the window manager
+        has shown the new window yet.
+
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::windowRect):
+
 2011-12-13  Caio Marcelo de Oliveira Filho  <[email protected]>
 
         [Qt][WK2] Make QtPageClient dispatch directly to WebView when possible

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (102716 => 102717)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2011-12-13 23:54:03 UTC (rev 102716)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2011-12-13 23:59:24 UTC (rev 102717)
@@ -106,15 +106,17 @@
 FloatRect WebChromeClient::windowRect()
 {
 #if PLATFORM(MAC)
-    return m_page->windowFrameInScreenCoordinates();
-#else
+    FloatRect cachedWindowFrame(m_page->windowFrameInScreenCoordinates());
+    if (!cachedWindowFrame.isEmpty())
+        return cachedWindowFrame;
+#endif
+
     FloatRect newWindowFrame;
 
     if (!WebProcess::shared().connection()->sendSync(Messages::WebPageProxy::GetWindowFrame(), Messages::WebPageProxy::GetWindowFrame::Reply(newWindowFrame), m_page->pageID()))
         return FloatRect();
 
     return newWindowFrame;
-#endif
 }
 
 FloatRect WebChromeClient::pageRect()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to