Skip to content
  • timothy_horton@apple.com's avatar
    [WK2] Minimum layout width auto-sizing should use... · 33058a4e
    timothy_horton@apple.com authored
    [WK2] Minimum layout width auto-sizing should use FrameView::enableAutoSizeMode so that it can shrink the viewport
    https://bugs.webkit.org/show_bug.cgi?id=107200
    <rdar://problem/12849029>
    
    Reviewed by Simon Fraser.
    
    Make use of FrameView's auto-size mode to allow WKView's computed intrinsic content
    size to shrink below the current viewport size.
    
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::setMinimumLayoutWidth): Forward minimumLayoutWidth changes to WebPage.
    * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
    (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry): Remove minimumLayoutWidth argument on updateGeometry.
    * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
    (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Enable auto-size mode on the new FrameView if needed.
    * WebProcess/WebPage/DrawingArea.h:
    (WebKit::DrawingArea::updateGeometry): Remove minimumLayoutWidth argument.
    * WebProcess/WebPage/DrawingArea.messages.in: Remove minimumLayoutWidth argument on updateGeometry.
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::WebPage::WebPage): Initialize m_minimumLayoutWidth to 0.
    (WebKit::WebPage::setMinimumLayoutWidth): Keep track of minimumLayoutWidth on WebPage. Update auto-sizing state if needed.
    * WebProcess/WebPage/WebPage.h:
    (WebKit::WebPage::minimumLayoutWidth):
    * WebProcess/WebPage/WebPage.messages.in: Add SetMinimumLayoutWidth.
    * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
    (TiledCoreAnimationDrawingArea): Remove storage for m_minimumLayoutWidth. We can get it from WebPage instead.
    * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
    (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
    (WebKit::TiledCoreAnimationDrawingArea::mainFrameContentSizeChanged): Grab minimumLayoutWidth from WebPage.
    (WebKit::TiledCoreAnimationDrawingArea::updateGeometry): Don't setSize() if auto-sizing is enabled; FrameView will do the right thing.
    
    * WebCore.exp.in: Export FrameView::enableAutoSize(...).
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    33058a4e