Skip to content
  • commit-queue@webkit.org's avatar
    [chromium] Fix unsafe viewport tag dispatch · 61f4720c
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=80554
    
    Patch by Alexandre Elias <aelias@google.com> on 2012-05-15
    Reviewed by Adam Barth.
    
    In some uncommon situations (such as window.open() new tab on
    Android), dispatchViewportPropertiesDidChange may early-return without
    setting the page scale because the window size is not yet
    available from the embedder.  At that point, the previous behavior was
    to call it again in layoutUpdated(), but this is unsafe since it
    leaves a pending needsLayout.
    
    I moved the dispatch call into WebViewImpl::didChangeContentsSize and
    WebViewImpl::resize() instead -- these represent more explicitly the
    situations where the inputs to the viewport tag calculation change.  I
    removed the other dispatch call from setFrameRect as it's now
    redundant.
    
    Covered by FixedLayoutInitializeAtMinimumPageScale test introduced
    in http://webk.it/82949 (an assertion will fire there without
    this fix).
    
    Source/WebCore:
    
    * page/FrameView.cpp:
    (WebCore::FrameView::setFrameRect):
    
    Source/WebKit/chromium:
    
    * src/ChromeClientImpl.cpp:
    (WebKit::ChromeClientImpl::layoutUpdated):
    (WebKit::ChromeClientImpl::dispatchViewportPropertiesDidChange):
    * src/WebViewImpl.cpp:
    (WebKit::WebViewImpl::resize):
    (WebKit::WebViewImpl::didChangeContentsSize):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117170 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    61f4720c