Changeset 102717 in webkit


Ignore:
Timestamp:
Dec 13, 2011 3:59:24 PM (12 years ago)
Author:
kling@webkit.org
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):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r102680 r102717  
     12011-12-13  Andreas Kling  <kling@webkit.org>
     2
     3        REGRESSION (r102652): New window opens with zero size at produbanco.com
     4        <http://webkit.org/b/74418> and <rdar://problem/10565998>
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Don't use the cached window frame if it's empty (meaning we haven't received
     9        a WindowAndViewFramesChanged message yet.) Instead use the synchronous
     10        GetWindowFrame (WP->UIP) message.
     11
     12        This situation occurs when opening a new window via window.open(), in which
     13        WebCore::createWindow() will query the windowRect() on the new window.
     14
     15        I spent a long time trying to write a layout test for this but couldn't come
     16        up with something reliable. The windowRect() is non-empty before we get a
     17        chance to run JS in/on the new window, and we can't check against the
     18        requested geometry since it varies depending on whether the window manager
     19        has shown the new window yet.
     20
     21        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
     22        (WebKit::WebChromeClient::windowRect):
     23
    1242011-12-13  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
    225
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

    r102652 r102717  
    107107{
    108108#if PLATFORM(MAC)
    109     return m_page->windowFrameInScreenCoordinates();
    110 #else
     109    FloatRect cachedWindowFrame(m_page->windowFrameInScreenCoordinates());
     110    if (!cachedWindowFrame.isEmpty())
     111        return cachedWindowFrame;
     112#endif
     113
    111114    FloatRect newWindowFrame;
    112115
     
    115118
    116119    return newWindowFrame;
    117 #endif
    118120}
    119121
Note: See TracChangeset for help on using the changeset viewer.