[AutoSizing] Avoid making text paragraphs scroll horizontally when there is a wide...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2019 23:42:18 +0000 (23:42 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Apr 2019 23:42:18 +0000 (23:42 +0000)
commita60101178d730294a7e91931d0bb5676d73e83e0
treef74ba4db448cd105477eceae605278d891b371ac
parentd8c61251fed13ab022b60bc8798500610451c686
[AutoSizing] Avoid making text paragraphs scroll horizontally when there is a wide table
https://bugs.webkit.org/show_bug.cgi?id=196743
<rdar://problem/43897551>

Reviewed by Tim Horton.

Source/WebCore:

This patch changes the auto size behavior by using fixed constraint (instead of a min/max pair) to compute the content height.
Now with the initial containing block width is firmly set to auto-sizing width, the overflow content will not stretch the ICB. Instead it overflows the ICB
and triggers scrolling the same way the non-auto-sizing mode does.

* page/FrameView.cpp:
(WebCore::FrameView::autoSizeIfEnabled):
(WebCore::FrameView::enableAutoSizeMode):
* page/FrameView.h:
* testing/Internals.cpp:
(WebCore::Internals::enableAutoSizeMode):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setViewLayoutSize):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm: expected behavior change.
(TEST):

LayoutTests:

* css3/viewport-percentage-lengths/vh-auto-size-expected.html:
* css3/viewport-percentage-lengths/vh-auto-size.html:
* fast/dynamic/crash-subtree-layout-when-auto-size-enabled.html:
* fast/dynamic/mail-autosize-viewport-unit.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244098 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/viewport-percentage-lengths/vh-auto-size-expected.html
LayoutTests/css3/viewport-percentage-lengths/vh-auto-size.html
LayoutTests/fast/dynamic/crash-subtree-layout-when-auto-size-enabled.html
LayoutTests/fast/dynamic/mail-autosize-viewport-unit.html
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameView.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/AutoLayoutIntegration.mm