Skip to content
  • ap@apple.com's avatar
    REGRESSION (r142755): window.open creates an invisible window when width and height are 0 · 8d15a82f
    ap@apple.com authored
    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.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    8d15a82f