haikuwebkit/LayoutTests/fast/dynamic/mail-autosize-viewport-unit...

52 lines
1.1 KiB
HTML
Raw Permalink Normal View History

<!DOCTYPE HTML>
<html>
<head>
<title>This tests that autosize uses the min-width as the base for resolving viewport unit values</title>
<style>
#w100 {
width: 100vw;
height: 10px;
}
#w50 {
width: 50vw;
height: 10px;
}
#w10 {
width: 10vw;
height: 10px;
}
#w0 {
width: 0vw;
height: 10px;
}
</style>
<script>
if (window.internals)
[AutoSizing] Bring back the old auto-sizing code as a deprecated codepath for compatibility reasons https://bugs.webkit.org/show_bug.cgi?id=209669 <rdar://problem/60111081> Reviewed by Alan Bujtas and Darin Adler. Source/WebCore: We changed the auto-sizing code for webkit.org/b/196743 in r244098, but some clients need it and we bring it back via two exclusive auto-sizing mode: fixed-width (the existing mode) and size-to-content (the resurrected mode). * page/FrameView.cpp: (WebCore::FrameView::autoSizeIfEnabled): (WebCore::FrameView::performFixedWidthAutoSize): (WebCore::FrameView::performSizeToContentAutoSize): (WebCore::FrameView::enableFixedWidthAutoSizeMode): (WebCore::FrameView::enableSizeToContentAutoSizeMode): (WebCore::FrameView::enableAutoSizeMode): * page/FrameView.h: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::enableFixedWidthAutoSizeMode): (WebCore::Internals::enableAutoSizeMode): Deleted. * testing/Internals.h: * testing/Internals.idl: Source/WebKit: We changed the auto-sizing code for webkit.org/b/196743 in r244098, but some clients need it and we bring it back via a new dedicated -[WKWebView _setSizeToContentAutoSizeMaximumSize:] SPI. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView sizeToContentAutoSizeMaximumSize]): (-[WKView setSizeToContentAutoSizeMaximumSize:]): * UIProcess/API/mac/WKWebViewMac.mm: (-[WKWebView _sizeToContentAutoSizeMaximumSize]): (-[WKWebView _setSizeToContentAutoSizeMaximumSize:]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setSizeToContentAutoSizeMaximumSize): (WebKit::WebViewImpl::sizeToContentAutoSizeMaximumSize const): (WebKit::WebViewImpl::setIntrinsicContentSize): * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::sizeToContentAutoSizeMaximumSizeDidChange): * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::sizeToContentAutoSizeMaximumSize const): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::sizeToContentAutoSizeMaximumSizeDidChange): (WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry): (WebKit::TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_processDisplayName): (WebKit::WebPage::reinitializeWebPage): (WebKit::WebPage::setMinimumSizeForAutoLayout): (WebKit::WebPage::setSizeToContentAutoSizeMaximumSize): (WebKit::WebPage::updateIntrinsicContentSizeIfNeeded): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::sizeToContentAutoSizeMaximumSize const): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::updateGeometry): LayoutTests: The methods internals.enableAutoSizeMode() has changed to internals.enableFixedWidthAutoSizeMode(). * 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: Canonical link: https://commits.webkit.org/222652@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-30 07:33:06 +00:00
internals.enableFixedWidthAutoSizeMode(true, 2000, 600);
if (window.testRunner)
testRunner.dumpAsText();
</script>
</head>
<body>
<div id=w100></div>
<div id=w50></div>
<div id=w10></div>
<div id=w0></div>
<img src="notfound.jpg" width=3000px height=100px>
<pre id=result></pre>
<script>
document.body.offsetWidth;
result.textContent = window.getComputedStyle(w100, null).getPropertyValue("width") + " "
+ window.getComputedStyle(w50, null).getPropertyValue("width") + " "
+ window.getComputedStyle(w10, null).getPropertyValue("width") + " "
+ window.getComputedStyle(w0, null).getPropertyValue("width");
if (window.internals)
[AutoSizing] Bring back the old auto-sizing code as a deprecated codepath for compatibility reasons https://bugs.webkit.org/show_bug.cgi?id=209669 <rdar://problem/60111081> Reviewed by Alan Bujtas and Darin Adler. Source/WebCore: We changed the auto-sizing code for webkit.org/b/196743 in r244098, but some clients need it and we bring it back via two exclusive auto-sizing mode: fixed-width (the existing mode) and size-to-content (the resurrected mode). * page/FrameView.cpp: (WebCore::FrameView::autoSizeIfEnabled): (WebCore::FrameView::performFixedWidthAutoSize): (WebCore::FrameView::performSizeToContentAutoSize): (WebCore::FrameView::enableFixedWidthAutoSizeMode): (WebCore::FrameView::enableSizeToContentAutoSizeMode): (WebCore::FrameView::enableAutoSizeMode): * page/FrameView.h: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): (WebCore::Internals::enableFixedWidthAutoSizeMode): (WebCore::Internals::enableAutoSizeMode): Deleted. * testing/Internals.h: * testing/Internals.idl: Source/WebKit: We changed the auto-sizing code for webkit.org/b/196743 in r244098, but some clients need it and we bring it back via a new dedicated -[WKWebView _setSizeToContentAutoSizeMaximumSize:] SPI. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * UIProcess/API/Cocoa/WKViewPrivate.h: * UIProcess/API/Cocoa/WKWebViewPrivate.h: * UIProcess/API/mac/WKView.mm: (-[WKView sizeToContentAutoSizeMaximumSize]): (-[WKView setSizeToContentAutoSizeMaximumSize:]): * UIProcess/API/mac/WKWebViewMac.mm: (-[WKWebView _sizeToContentAutoSizeMaximumSize]): (-[WKWebView _setSizeToContentAutoSizeMaximumSize:]): * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::setSizeToContentAutoSizeMaximumSize): (WebKit::WebViewImpl::sizeToContentAutoSizeMaximumSize const): (WebKit::WebViewImpl::setIntrinsicContentSize): * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::sizeToContentAutoSizeMaximumSizeDidChange): * UIProcess/WebPageProxy.cpp: * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::sizeToContentAutoSizeMaximumSize const): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::sizeToContentAutoSizeMaximumSizeDidChange): (WebKit::TiledCoreAnimationDrawingAreaProxy::didUpdateGeometry): (WebKit::TiledCoreAnimationDrawingAreaProxy::willSendUpdateGeometry): * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_processDisplayName): (WebKit::WebPage::reinitializeWebPage): (WebKit::WebPage::setMinimumSizeForAutoLayout): (WebKit::WebPage::setSizeToContentAutoSizeMaximumSize): (WebKit::WebPage::updateIntrinsicContentSizeIfNeeded): * WebProcess/WebPage/WebPage.h: (WebKit::WebPage::sizeToContentAutoSizeMaximumSize const): * WebProcess/WebPage/WebPage.messages.in: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::updateGeometry): LayoutTests: The methods internals.enableAutoSizeMode() has changed to internals.enableFixedWidthAutoSizeMode(). * 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: Canonical link: https://commits.webkit.org/222652@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-03-30 07:33:06 +00:00
internals.enableFixedWidthAutoSizeMode(false, 0, 0, 0, 0);
</script>
</body>
</html>