Changeset 153913 in webkit


Ignore:
Timestamp:
Aug 9, 2013 4:25:11 PM (11 years ago)
Author:
ap@apple.com
Message:

REGRESSION (r142755): window.open creates an invisible window when width and height are 0
https://bugs.webkit.org/show_bug.cgi?id=119633

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/dom/Window/open-zero-size-as-default.html

Relying on each WebKit to refuse setting size to zero was fragile - because this
required each one to have the check, and because by the time the client was called,
the initially zero size was not necessarily zero.

  • loader/FrameLoader.cpp: (WebCore::createWindow): When sizes are zero, keep the

size the window was created with, because that's the default one by definition.

  • page/DOMWindow.cpp: (WebCore::DOMWindow::adjustWindowRect): It's too late to

check for zero size now, it's been mangled to adjust for the difference between
window and viewport size.

Source/WebKit/efl:

  • WebCoreSupport/ChromeClientEfl.cpp: (WebCore::ChromeClientEfl::setWindowRect):

Once again, the passed rect cannot be empty.

Source/WebKit/gtk:

  • WebCoreSupport/ChromeClientGtk.cpp: (WebKit::ChromeClient::setWindowRect):

Once again, the passed rect cannot be empty.

LayoutTests:

  • fast/dom/Window/open-zero-size-as-default-expected.txt: Added.
  • fast/dom/Window/open-zero-size-as-default.html: Added.
Location:
trunk
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r153910 r153913  
     12013-08-09  Alexey Proskuryakov  <ap@apple.com>
     2
     3        REGRESSION (r142755): window.open creates an invisible window when width and height are 0
     4        https://bugs.webkit.org/show_bug.cgi?id=119633
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/dom/Window/open-zero-size-as-default-expected.txt: Added.
     9        * fast/dom/Window/open-zero-size-as-default.html: Added.
     10
    1112013-08-09  Alexey Proskuryakov  <ap@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r153912 r153913  
     12013-08-09  Alexey Proskuryakov  <ap@apple.com>
     2
     3        REGRESSION (r142755): window.open creates an invisible window when width and height are 0
     4        https://bugs.webkit.org/show_bug.cgi?id=119633
     5
     6        Reviewed by Darin Adler.
     7
     8        Test: fast/dom/Window/open-zero-size-as-default.html
     9
     10        Relying on each WebKit to refuse setting size to zero was fragile - because this
     11        required each one to have the check, and because by the time the client was called,
     12        the initially zero size was not necessarily zero.
     13
     14        * loader/FrameLoader.cpp: (WebCore::createWindow): When sizes are zero, keep the
     15        size the window was created with, because that's the default one by definition.
     16
     17        * page/DOMWindow.cpp: (WebCore::DOMWindow::adjustWindowRect): It's too late to
     18        check for zero size now, it's been mangled to adjust for the difference between
     19        window and viewport size.
     20
    1212013-08-09  Eric Carlson  <eric.carlson@apple.com>
    222
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r153549 r153913  
    34533453    if (features.ySet)
    34543454        windowRect.setY(features.y);
    3455     if (features.widthSet)
     3455    // Zero width and height mean using default size, not minumum one.
     3456    if (features.widthSet && features.width)
    34563457        windowRect.setWidth(features.width + (windowRect.width() - viewportSize.width()));
    3457     if (features.heightSet)
     3458    if (features.heightSet && features.height)
    34583459        windowRect.setHeight(features.height + (windowRect.height() - viewportSize.height()));
    34593460
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r153904 r153913  
    341341
    342342    FloatSize minimumSize = page->chrome().client()->minimumWindowSize();
    343     // Let size 0 pass through, since that indicates default size, not minimum size.
    344     if (window.width())
    345         window.setWidth(min(max(minimumSize.width(), window.width()), screen.width()));
    346     if (window.height())
    347         window.setHeight(min(max(minimumSize.height(), window.height()), screen.height()));
     343    window.setWidth(min(max(minimumSize.width(), window.width()), screen.width()));
     344    window.setHeight(min(max(minimumSize.height(), window.height()), screen.height()));
    348345
    349346    // Constrain the window position within the valid screen area.
  • trunk/Source/WebKit/efl/ChangeLog

    r153736 r153913  
     12013-08-09  Alexey Proskuryakov  <ap@apple.com>
     2
     3        REGRESSION (r142755): window.open creates an invisible window when width and height are 0
     4        https://bugs.webkit.org/show_bug.cgi?id=119633
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebCoreSupport/ChromeClientEfl.cpp: (WebCore::ChromeClientEfl::setWindowRect):
     9        Once again, the passed rect cannot be empty.
     10
    1112013-07-27  Mark Rowe  <mrowe@apple.com>
    212
  • trunk/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp

    r153356 r153913  
    129129void ChromeClientEfl::setWindowRect(const FloatRect& rect)
    130130{
    131     if (!ewk_view_setting_enable_auto_resize_window_get(m_view) || rect.isEmpty())
     131    if (!ewk_view_setting_enable_auto_resize_window_get(m_view))
    132132        return;
    133133
  • trunk/Source/WebKit/gtk/ChangeLog

    r153736 r153913  
     12013-08-09  Alexey Proskuryakov  <ap@apple.com>
     2
     3        REGRESSION (r142755): window.open creates an invisible window when width and height are 0
     4        https://bugs.webkit.org/show_bug.cgi?id=119633
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebCoreSupport/ChromeClientGtk.cpp: (WebKit::ChromeClient::setWindowRect):
     9        Once again, the passed rect cannot be empty.
     10
    1112013-07-27  Mark Rowe  <mrowe@apple.com>
    212
  • trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp

    r153356 r153913  
    172172    if (widgetIsOnscreenToplevelWindow(window)) {
    173173        gtk_window_move(GTK_WINDOW(window), intrect.x(), intrect.y());
    174         if (!intrect.isEmpty())
    175             gtk_window_resize(GTK_WINDOW(window), intrect.width(), intrect.height());
     174        gtk_window_resize(GTK_WINDOW(window), intrect.width(), intrect.height());
    176175    }
    177176}
Note: See TracChangeset for help on using the changeset viewer.