haikuwebkit/LayoutTests/css3/viewport-percentage-lengths/viewport-percentage-lengths...

60 lines
2.8 KiB
Plaintext
Raw Permalink Normal View History

vw/vh units used as font/line-height values don't scale with the viewport https://bugs.webkit.org/show_bug.cgi?id=87846 Reviewed by Darin Adler. Source/WebCore: This patch moves the resolution of viewport units to style recalc time. Currently viewport units are left unresolved during style recalcs, which leads to many problems with viewport units. Moving the resolution will fix these problems, as well as reduce the plumbing that goes on. This patch touches a lot of files since the valueForLength functions no longer need a RenderView. The interesting changes are in: - CSSToLengthConversionData -> CSSPrimitiveValue: for moving resolution to style recalc time. - Length / LengthFunctions: no longer needs to know about viewport units. - FrameView -> Document -> StyleResolver: for scheduling style recalcs upon resize Note that getComputedStyle will now return pixel values when viewport units are used. This behavior matches Firefox and the css3-cascade spec. This is based on a Blink patch by timloh@chromium.org. Tests: css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html css3/viewport-percentage-lengths/viewport-percentage-lengths-calc.html css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html * WebCore.exp.in: Remove RenderView argument to floatValueForLength. * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (getAttributeSetForAccessibilityObject): Remove RenderView argument. * css/BasicShapeFunctions.cpp: (WebCore::convertToLength): Ditto. (WebCore::floatValueForCenterCoordinate): Ditto. * css/BasicShapeFunctions.h: Ditto. * css/CSSCalculationValue.cpp: (WebCore::unitCategory): Remove special handling for viewport units, as they get resolved to pixels. (WebCore::createCSS): Ditto. * css/CSSComputedStyleDeclaration.cpp: (WebCore::positionOffsetValue): Remove RendewView argument. (WebCore::getBorderRadiusCornerValues): Remove handling of viewport units, as they are already resolve to pixels here. (WebCore::getBorderRadiusCornerValue): Remove RenderView argument. (WebCore::getBorderRadiusShorthandValue): Ditto. (WebCore::specifiedValueForGridTrackBreadth): Remove handling of viewport units, as they are already resolved to pixels here. (WebCore::specifiedValueForGridTrackSize): Remove RenderView argument. (WebCore::valueForGridTrackList): Ditto. (WebCore::lineHeightFromStyle): Ditto. (WebCore::ComputedStyleExtractor::propertyValue): Ditto. * css/CSSGradientValue.cpp: (WebCore::CSSLinearGradientValue::createGradient): Pass RenderView to CSSToLengthConversionData constructor. (WebCore::CSSRadialGradientValue::createGradient): Ditto. * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::unitCategory): Remove handling of viewport units, as they get resolved to pixels. (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Ditto. (WebCore::CSSPrimitiveValue::init): Ditto. (WebCore::CSSPrimitiveValue::computeLengthDouble): Resolve viewport units to pixels. (WebCore::CSSPrimitiveValue::canonicalUnitTypeForCategory): Remove handling of viewport units, since they get resolved to pixels. (WebCore::CSSPrimitiveValue::viewportPercentageLength): Deleted. * css/CSSPrimitiveValue.h: (WebCore::CSSPrimitiveValue::isLength): Remove special handling of viewport units, since they get resolved to pixels. * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::convertToLength): Ditto. * css/CSSToLengthConversionData.cpp: (WebCore::CSSToLengthConversionData::viewportWidthFactor): Caclulate conversion factor for viewport units to pixels. Note this does not set hasViewportUnits on the RenderStyle if computing the font size, because in the font size case, the RenderStyle is the parent's style, not the current renderer's style. (WebCore::CSSToLengthConversionData::viewportHeightFactor): Ditto. (WebCore::CSSToLengthConversionData::viewportMinFactor): Ditto. (WebCore::CSSToLengthConversionData::viewportMaxFactor): Ditto. * css/CSSToLengthConversionData.h: (WebCore::CSSToLengthConversionData::CSSToLengthConversionData): Add RenderView parameter, and make RenderStyle non-const so that hasViewportUnits can be set on the Style.. (WebCore::CSSToLengthConversionData::style): style is now non-const. (WebCore::CSSToLengthConversionData::copyWithAdjustedZoom): Handle RenderView argument. * css/CSSToStyleMap.cpp: (WebCore::CSSToStyleMap::mapFillXPosition): Remove handling of viewport units, as they are already resolved to pixels here. (WebCore::CSSToStyleMap::mapFillYPosition): Ditto. * css/DeprecatedStyleBuilder.cpp: (WebCore::ApplyPropertyLength::applyValue): Ditto. (WebCore::ApplyPropertyBorderRadius::applyValue): Ditto. (WebCore::ApplyPropertyComputeLength::applyValue): Ditto. (WebCore::ApplyPropertyFontSize::applyValue): Ditto. (WebCore::ApplyPropertyLineHeight::applyValue): Ditto. (WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyValue): Ditto. (WebCore::ApplyPropertyWordSpacing::applyValue): Ditto. (WebCore::ApplyPropertyVerticalAlign::applyValue): Ditto. (WebCore::ApplyPropertyTextIndent::applyValue): Ditto. * css/LengthFunctions.cpp: (WebCore::minimumIntValueForLength): Remove RenderView argument. (WebCore::intValueForLength): Remove RenderView argument and roundPecentages. (WebCore::minimumValueForLength): Remove RenderView argument, and special handling of viewport units. (WebCore::valueForLength): Ditto. (WebCore::floatValueForLength): Ditto. (WebCore::floatSizeForLengthSize): Remove RenderView argument. * css/LengthFunctions.h: Ditto. * css/MediaQueryEvaluator.cpp: (WebCore::MediaQueryEvaluator::eval): Add RenderView argument for CSSToLengthConversionData constuctor. * css/StyleResolver.cpp: (WebCore::StyleResolver::State::clear): Change to 0 arg constructor for CSSToLengthConversionData. (WebCore::StyleResolver::State::updateConversionData): In order to get the RenderView, we need to have a valid Element set on the state. Since this means that we need to set the conversion data in more places, move the contruction of conversion data into this helper method. (WebCore::StyleResolver::State::initElement): Make sure conversion data is up to date. (WebCore::StyleResolver::State::initForStyleResolve): Ditto. (WebCore::StyleResolver::State::setStyle): When the style is set, we need to make sure to update the conversion data. (WebCore::StyleResolver::styleForElement): If the style has viewport units, flage the document so that we can make sure to recalc the viewport unit values when the viewport is resized. (WebCore::StyleResolver::pseudoStyleForElement): Ditto. (WebCore::StyleResolver::updateFont): Make sure the font having viewport units updates the style. (WebCore::StyleResolver::convertToIntLength): Remove handling of viewport units, as they are resolved to pixels. (WebCore::StyleResolver::convertToFloatLength): Ditto. (WebCore::StyleResolver::clearCachedPropertiesAffectedByViewportUnits): Invalidate the matched properties cache for styles with viewport units when the viewport is resized. (WebCore::createGridTrackBreadth): Remove handling of viewport units, as they are resolved to pixels. (WebCore::StyleResolver::applyProperty): Ditto. (WebCore::StyleResolver::hasMediaQueriesAffectedByViewportChange): Rename to be less confusing, since it has nothing to do with viewport units. (WebCore::StyleResolver::createFilterOperations): Remove handling of viewport units, as they are resolved to pixels. (WebCore::StyleResolver::affectedByViewportChange): Deleted. (WebCore::StyleResolver::viewportPercentageValue): Deleted. * css/StyleResolver.h: (WebCore::StyleResolver::State::State): C++11 cleanup: 0 -> nullptr. (WebCore::StyleResolver::State::setFontSizeHasViewportUnits): Set if the font size is specified in viewport units. (WebCore::StyleResolver::State::fontSizeHasViewportUnits): Ditto. (WebCore::StyleResolver::State::setStyle): Deleted. * css/TransformFunctions.cpp: (WebCore::convertToFloatLength): Remove handling of viewport units, since they are resolved to pixels. * dom/Document.cpp: (WebCore::Document::Document): Add flag to determine if some style in the document has viewport units. (WebCore::Document::pageSizeAndMarginsInPixels): Remove RenderView argument. (WebCore::Document::updateViewportUnitsOnResize): Mark elements with viewport units for style recalc when the viewport size has changed. * dom/Document.h: (WebCore::Document::setHasStyleWithViewportUnits): Flag to determine if some style in the document has viewport units. (WebCore::Document::hasStyleWithViewportUnits): Ditto. * html/HTMLAreaElement.cpp: (WebCore::HTMLAreaElement::getRegion): Remove RenderView argument. * page/FrameView.cpp: (WebCore::FrameView::layout): When the viewport is resized, call updateViewportUnitsOnResize on the document. * platform/Length.h: (WebCore::Length::isSpecified): Remove handling of viewport units, since they are now resolved to pixels. (WebCore::Length::viewportPercentageLength): Deleted. (WebCore::Length::isViewportPercentage): Deleted. * rendering/ClipPathOperation.h: (WebCore::ShapeClipPathOperation::pathForReferenceRect): Remove RenderView argument. (WebCore::BoxClipPathOperation::pathForReferenceRect): Ditto. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::updateBlockChildDirtyBitsBeforeLayout): Remove handling of viewport units, since they get updated by updateViewportUnitsOnResize when the viewport is resized. (WebCore::RenderBlock::nodeAtPoint): Remove RenderView argument. (WebCore::RenderBlock::lineHeight): Ditto. * rendering/RenderBox.cpp: (WebCore::RenderBox::paintBoxDecorations): Remove RenderView argument. (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing): Remove handling of viewport units, as they are resolved to pixels. (WebCore::RenderBox::computePercentageLogicalHeight): Ditto. (WebCore::RenderBox::computeReplacedLogicalWidthUsing): Ditto. (WebCore::RenderBox::computeReplacedLogicalHeightUsing): Ditto. (WebCore::RenderBox::hasViewportPercentageLogicalHeight): Deleted. * rendering/RenderBox.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::getBackgroundRoundedRect): Remove RenderView argument. (WebCore::RenderBoxModelObject::calculateFillTileSize): Remove handling of viewport units, as they are resolved to pixels. (WebCore::computeBorderImageSide): Remove RenderView argument. (WebCore::RenderBoxModelObject::paintNinePieceImage): Ditto. (WebCore::RenderBoxModelObject::paintBorder): Ditto. (WebCore::RenderBoxModelObject::paintBoxShadow): Ditto. * rendering/RenderElement.cpp: (WebCore::RenderElement::repaintAfterLayoutIfNeeded): Ditto. * rendering/RenderElement.h: (WebCore::RenderElement::valueForLength): Remove unused roundPercentages argument. (WebCore::RenderElement::minimumValueForLength): Remove unused RoundPercentages and RenderView arguments. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutGridItems): Remove handling of viewport units as they are resolved to pixels. * rendering/RenderInline.cpp: (WebCore::computeMargin): Ditto. (WebCore::RenderInline::lineHeight): Remove RenderView argument. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::setupClipPath): Ditto. * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::lineHeight): Ditto. * rendering/RenderScrollbarPart.cpp: (WebCore::calcScrollbarThicknessUsing): Ditto. (WebCore::RenderScrollbarPart::computeScrollbarWidth): Ditto. (WebCore::RenderScrollbarPart::computeScrollbarHeight): Ditto. * rendering/RenderTable.cpp: (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight): Remove handling of viewport units, since they are resolved to pixels. (WebCore::RenderTable::computePreferredLogicalWidths): Now that viewport unit values are resolved to pixels at style recalc time, no special checking is needed to handle them, so update the comment to reflect that. * rendering/RenderThemeIOS.mm: (WebCore::applyCommonButtonPaddingToStyle): Add RenderView argument to CSSToLengthConversionData constructor. (WebCore::RenderThemeIOS::adjustButtonStyle): Ditto. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintMenuListButtonGradients): Remove RenderView argument. * rendering/RenderView.cpp: (WebCore::RenderView::layout): Remove handling of viewport units, since they are resolved to pixels. * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::ascentAndDescentForBox): Remove RenderView argument. * rendering/shapes/Shape.cpp: (WebCore::Shape::createShape): Remove RenderView argument. * rendering/shapes/Shape.h: * rendering/shapes/ShapeOutsideInfo.cpp: (WebCore::ShapeOutsideInfo::computedShape): Ditto. * rendering/style/BasicShapes.cpp: (WebCore::BasicShapeCircle::floatValueForRadiusInBox): Ditto. (WebCore::BasicShapeCircle::path): Ditto. (WebCore::BasicShapeEllipse::floatValueForRadiusInBox): Ditto. (WebCore::BasicShapeEllipse::path): Ditto. (WebCore::BasicShapePolygon::path): Ditto. (WebCore::floatSizeForLengthSize): Ditto. (WebCore::BasicShapeInset::path): Ditto. * rendering/style/BasicShapes.h: * rendering/style/RenderStyle.cpp: (WebCore::calcRadiiFor): Ditto. (WebCore::RenderStyle::getRoundedBorderFor): Ditto. (WebCore::RenderStyle::computedLineHeight): Remove handling of viewport units since they are resolved to pixels. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setHasViewportUnits): Set if this style has a property set with viewport units. (WebCore::RenderStyle::hasViewportUnits): Ditto. * rendering/svg/RenderSVGRoot.cpp: (WebCore::resolveLengthAttributeForSVG): Remove RenderView argument. (WebCore::RenderSVGRoot::computeReplacedLogicalWidth): Ditto. (WebCore::RenderSVGRoot::computeReplacedLogicalHeight): Ditto. * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::prepareToRenderSVGContent): Ditto. LayoutTests: Update existing tests to work with the proper behavior of viewport units. Add tests for some of the things fixed by this patch: handling of viewport units in font sizes, with calc, and when the viewport is resized without a reload. The anonymous block and percent size child tests make sure that the viewport unit updates still work properly when there is another relative unit the depends on the size specified in viewport units. * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle-expected.txt: * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle.html: * css3/viewport-percentage-lengths/resources/resize-test.js: Added. (resizeTest): (standardResizeTest): * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block-expected.txt: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-calc-expected.txt: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-calc.html: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child-expected.txt: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size-expected.txt: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Added. * fast/canvas/draw-focus-if-needed-expected.txt: Removed. * fast/canvas/draw-focus-if-needed.html: Removed. * fast/masking/parsing-clip-path-shape-expected.txt: * fast/masking/parsing-clip-path-shape.html: * fast/shapes/parsing/parsing-shape-lengths-expected.txt: * fast/shapes/parsing/parsing-shape-lengths.html: Canonical link: https://commits.webkit.org/151360@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-28 01:33:26 +00:00
Test that viewport lengths and font sizes properly resize with the viewport.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS successfullyParsed is true
TEST COMPLETE
Viewport percentage tests that resize the viewport are flaky https://bugs.webkit.org/show_bug.cgi?id=133351 Reviewed by Anders Carlsson. Source/WebCore: * page/FrameView.cpp: (WebCore::FrameView::setFrameRect): Removed code that explicitly sends a resize event here. The resize event will be sent as a side effect of layout instead. (WebCore::FrameView::sendResizeEventIfNeeded): Don't send a resize event until layout is done, since this is what propagates the new geometry in so the JavaScript code can detect it. Also simplified the logic and streamlined a little, and added a FIXME about the bad idea here where the code enqueues an event for an unknown time in the future. Removed the unneeded code that passes in the DOM window as the target to dispatchWindowEvent, since that gets filled in as the target by default. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (sizeWebViewForCurrentTest): Added a call to reset the window origin, which happens to be stored in the UI delegate object. This is part of resetting the window position. * DumpRenderTree/mac/UIDelegate.h: Store the window origin rather than storing a frame rectangle. The size is stored in the size of the web view itself. * DumpRenderTree/mac/UIDelegate.mm: (-[UIDelegate resetWindowOrigin]): Added. (-[UIDelegate webView:setFrame:]): Changed to set the size of the web view. The old version would store the frame, but not resize the web view! (-[UIDelegate webViewFrame:]): Get the size from the web view. * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: (WTR::PlatformWebView::setWindowFrame): Added code to resize the web view. * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: (WTR::PlatformWebView::resizeTo): Added a comment about missing code to resize the window. * WebKitTestRunner/ios/PlatformWebViewIOS.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. * WebKitTestRunner/mac/PlatformWebViewMac.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. LayoutTests: * css3/viewport-percentage-lengths/resources/resize-test.js: Added code to compensate for the difference between innerWidth/Height and outerWidth/Height so this works well in a browser window. Added code to "warm up" so the first resize triggers a resize event. Tweaked style of the code a bit. Use resize events to avoid flakiness due to race conditions. One thing I did not fix is the "out of order" problem where all the test results get written out after the words TEST COMPLETE. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html: Changed this test to use the shared resize-test.js. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: Updated due to changes to the underlying test machinery, and also to show both expected success, and some expected failures. These failures were going unnoticed before since the test didn't successfully do any resizing of the web view. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Streamlined this test a little. * fast/dom/Window/window-resize-contents-expected.txt: Updated to reflect the test actually resizing. The old test results expected no resizing to occur. * fast/dom/Window/window-resize-contents.html: Updated to use a resize event handler so the test can successfully test asynchronous resizes like the ones done by WebKit2. * fast/dom/rtl-scroll-to-leftmost-and-resize.html: Updated to use a resize event handler so this can test asynchronous resizes. Also fixed code that was treating the arguments to resizeTo as if they were inner coordinates rather than outer. However, the bug this tests for has not been fixed, so need to expect failures. * platform/mac/TestExpectations: Added a failure expection for the test above. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.png: Updated to expect a result that successfully resized. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.txt: Ditto. Canonical link: https://commits.webkit.org/151445@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-01 00:01:16 +00:00
PASS innerWidth is 800
PASS innerHeight is 600
PASS getComputedStyle(test).width is "400px"
font-size with viewport units in calc() doesn't change when viewport resizes https://bugs.webkit.org/show_bug.cgi?id=224614 Reviewed by Zalan Bujtas. Source/WebCore: * css/CSSToLengthConversionData.cpp: (WebCore::CSSToLengthConversionData::zoom const): Updated since m_zoom is now optional. We use effectiveZoom when m_zoom is not specified, which is the same semantic that was implemented before with a separate boolean. (WebCore::CSSToLengthConversionData::viewportWidthFactor const): When calling the setHasViewportUnits function as a side effect, use m_viewportDependencyDetectionStyle, rather than always using m_style. This lets us handle the font-size case correctly. Also removed the explicit computingFontSize check for the same reason. (WebCore::CSSToLengthConversionData::viewportHeightFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMinFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMaxFactor const): Ditto. * css/CSSToLengthConversionData.h: Added a new member, m_viewportDependencyDetectionStyle, which defaults to the same value as m_style. Also changed m_zoom to use Optional instead of a separate boolean and an ignored "must be 1.0" value. Initialized data members in the modern way, allowing us to use the default constructor. * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueFontSize): Pass in the builder's style as the viewportDependencyDetectionStyle. This does the same thing that the existing code to call setHasViewportUnits did directly, but does it even for more complex cases involving calc(). Also made the isLength and isCalculatedPercentageWithLength cases more similar to each other and left a FIXME behind about taking that a bit further, but doing that probably requires creating some more test cases. LayoutTests: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Added tests that involve calc, and broke rules up into multiple elements so that side effects from one style won't give us false negatives. This now has a subtest that was failing without the fix in this patch. Canonical link: https://commits.webkit.org/236669@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-17 01:08:45 +00:00
PASS getComputedStyle(testfontsize).fontSize is "30px"
PASS getComputedStyle(testcalc).width is "800px"
PASS getComputedStyle(testfontsizecalc).fontSize is "60px"
Viewport percentage tests that resize the viewport are flaky https://bugs.webkit.org/show_bug.cgi?id=133351 Reviewed by Anders Carlsson. Source/WebCore: * page/FrameView.cpp: (WebCore::FrameView::setFrameRect): Removed code that explicitly sends a resize event here. The resize event will be sent as a side effect of layout instead. (WebCore::FrameView::sendResizeEventIfNeeded): Don't send a resize event until layout is done, since this is what propagates the new geometry in so the JavaScript code can detect it. Also simplified the logic and streamlined a little, and added a FIXME about the bad idea here where the code enqueues an event for an unknown time in the future. Removed the unneeded code that passes in the DOM window as the target to dispatchWindowEvent, since that gets filled in as the target by default. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (sizeWebViewForCurrentTest): Added a call to reset the window origin, which happens to be stored in the UI delegate object. This is part of resetting the window position. * DumpRenderTree/mac/UIDelegate.h: Store the window origin rather than storing a frame rectangle. The size is stored in the size of the web view itself. * DumpRenderTree/mac/UIDelegate.mm: (-[UIDelegate resetWindowOrigin]): Added. (-[UIDelegate webView:setFrame:]): Changed to set the size of the web view. The old version would store the frame, but not resize the web view! (-[UIDelegate webViewFrame:]): Get the size from the web view. * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: (WTR::PlatformWebView::setWindowFrame): Added code to resize the web view. * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: (WTR::PlatformWebView::resizeTo): Added a comment about missing code to resize the window. * WebKitTestRunner/ios/PlatformWebViewIOS.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. * WebKitTestRunner/mac/PlatformWebViewMac.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. LayoutTests: * css3/viewport-percentage-lengths/resources/resize-test.js: Added code to compensate for the difference between innerWidth/Height and outerWidth/Height so this works well in a browser window. Added code to "warm up" so the first resize triggers a resize event. Tweaked style of the code a bit. Use resize events to avoid flakiness due to race conditions. One thing I did not fix is the "out of order" problem where all the test results get written out after the words TEST COMPLETE. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html: Changed this test to use the shared resize-test.js. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: Updated due to changes to the underlying test machinery, and also to show both expected success, and some expected failures. These failures were going unnoticed before since the test didn't successfully do any resizing of the web view. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Streamlined this test a little. * fast/dom/Window/window-resize-contents-expected.txt: Updated to reflect the test actually resizing. The old test results expected no resizing to occur. * fast/dom/Window/window-resize-contents.html: Updated to use a resize event handler so the test can successfully test asynchronous resizes like the ones done by WebKit2. * fast/dom/rtl-scroll-to-leftmost-and-resize.html: Updated to use a resize event handler so this can test asynchronous resizes. Also fixed code that was treating the arguments to resizeTo as if they were inner coordinates rather than outer. However, the bug this tests for has not been fixed, so need to expect failures. * platform/mac/TestExpectations: Added a failure expection for the test above. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.png: Updated to expect a result that successfully resized. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.txt: Ditto. Canonical link: https://commits.webkit.org/151445@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-01 00:01:16 +00:00
PASS getComputedStyle(testpseudo, ':after').marginLeft is "120px"
PASS getComputedStyle(testpseudo, ':after').paddingRight is "200px"
font-size with viewport units in calc() doesn't change when viewport resizes https://bugs.webkit.org/show_bug.cgi?id=224614 Reviewed by Zalan Bujtas. Source/WebCore: * css/CSSToLengthConversionData.cpp: (WebCore::CSSToLengthConversionData::zoom const): Updated since m_zoom is now optional. We use effectiveZoom when m_zoom is not specified, which is the same semantic that was implemented before with a separate boolean. (WebCore::CSSToLengthConversionData::viewportWidthFactor const): When calling the setHasViewportUnits function as a side effect, use m_viewportDependencyDetectionStyle, rather than always using m_style. This lets us handle the font-size case correctly. Also removed the explicit computingFontSize check for the same reason. (WebCore::CSSToLengthConversionData::viewportHeightFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMinFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMaxFactor const): Ditto. * css/CSSToLengthConversionData.h: Added a new member, m_viewportDependencyDetectionStyle, which defaults to the same value as m_style. Also changed m_zoom to use Optional instead of a separate boolean and an ignored "must be 1.0" value. Initialized data members in the modern way, allowing us to use the default constructor. * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueFontSize): Pass in the builder's style as the viewportDependencyDetectionStyle. This does the same thing that the existing code to call setHasViewportUnits did directly, but does it even for more complex cases involving calc(). Also made the isLength and isCalculatedPercentageWithLength cases more similar to each other and left a FIXME behind about taking that a bit further, but doing that probably requires creating some more test cases. LayoutTests: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Added tests that involve calc, and broke rules up into multiple elements so that side effects from one style won't give us false negatives. This now has a subtest that was failing without the fix in this patch. Canonical link: https://commits.webkit.org/236669@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-17 01:08:45 +00:00
PASS getComputedStyle(testpseudocalc, ':after').marginLeft is "240px"
PASS getComputedStyle(testpseudocalc, ':after').paddingRight is "400px"
Viewport percentage tests that resize the viewport are flaky https://bugs.webkit.org/show_bug.cgi?id=133351 Reviewed by Anders Carlsson. Source/WebCore: * page/FrameView.cpp: (WebCore::FrameView::setFrameRect): Removed code that explicitly sends a resize event here. The resize event will be sent as a side effect of layout instead. (WebCore::FrameView::sendResizeEventIfNeeded): Don't send a resize event until layout is done, since this is what propagates the new geometry in so the JavaScript code can detect it. Also simplified the logic and streamlined a little, and added a FIXME about the bad idea here where the code enqueues an event for an unknown time in the future. Removed the unneeded code that passes in the DOM window as the target to dispatchWindowEvent, since that gets filled in as the target by default. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (sizeWebViewForCurrentTest): Added a call to reset the window origin, which happens to be stored in the UI delegate object. This is part of resetting the window position. * DumpRenderTree/mac/UIDelegate.h: Store the window origin rather than storing a frame rectangle. The size is stored in the size of the web view itself. * DumpRenderTree/mac/UIDelegate.mm: (-[UIDelegate resetWindowOrigin]): Added. (-[UIDelegate webView:setFrame:]): Changed to set the size of the web view. The old version would store the frame, but not resize the web view! (-[UIDelegate webViewFrame:]): Get the size from the web view. * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: (WTR::PlatformWebView::setWindowFrame): Added code to resize the web view. * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: (WTR::PlatformWebView::resizeTo): Added a comment about missing code to resize the window. * WebKitTestRunner/ios/PlatformWebViewIOS.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. * WebKitTestRunner/mac/PlatformWebViewMac.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. LayoutTests: * css3/viewport-percentage-lengths/resources/resize-test.js: Added code to compensate for the difference between innerWidth/Height and outerWidth/Height so this works well in a browser window. Added code to "warm up" so the first resize triggers a resize event. Tweaked style of the code a bit. Use resize events to avoid flakiness due to race conditions. One thing I did not fix is the "out of order" problem where all the test results get written out after the words TEST COMPLETE. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html: Changed this test to use the shared resize-test.js. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: Updated due to changes to the underlying test machinery, and also to show both expected success, and some expected failures. These failures were going unnoticed before since the test didn't successfully do any resizing of the web view. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Streamlined this test a little. * fast/dom/Window/window-resize-contents-expected.txt: Updated to reflect the test actually resizing. The old test results expected no resizing to occur. * fast/dom/Window/window-resize-contents.html: Updated to use a resize event handler so the test can successfully test asynchronous resizes like the ones done by WebKit2. * fast/dom/rtl-scroll-to-leftmost-and-resize.html: Updated to use a resize event handler so this can test asynchronous resizes. Also fixed code that was treating the arguments to resizeTo as if they were inner coordinates rather than outer. However, the bug this tests for has not been fixed, so need to expect failures. * platform/mac/TestExpectations: Added a failure expection for the test above. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.png: Updated to expect a result that successfully resized. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.txt: Ditto. Canonical link: https://commits.webkit.org/151445@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-01 00:01:16 +00:00
PASS innerWidth is 900
PASS innerHeight is 600
PASS getComputedStyle(test).width is "450px"
font-size with viewport units in calc() doesn't change when viewport resizes https://bugs.webkit.org/show_bug.cgi?id=224614 Reviewed by Zalan Bujtas. Source/WebCore: * css/CSSToLengthConversionData.cpp: (WebCore::CSSToLengthConversionData::zoom const): Updated since m_zoom is now optional. We use effectiveZoom when m_zoom is not specified, which is the same semantic that was implemented before with a separate boolean. (WebCore::CSSToLengthConversionData::viewportWidthFactor const): When calling the setHasViewportUnits function as a side effect, use m_viewportDependencyDetectionStyle, rather than always using m_style. This lets us handle the font-size case correctly. Also removed the explicit computingFontSize check for the same reason. (WebCore::CSSToLengthConversionData::viewportHeightFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMinFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMaxFactor const): Ditto. * css/CSSToLengthConversionData.h: Added a new member, m_viewportDependencyDetectionStyle, which defaults to the same value as m_style. Also changed m_zoom to use Optional instead of a separate boolean and an ignored "must be 1.0" value. Initialized data members in the modern way, allowing us to use the default constructor. * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueFontSize): Pass in the builder's style as the viewportDependencyDetectionStyle. This does the same thing that the existing code to call setHasViewportUnits did directly, but does it even for more complex cases involving calc(). Also made the isLength and isCalculatedPercentageWithLength cases more similar to each other and left a FIXME behind about taking that a bit further, but doing that probably requires creating some more test cases. LayoutTests: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Added tests that involve calc, and broke rules up into multiple elements so that side effects from one style won't give us false negatives. This now has a subtest that was failing without the fix in this patch. Canonical link: https://commits.webkit.org/236669@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-17 01:08:45 +00:00
PASS getComputedStyle(testfontsize).fontSize is "30px"
PASS getComputedStyle(testcalc).width is "900px"
PASS getComputedStyle(testfontsizecalc).fontSize is "60px"
Viewport percentage tests that resize the viewport are flaky https://bugs.webkit.org/show_bug.cgi?id=133351 Reviewed by Anders Carlsson. Source/WebCore: * page/FrameView.cpp: (WebCore::FrameView::setFrameRect): Removed code that explicitly sends a resize event here. The resize event will be sent as a side effect of layout instead. (WebCore::FrameView::sendResizeEventIfNeeded): Don't send a resize event until layout is done, since this is what propagates the new geometry in so the JavaScript code can detect it. Also simplified the logic and streamlined a little, and added a FIXME about the bad idea here where the code enqueues an event for an unknown time in the future. Removed the unneeded code that passes in the DOM window as the target to dispatchWindowEvent, since that gets filled in as the target by default. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (sizeWebViewForCurrentTest): Added a call to reset the window origin, which happens to be stored in the UI delegate object. This is part of resetting the window position. * DumpRenderTree/mac/UIDelegate.h: Store the window origin rather than storing a frame rectangle. The size is stored in the size of the web view itself. * DumpRenderTree/mac/UIDelegate.mm: (-[UIDelegate resetWindowOrigin]): Added. (-[UIDelegate webView:setFrame:]): Changed to set the size of the web view. The old version would store the frame, but not resize the web view! (-[UIDelegate webViewFrame:]): Get the size from the web view. * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: (WTR::PlatformWebView::setWindowFrame): Added code to resize the web view. * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: (WTR::PlatformWebView::resizeTo): Added a comment about missing code to resize the window. * WebKitTestRunner/ios/PlatformWebViewIOS.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. * WebKitTestRunner/mac/PlatformWebViewMac.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. LayoutTests: * css3/viewport-percentage-lengths/resources/resize-test.js: Added code to compensate for the difference between innerWidth/Height and outerWidth/Height so this works well in a browser window. Added code to "warm up" so the first resize triggers a resize event. Tweaked style of the code a bit. Use resize events to avoid flakiness due to race conditions. One thing I did not fix is the "out of order" problem where all the test results get written out after the words TEST COMPLETE. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html: Changed this test to use the shared resize-test.js. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: Updated due to changes to the underlying test machinery, and also to show both expected success, and some expected failures. These failures were going unnoticed before since the test didn't successfully do any resizing of the web view. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Streamlined this test a little. * fast/dom/Window/window-resize-contents-expected.txt: Updated to reflect the test actually resizing. The old test results expected no resizing to occur. * fast/dom/Window/window-resize-contents.html: Updated to use a resize event handler so the test can successfully test asynchronous resizes like the ones done by WebKit2. * fast/dom/rtl-scroll-to-leftmost-and-resize.html: Updated to use a resize event handler so this can test asynchronous resizes. Also fixed code that was treating the arguments to resizeTo as if they were inner coordinates rather than outer. However, the bug this tests for has not been fixed, so need to expect failures. * platform/mac/TestExpectations: Added a failure expection for the test above. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.png: Updated to expect a result that successfully resized. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.txt: Ditto. Canonical link: https://commits.webkit.org/151445@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-01 00:01:16 +00:00
PASS getComputedStyle(testpseudo, ':after').marginLeft is "120px"
Separate render tree updating from style resolve https://bugs.webkit.org/show_bug.cgi?id=155298 Reviewed by Andreas Kling. Source/WebCore: This patch splits computing document style and applying the results into two distinct steps: Style::TreeResolver::resolve() | | Style::Update V RenderTreeUpdater::commit() Style::TreeResolver::resolve() returns a Style::Update object that contains all the changes to be made for the whole composed tree. RenderTreeUpdater then applies the changes updating, building or tearing down portions of the render tree as needed. Style::Update consists of a map that contains new style for each newly resolved element along with some metadata. A separate map contains text nodes that require reconstruction. It also tracks change roots so RenderTreeUpdater needs to traverse the changed subtrees only. The patch eliminates the recursive render tree build code path replacing it with iterative functions. This will enable future optimizations. For example we won't need to commit to immediate rendering changes simply because some script or internal function requires up-to-date style. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * css/StyleResolver.cpp: (WebCore::StyleResolver::State::State): (WebCore::StyleResolver::styleForElement): * css/StyleResolver.h: (WebCore::StyleResolver::setOverrideDocumentElementStyle): (WebCore::StyleResolver::State::State): Root element style is needed for resolving other elements. Add a way to provide it without looking into active document style. * dom/Document.cpp: (WebCore::Document::recalcStyle): Resolve the document style and commit it immediately (for now). (WebCore::Document::styleForElementIgnoringPendingStylesheets): * dom/Document.h: (WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet): (WebCore::Document::inStyleRecalc): (WebCore::Document::inRenderTreeUpdate): * dom/Element.cpp: (WebCore::Element::setChildIndex): Setting the unique bit is now done by style relations update code. * dom/Node.cpp: (WebCore::Node::setNeedsStyleRecalc): Prevent spurious style invalidation during render tree updating. * rendering/RenderBox.cpp: (WebCore::RenderBox::styleDidChange): Capturing body element color for color:-webkit-text is now done by TreeResolver. * rendering/RenderElement.h: (WebCore::RenderElement::setAnimatableStyle): Deleted. No longer used. * style/RenderTreePosition.cpp: (WebCore::RenderTreePosition::nextSiblingRenderer): Skip over non-rendered slot elements. * style/RenderTreeUpdater.cpp: Added. (WebCore::RenderTreeUpdater::Parent::Parent): (WebCore::RenderTreeUpdater::RenderTreeUpdater): (WebCore::hasDisplayContents): (WebCore::findRenderingRoot): (WebCore::RenderTreeUpdater::commit): Call updateRenderTree for each change root. (WebCore::shouldCreateRenderer): (WebCore::RenderTreeUpdater::updateRenderTree): Iteratively traverse the composed tree starting for a change root. Apply the changes calling updateElementRenderer and updateTextRenderer as needed. Enter subtrees that haves changes to apply. (WebCore::RenderTreeUpdater::renderTreePosition): We may not create renderers for all elements (<slot> or more generally display:contents) that have rendered descendants. Search the parent stack to find the valid position. (WebCore::RenderTreeUpdater::pushParent): (WebCore::RenderTreeUpdater::popParent): (WebCore::RenderTreeUpdater::popParentsToDepth): Maintain parent stack. (WebCore::pseudoStyleCacheIsInvalid): (WebCore::RenderTreeUpdater::updateElementRenderer): Create, delete or update the renderer. (WebCore::moveToFlowThreadIfNeeded): (WebCore::RenderTreeUpdater::createRenderer): (WebCore::textRendererIsNeeded): (WebCore::createTextRenderer): (WebCore::RenderTreeUpdater::updateTextRenderer): (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): This is moved from TreeResolver. (WebCore::needsPseudoElement): (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement): Pseudo elements are handled entirely during render tree construction. Compute their style and create or delete them as needed. * style/RenderTreeUpdater.h: Added. (WebCore::RenderTreeUpdater::parent): * style/StyleRelations.cpp: (WebCore::Style::commitRelationsToRenderStyle): (WebCore::Style::commitRelations): Commit to Style::Update instead of the document if needed. (WebCore::Style::commitRelationsToDocument): Deleted. * style/StyleRelations.h: * style/StyleSharingResolver.cpp: (WebCore::Style::elementHasDirectionAuto): (WebCore::Style::SharingResolver::resolve): Fetch the shareable style from Style::Update instead of the active document style. (WebCore::Style::SharingResolver::findSibling): (WebCore::Style::SharingResolver::canShareStyleWithElement): * style/StyleSharingResolver.h: * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::Parent::Parent): No need for render tree position anymore. (WebCore::Style::TreeResolver::popScope): (WebCore::Style::TreeResolver::styleForElement): (WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): (WebCore::Style::createTextRendererIfNeeded): (WebCore::Style::updateTextRendererAfterContentChange): (WebCore::Style::resetStyleForNonRenderedDescendants): (WebCore::Style::detachChildren): (WebCore::Style::detachSlotAssignees): (WebCore::Style::detachRenderTree): (WebCore::Style::TreeResolver::resolveElement): Just resolve the style and return it, no more applying or entering render tree construction code paths. (WebCore::Style::resolveTextNode): (WebCore::Style::elementImplicitVisibility): (WebCore::Style::TreeResolver::pushParent): (WebCore::Style::TreeResolver::popParent): (WebCore::Style::TreeResolver::popParentsToDepth): (WebCore::Style::shouldResolvePseudoElement): (WebCore::Style::TreeResolver::resolveComposedTree): Add style changes to Style::Update. (WebCore::Style::TreeResolver::resolve): Return Style::Update object if non-empty. (WebCore::Style::postResolutionCallbackQueue): (WebCore::Style::shouldCreateRenderer): Deleted. (WebCore::Style::moveToFlowThreadIfNeeded): Deleted. (WebCore::Style::TreeResolver::createRenderer): Deleted. (WebCore::Style::TreeResolver::createRenderTreeForChildren): Deleted. (WebCore::Style::TreeResolver::createRenderTreeForShadowRoot): Deleted. (WebCore::Style::beforeOrAfterPseudoElement): Deleted. (WebCore::Style::setBeforeOrAfterPseudoElement): Deleted. (WebCore::Style::clearBeforeOrAfterPseudoElement): Deleted. (WebCore::Style::needsPseudoElement): Deleted. (WebCore::Style::TreeResolver::createRenderTreeForBeforeOrAfterPseudoElement): Deleted. (WebCore::Style::TreeResolver::createRenderTreeForSlotAssignees): Deleted. (WebCore::Style::TreeResolver::createRenderTreeRecursively): Deleted. (WebCore::Style::pseudoStyleCacheIsInvalid): Deleted. (WebCore::Style::TreeResolver::resolveBeforeOrAfterPseudoElement): Deleted. Remove the recursive render tree building code path. * style/StyleTreeResolver.h: (WebCore::Style::TreeResolver::scope): * style/StyleUpdate.cpp: Added. (WebCore::Style::Update::Update): (WebCore::Style::Update::elementUpdate): (WebCore::Style::Update::textUpdate): (WebCore::Style::Update::elementStyle): (WebCore::Style::Update::addElement): (WebCore::Style::Update::addText): (WebCore::Style::Update::addPossibleRoot): * style/StyleUpdate.h: Added. (WebCore::Style::Update::roots): (WebCore::Style::Update::document): * svg/SVGElement.h: (WebCore::SVGElement::updateRelativeLengthsInformation): * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::svgAttributeChanged): (WebCore::SVGUseElement::willRecalcStyle): (WebCore::SVGUseElement::willAttachRenderers): Deleted. Switvh willAttachRenderers to willRecalcStyle as the former is now called too late. * svg/SVGUseElement.h: LayoutTests: * TestExpectations: Skip mathml/presentation/menclose-notation-attribute-change-value.html. It will be fixed by upcoming MathML refactoring. * css3/blending/repaint/blend-mode-isolate-stacking-context-expected.txt: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: This is a progression. * editing/mac/spelling/autocorrection-contraction-expected.txt: * editing/mac/spelling/autocorrection-removing-underline-after-paste-expected.txt: * editing/mac/spelling/autocorrection-removing-underline-expected.txt: * editing/mac/spelling/autocorrection-simple-expected.txt: * editing/style/remove-underline-from-stylesheet-expected.txt: * editing/style/typing-style-003-expected.txt: Non-rendered whitespace related changes. * platform/ios-simulator/TestExpectations: Skip fast/regions/position-writing-modes-in-variable-width-regions.html on iOS. Similar tests are mostly already skipped. * platform/ios-simulator/editing/style/typing-style-003-expected.txt: Added. * platform/mac-wk2/editing/mac/spelling/autocorrection-contraction-expected.txt: * platform/mac/editing/inserting/editable-html-element-expected.txt: * platform/mac/editing/inserting/editing-empty-divs-expected.txt: * platform/mac/editing/inserting/insert-at-end-02-expected.txt: * platform/mac/editing/pasteboard/4989774-expected.txt: * platform/mac/editing/selection/4983858-expected.txt: Non-rendered whitespace related changes. Canonical link: https://commits.webkit.org/174230@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-01 09:54:12 +00:00
PASS getComputedStyle(testpseudo, ':after').paddingRight is "225px"
font-size with viewport units in calc() doesn't change when viewport resizes https://bugs.webkit.org/show_bug.cgi?id=224614 Reviewed by Zalan Bujtas. Source/WebCore: * css/CSSToLengthConversionData.cpp: (WebCore::CSSToLengthConversionData::zoom const): Updated since m_zoom is now optional. We use effectiveZoom when m_zoom is not specified, which is the same semantic that was implemented before with a separate boolean. (WebCore::CSSToLengthConversionData::viewportWidthFactor const): When calling the setHasViewportUnits function as a side effect, use m_viewportDependencyDetectionStyle, rather than always using m_style. This lets us handle the font-size case correctly. Also removed the explicit computingFontSize check for the same reason. (WebCore::CSSToLengthConversionData::viewportHeightFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMinFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMaxFactor const): Ditto. * css/CSSToLengthConversionData.h: Added a new member, m_viewportDependencyDetectionStyle, which defaults to the same value as m_style. Also changed m_zoom to use Optional instead of a separate boolean and an ignored "must be 1.0" value. Initialized data members in the modern way, allowing us to use the default constructor. * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueFontSize): Pass in the builder's style as the viewportDependencyDetectionStyle. This does the same thing that the existing code to call setHasViewportUnits did directly, but does it even for more complex cases involving calc(). Also made the isLength and isCalculatedPercentageWithLength cases more similar to each other and left a FIXME behind about taking that a bit further, but doing that probably requires creating some more test cases. LayoutTests: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Added tests that involve calc, and broke rules up into multiple elements so that side effects from one style won't give us false negatives. This now has a subtest that was failing without the fix in this patch. Canonical link: https://commits.webkit.org/236669@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-17 01:08:45 +00:00
PASS getComputedStyle(testpseudocalc, ':after').marginLeft is "240px"
PASS getComputedStyle(testpseudocalc, ':after').paddingRight is "450px"
Viewport percentage tests that resize the viewport are flaky https://bugs.webkit.org/show_bug.cgi?id=133351 Reviewed by Anders Carlsson. Source/WebCore: * page/FrameView.cpp: (WebCore::FrameView::setFrameRect): Removed code that explicitly sends a resize event here. The resize event will be sent as a side effect of layout instead. (WebCore::FrameView::sendResizeEventIfNeeded): Don't send a resize event until layout is done, since this is what propagates the new geometry in so the JavaScript code can detect it. Also simplified the logic and streamlined a little, and added a FIXME about the bad idea here where the code enqueues an event for an unknown time in the future. Removed the unneeded code that passes in the DOM window as the target to dispatchWindowEvent, since that gets filled in as the target by default. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (sizeWebViewForCurrentTest): Added a call to reset the window origin, which happens to be stored in the UI delegate object. This is part of resetting the window position. * DumpRenderTree/mac/UIDelegate.h: Store the window origin rather than storing a frame rectangle. The size is stored in the size of the web view itself. * DumpRenderTree/mac/UIDelegate.mm: (-[UIDelegate resetWindowOrigin]): Added. (-[UIDelegate webView:setFrame:]): Changed to set the size of the web view. The old version would store the frame, but not resize the web view! (-[UIDelegate webViewFrame:]): Get the size from the web view. * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: (WTR::PlatformWebView::setWindowFrame): Added code to resize the web view. * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: (WTR::PlatformWebView::resizeTo): Added a comment about missing code to resize the window. * WebKitTestRunner/ios/PlatformWebViewIOS.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. * WebKitTestRunner/mac/PlatformWebViewMac.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. LayoutTests: * css3/viewport-percentage-lengths/resources/resize-test.js: Added code to compensate for the difference between innerWidth/Height and outerWidth/Height so this works well in a browser window. Added code to "warm up" so the first resize triggers a resize event. Tweaked style of the code a bit. Use resize events to avoid flakiness due to race conditions. One thing I did not fix is the "out of order" problem where all the test results get written out after the words TEST COMPLETE. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html: Changed this test to use the shared resize-test.js. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: Updated due to changes to the underlying test machinery, and also to show both expected success, and some expected failures. These failures were going unnoticed before since the test didn't successfully do any resizing of the web view. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Streamlined this test a little. * fast/dom/Window/window-resize-contents-expected.txt: Updated to reflect the test actually resizing. The old test results expected no resizing to occur. * fast/dom/Window/window-resize-contents.html: Updated to use a resize event handler so the test can successfully test asynchronous resizes like the ones done by WebKit2. * fast/dom/rtl-scroll-to-leftmost-and-resize.html: Updated to use a resize event handler so this can test asynchronous resizes. Also fixed code that was treating the arguments to resizeTo as if they were inner coordinates rather than outer. However, the bug this tests for has not been fixed, so need to expect failures. * platform/mac/TestExpectations: Added a failure expection for the test above. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.png: Updated to expect a result that successfully resized. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.txt: Ditto. Canonical link: https://commits.webkit.org/151445@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-01 00:01:16 +00:00
PASS innerWidth is 900
PASS innerHeight is 640
PASS getComputedStyle(test).width is "450px"
font-size with viewport units in calc() doesn't change when viewport resizes https://bugs.webkit.org/show_bug.cgi?id=224614 Reviewed by Zalan Bujtas. Source/WebCore: * css/CSSToLengthConversionData.cpp: (WebCore::CSSToLengthConversionData::zoom const): Updated since m_zoom is now optional. We use effectiveZoom when m_zoom is not specified, which is the same semantic that was implemented before with a separate boolean. (WebCore::CSSToLengthConversionData::viewportWidthFactor const): When calling the setHasViewportUnits function as a side effect, use m_viewportDependencyDetectionStyle, rather than always using m_style. This lets us handle the font-size case correctly. Also removed the explicit computingFontSize check for the same reason. (WebCore::CSSToLengthConversionData::viewportHeightFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMinFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMaxFactor const): Ditto. * css/CSSToLengthConversionData.h: Added a new member, m_viewportDependencyDetectionStyle, which defaults to the same value as m_style. Also changed m_zoom to use Optional instead of a separate boolean and an ignored "must be 1.0" value. Initialized data members in the modern way, allowing us to use the default constructor. * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueFontSize): Pass in the builder's style as the viewportDependencyDetectionStyle. This does the same thing that the existing code to call setHasViewportUnits did directly, but does it even for more complex cases involving calc(). Also made the isLength and isCalculatedPercentageWithLength cases more similar to each other and left a FIXME behind about taking that a bit further, but doing that probably requires creating some more test cases. LayoutTests: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Added tests that involve calc, and broke rules up into multiple elements so that side effects from one style won't give us false negatives. This now has a subtest that was failing without the fix in this patch. Canonical link: https://commits.webkit.org/236669@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-17 01:08:45 +00:00
PASS getComputedStyle(testfontsize).fontSize is "32px"
PASS getComputedStyle(testcalc).width is "900px"
PASS getComputedStyle(testfontsizecalc).fontSize is "64px"
Separate render tree updating from style resolve https://bugs.webkit.org/show_bug.cgi?id=155298 Reviewed by Andreas Kling. Source/WebCore: This patch splits computing document style and applying the results into two distinct steps: Style::TreeResolver::resolve() | | Style::Update V RenderTreeUpdater::commit() Style::TreeResolver::resolve() returns a Style::Update object that contains all the changes to be made for the whole composed tree. RenderTreeUpdater then applies the changes updating, building or tearing down portions of the render tree as needed. Style::Update consists of a map that contains new style for each newly resolved element along with some metadata. A separate map contains text nodes that require reconstruction. It also tracks change roots so RenderTreeUpdater needs to traverse the changed subtrees only. The patch eliminates the recursive render tree build code path replacing it with iterative functions. This will enable future optimizations. For example we won't need to commit to immediate rendering changes simply because some script or internal function requires up-to-date style. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * css/StyleResolver.cpp: (WebCore::StyleResolver::State::State): (WebCore::StyleResolver::styleForElement): * css/StyleResolver.h: (WebCore::StyleResolver::setOverrideDocumentElementStyle): (WebCore::StyleResolver::State::State): Root element style is needed for resolving other elements. Add a way to provide it without looking into active document style. * dom/Document.cpp: (WebCore::Document::recalcStyle): Resolve the document style and commit it immediately (for now). (WebCore::Document::styleForElementIgnoringPendingStylesheets): * dom/Document.h: (WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet): (WebCore::Document::inStyleRecalc): (WebCore::Document::inRenderTreeUpdate): * dom/Element.cpp: (WebCore::Element::setChildIndex): Setting the unique bit is now done by style relations update code. * dom/Node.cpp: (WebCore::Node::setNeedsStyleRecalc): Prevent spurious style invalidation during render tree updating. * rendering/RenderBox.cpp: (WebCore::RenderBox::styleDidChange): Capturing body element color for color:-webkit-text is now done by TreeResolver. * rendering/RenderElement.h: (WebCore::RenderElement::setAnimatableStyle): Deleted. No longer used. * style/RenderTreePosition.cpp: (WebCore::RenderTreePosition::nextSiblingRenderer): Skip over non-rendered slot elements. * style/RenderTreeUpdater.cpp: Added. (WebCore::RenderTreeUpdater::Parent::Parent): (WebCore::RenderTreeUpdater::RenderTreeUpdater): (WebCore::hasDisplayContents): (WebCore::findRenderingRoot): (WebCore::RenderTreeUpdater::commit): Call updateRenderTree for each change root. (WebCore::shouldCreateRenderer): (WebCore::RenderTreeUpdater::updateRenderTree): Iteratively traverse the composed tree starting for a change root. Apply the changes calling updateElementRenderer and updateTextRenderer as needed. Enter subtrees that haves changes to apply. (WebCore::RenderTreeUpdater::renderTreePosition): We may not create renderers for all elements (<slot> or more generally display:contents) that have rendered descendants. Search the parent stack to find the valid position. (WebCore::RenderTreeUpdater::pushParent): (WebCore::RenderTreeUpdater::popParent): (WebCore::RenderTreeUpdater::popParentsToDepth): Maintain parent stack. (WebCore::pseudoStyleCacheIsInvalid): (WebCore::RenderTreeUpdater::updateElementRenderer): Create, delete or update the renderer. (WebCore::moveToFlowThreadIfNeeded): (WebCore::RenderTreeUpdater::createRenderer): (WebCore::textRendererIsNeeded): (WebCore::createTextRenderer): (WebCore::RenderTreeUpdater::updateTextRenderer): (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): This is moved from TreeResolver. (WebCore::needsPseudoElement): (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement): Pseudo elements are handled entirely during render tree construction. Compute their style and create or delete them as needed. * style/RenderTreeUpdater.h: Added. (WebCore::RenderTreeUpdater::parent): * style/StyleRelations.cpp: (WebCore::Style::commitRelationsToRenderStyle): (WebCore::Style::commitRelations): Commit to Style::Update instead of the document if needed. (WebCore::Style::commitRelationsToDocument): Deleted. * style/StyleRelations.h: * style/StyleSharingResolver.cpp: (WebCore::Style::elementHasDirectionAuto): (WebCore::Style::SharingResolver::resolve): Fetch the shareable style from Style::Update instead of the active document style. (WebCore::Style::SharingResolver::findSibling): (WebCore::Style::SharingResolver::canShareStyleWithElement): * style/StyleSharingResolver.h: * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::Parent::Parent): No need for render tree position anymore. (WebCore::Style::TreeResolver::popScope): (WebCore::Style::TreeResolver::styleForElement): (WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): (WebCore::Style::createTextRendererIfNeeded): (WebCore::Style::updateTextRendererAfterContentChange): (WebCore::Style::resetStyleForNonRenderedDescendants): (WebCore::Style::detachChildren): (WebCore::Style::detachSlotAssignees): (WebCore::Style::detachRenderTree): (WebCore::Style::TreeResolver::resolveElement): Just resolve the style and return it, no more applying or entering render tree construction code paths. (WebCore::Style::resolveTextNode): (WebCore::Style::elementImplicitVisibility): (WebCore::Style::TreeResolver::pushParent): (WebCore::Style::TreeResolver::popParent): (WebCore::Style::TreeResolver::popParentsToDepth): (WebCore::Style::shouldResolvePseudoElement): (WebCore::Style::TreeResolver::resolveComposedTree): Add style changes to Style::Update. (WebCore::Style::TreeResolver::resolve): Return Style::Update object if non-empty. (WebCore::Style::postResolutionCallbackQueue): (WebCore::Style::shouldCreateRenderer): Deleted. (WebCore::Style::moveToFlowThreadIfNeeded): Deleted. (WebCore::Style::TreeResolver::createRenderer): Deleted. (WebCore::Style::TreeResolver::createRenderTreeForChildren): Deleted. (WebCore::Style::TreeResolver::createRenderTreeForShadowRoot): Deleted. (WebCore::Style::beforeOrAfterPseudoElement): Deleted. (WebCore::Style::setBeforeOrAfterPseudoElement): Deleted. (WebCore::Style::clearBeforeOrAfterPseudoElement): Deleted. (WebCore::Style::needsPseudoElement): Deleted. (WebCore::Style::TreeResolver::createRenderTreeForBeforeOrAfterPseudoElement): Deleted. (WebCore::Style::TreeResolver::createRenderTreeForSlotAssignees): Deleted. (WebCore::Style::TreeResolver::createRenderTreeRecursively): Deleted. (WebCore::Style::pseudoStyleCacheIsInvalid): Deleted. (WebCore::Style::TreeResolver::resolveBeforeOrAfterPseudoElement): Deleted. Remove the recursive render tree building code path. * style/StyleTreeResolver.h: (WebCore::Style::TreeResolver::scope): * style/StyleUpdate.cpp: Added. (WebCore::Style::Update::Update): (WebCore::Style::Update::elementUpdate): (WebCore::Style::Update::textUpdate): (WebCore::Style::Update::elementStyle): (WebCore::Style::Update::addElement): (WebCore::Style::Update::addText): (WebCore::Style::Update::addPossibleRoot): * style/StyleUpdate.h: Added. (WebCore::Style::Update::roots): (WebCore::Style::Update::document): * svg/SVGElement.h: (WebCore::SVGElement::updateRelativeLengthsInformation): * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::svgAttributeChanged): (WebCore::SVGUseElement::willRecalcStyle): (WebCore::SVGUseElement::willAttachRenderers): Deleted. Switvh willAttachRenderers to willRecalcStyle as the former is now called too late. * svg/SVGUseElement.h: LayoutTests: * TestExpectations: Skip mathml/presentation/menclose-notation-attribute-change-value.html. It will be fixed by upcoming MathML refactoring. * css3/blending/repaint/blend-mode-isolate-stacking-context-expected.txt: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: This is a progression. * editing/mac/spelling/autocorrection-contraction-expected.txt: * editing/mac/spelling/autocorrection-removing-underline-after-paste-expected.txt: * editing/mac/spelling/autocorrection-removing-underline-expected.txt: * editing/mac/spelling/autocorrection-simple-expected.txt: * editing/style/remove-underline-from-stylesheet-expected.txt: * editing/style/typing-style-003-expected.txt: Non-rendered whitespace related changes. * platform/ios-simulator/TestExpectations: Skip fast/regions/position-writing-modes-in-variable-width-regions.html on iOS. Similar tests are mostly already skipped. * platform/ios-simulator/editing/style/typing-style-003-expected.txt: Added. * platform/mac-wk2/editing/mac/spelling/autocorrection-contraction-expected.txt: * platform/mac/editing/inserting/editable-html-element-expected.txt: * platform/mac/editing/inserting/editing-empty-divs-expected.txt: * platform/mac/editing/inserting/insert-at-end-02-expected.txt: * platform/mac/editing/pasteboard/4989774-expected.txt: * platform/mac/editing/selection/4983858-expected.txt: Non-rendered whitespace related changes. Canonical link: https://commits.webkit.org/174230@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-01 09:54:12 +00:00
PASS getComputedStyle(testpseudo, ':after').marginLeft is "128px"
PASS getComputedStyle(testpseudo, ':after').paddingRight is "225px"
font-size with viewport units in calc() doesn't change when viewport resizes https://bugs.webkit.org/show_bug.cgi?id=224614 Reviewed by Zalan Bujtas. Source/WebCore: * css/CSSToLengthConversionData.cpp: (WebCore::CSSToLengthConversionData::zoom const): Updated since m_zoom is now optional. We use effectiveZoom when m_zoom is not specified, which is the same semantic that was implemented before with a separate boolean. (WebCore::CSSToLengthConversionData::viewportWidthFactor const): When calling the setHasViewportUnits function as a side effect, use m_viewportDependencyDetectionStyle, rather than always using m_style. This lets us handle the font-size case correctly. Also removed the explicit computingFontSize check for the same reason. (WebCore::CSSToLengthConversionData::viewportHeightFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMinFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMaxFactor const): Ditto. * css/CSSToLengthConversionData.h: Added a new member, m_viewportDependencyDetectionStyle, which defaults to the same value as m_style. Also changed m_zoom to use Optional instead of a separate boolean and an ignored "must be 1.0" value. Initialized data members in the modern way, allowing us to use the default constructor. * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueFontSize): Pass in the builder's style as the viewportDependencyDetectionStyle. This does the same thing that the existing code to call setHasViewportUnits did directly, but does it even for more complex cases involving calc(). Also made the isLength and isCalculatedPercentageWithLength cases more similar to each other and left a FIXME behind about taking that a bit further, but doing that probably requires creating some more test cases. LayoutTests: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Added tests that involve calc, and broke rules up into multiple elements so that side effects from one style won't give us false negatives. This now has a subtest that was failing without the fix in this patch. Canonical link: https://commits.webkit.org/236669@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-17 01:08:45 +00:00
PASS getComputedStyle(testpseudocalc, ':after').marginLeft is "256px"
PASS getComputedStyle(testpseudocalc, ':after').paddingRight is "450px"
Viewport percentage tests that resize the viewport are flaky https://bugs.webkit.org/show_bug.cgi?id=133351 Reviewed by Anders Carlsson. Source/WebCore: * page/FrameView.cpp: (WebCore::FrameView::setFrameRect): Removed code that explicitly sends a resize event here. The resize event will be sent as a side effect of layout instead. (WebCore::FrameView::sendResizeEventIfNeeded): Don't send a resize event until layout is done, since this is what propagates the new geometry in so the JavaScript code can detect it. Also simplified the logic and streamlined a little, and added a FIXME about the bad idea here where the code enqueues an event for an unknown time in the future. Removed the unneeded code that passes in the DOM window as the target to dispatchWindowEvent, since that gets filled in as the target by default. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (sizeWebViewForCurrentTest): Added a call to reset the window origin, which happens to be stored in the UI delegate object. This is part of resetting the window position. * DumpRenderTree/mac/UIDelegate.h: Store the window origin rather than storing a frame rectangle. The size is stored in the size of the web view itself. * DumpRenderTree/mac/UIDelegate.mm: (-[UIDelegate resetWindowOrigin]): Added. (-[UIDelegate webView:setFrame:]): Changed to set the size of the web view. The old version would store the frame, but not resize the web view! (-[UIDelegate webViewFrame:]): Get the size from the web view. * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: (WTR::PlatformWebView::setWindowFrame): Added code to resize the web view. * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: (WTR::PlatformWebView::resizeTo): Added a comment about missing code to resize the window. * WebKitTestRunner/ios/PlatformWebViewIOS.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. * WebKitTestRunner/mac/PlatformWebViewMac.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. LayoutTests: * css3/viewport-percentage-lengths/resources/resize-test.js: Added code to compensate for the difference between innerWidth/Height and outerWidth/Height so this works well in a browser window. Added code to "warm up" so the first resize triggers a resize event. Tweaked style of the code a bit. Use resize events to avoid flakiness due to race conditions. One thing I did not fix is the "out of order" problem where all the test results get written out after the words TEST COMPLETE. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html: Changed this test to use the shared resize-test.js. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: Updated due to changes to the underlying test machinery, and also to show both expected success, and some expected failures. These failures were going unnoticed before since the test didn't successfully do any resizing of the web view. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Streamlined this test a little. * fast/dom/Window/window-resize-contents-expected.txt: Updated to reflect the test actually resizing. The old test results expected no resizing to occur. * fast/dom/Window/window-resize-contents.html: Updated to use a resize event handler so the test can successfully test asynchronous resizes like the ones done by WebKit2. * fast/dom/rtl-scroll-to-leftmost-and-resize.html: Updated to use a resize event handler so this can test asynchronous resizes. Also fixed code that was treating the arguments to resizeTo as if they were inner coordinates rather than outer. However, the bug this tests for has not been fixed, so need to expect failures. * platform/mac/TestExpectations: Added a failure expection for the test above. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.png: Updated to expect a result that successfully resized. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.txt: Ditto. Canonical link: https://commits.webkit.org/151445@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-01 00:01:16 +00:00
PASS innerWidth is 500
PASS innerHeight is 640
PASS getComputedStyle(test).width is "250px"
font-size with viewport units in calc() doesn't change when viewport resizes https://bugs.webkit.org/show_bug.cgi?id=224614 Reviewed by Zalan Bujtas. Source/WebCore: * css/CSSToLengthConversionData.cpp: (WebCore::CSSToLengthConversionData::zoom const): Updated since m_zoom is now optional. We use effectiveZoom when m_zoom is not specified, which is the same semantic that was implemented before with a separate boolean. (WebCore::CSSToLengthConversionData::viewportWidthFactor const): When calling the setHasViewportUnits function as a side effect, use m_viewportDependencyDetectionStyle, rather than always using m_style. This lets us handle the font-size case correctly. Also removed the explicit computingFontSize check for the same reason. (WebCore::CSSToLengthConversionData::viewportHeightFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMinFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMaxFactor const): Ditto. * css/CSSToLengthConversionData.h: Added a new member, m_viewportDependencyDetectionStyle, which defaults to the same value as m_style. Also changed m_zoom to use Optional instead of a separate boolean and an ignored "must be 1.0" value. Initialized data members in the modern way, allowing us to use the default constructor. * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueFontSize): Pass in the builder's style as the viewportDependencyDetectionStyle. This does the same thing that the existing code to call setHasViewportUnits did directly, but does it even for more complex cases involving calc(). Also made the isLength and isCalculatedPercentageWithLength cases more similar to each other and left a FIXME behind about taking that a bit further, but doing that probably requires creating some more test cases. LayoutTests: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Added tests that involve calc, and broke rules up into multiple elements so that side effects from one style won't give us false negatives. This now has a subtest that was failing without the fix in this patch. Canonical link: https://commits.webkit.org/236669@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-17 01:08:45 +00:00
PASS getComputedStyle(testfontsize).fontSize is "32px"
PASS getComputedStyle(testcalc).width is "500px"
PASS getComputedStyle(testfontsizecalc).fontSize is "64px"
Separate render tree updating from style resolve https://bugs.webkit.org/show_bug.cgi?id=155298 Reviewed by Andreas Kling. Source/WebCore: This patch splits computing document style and applying the results into two distinct steps: Style::TreeResolver::resolve() | | Style::Update V RenderTreeUpdater::commit() Style::TreeResolver::resolve() returns a Style::Update object that contains all the changes to be made for the whole composed tree. RenderTreeUpdater then applies the changes updating, building or tearing down portions of the render tree as needed. Style::Update consists of a map that contains new style for each newly resolved element along with some metadata. A separate map contains text nodes that require reconstruction. It also tracks change roots so RenderTreeUpdater needs to traverse the changed subtrees only. The patch eliminates the recursive render tree build code path replacing it with iterative functions. This will enable future optimizations. For example we won't need to commit to immediate rendering changes simply because some script or internal function requires up-to-date style. * CMakeLists.txt: * WebCore.xcodeproj/project.pbxproj: * css/StyleResolver.cpp: (WebCore::StyleResolver::State::State): (WebCore::StyleResolver::styleForElement): * css/StyleResolver.h: (WebCore::StyleResolver::setOverrideDocumentElementStyle): (WebCore::StyleResolver::State::State): Root element style is needed for resolving other elements. Add a way to provide it without looking into active document style. * dom/Document.cpp: (WebCore::Document::recalcStyle): Resolve the document style and commit it immediately (for now). (WebCore::Document::styleForElementIgnoringPendingStylesheets): * dom/Document.h: (WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet): (WebCore::Document::inStyleRecalc): (WebCore::Document::inRenderTreeUpdate): * dom/Element.cpp: (WebCore::Element::setChildIndex): Setting the unique bit is now done by style relations update code. * dom/Node.cpp: (WebCore::Node::setNeedsStyleRecalc): Prevent spurious style invalidation during render tree updating. * rendering/RenderBox.cpp: (WebCore::RenderBox::styleDidChange): Capturing body element color for color:-webkit-text is now done by TreeResolver. * rendering/RenderElement.h: (WebCore::RenderElement::setAnimatableStyle): Deleted. No longer used. * style/RenderTreePosition.cpp: (WebCore::RenderTreePosition::nextSiblingRenderer): Skip over non-rendered slot elements. * style/RenderTreeUpdater.cpp: Added. (WebCore::RenderTreeUpdater::Parent::Parent): (WebCore::RenderTreeUpdater::RenderTreeUpdater): (WebCore::hasDisplayContents): (WebCore::findRenderingRoot): (WebCore::RenderTreeUpdater::commit): Call updateRenderTree for each change root. (WebCore::shouldCreateRenderer): (WebCore::RenderTreeUpdater::updateRenderTree): Iteratively traverse the composed tree starting for a change root. Apply the changes calling updateElementRenderer and updateTextRenderer as needed. Enter subtrees that haves changes to apply. (WebCore::RenderTreeUpdater::renderTreePosition): We may not create renderers for all elements (<slot> or more generally display:contents) that have rendered descendants. Search the parent stack to find the valid position. (WebCore::RenderTreeUpdater::pushParent): (WebCore::RenderTreeUpdater::popParent): (WebCore::RenderTreeUpdater::popParentsToDepth): Maintain parent stack. (WebCore::pseudoStyleCacheIsInvalid): (WebCore::RenderTreeUpdater::updateElementRenderer): Create, delete or update the renderer. (WebCore::moveToFlowThreadIfNeeded): (WebCore::RenderTreeUpdater::createRenderer): (WebCore::textRendererIsNeeded): (WebCore::createTextRenderer): (WebCore::RenderTreeUpdater::updateTextRenderer): (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): This is moved from TreeResolver. (WebCore::needsPseudoElement): (WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement): Pseudo elements are handled entirely during render tree construction. Compute their style and create or delete them as needed. * style/RenderTreeUpdater.h: Added. (WebCore::RenderTreeUpdater::parent): * style/StyleRelations.cpp: (WebCore::Style::commitRelationsToRenderStyle): (WebCore::Style::commitRelations): Commit to Style::Update instead of the document if needed. (WebCore::Style::commitRelationsToDocument): Deleted. * style/StyleRelations.h: * style/StyleSharingResolver.cpp: (WebCore::Style::elementHasDirectionAuto): (WebCore::Style::SharingResolver::resolve): Fetch the shareable style from Style::Update instead of the active document style. (WebCore::Style::SharingResolver::findSibling): (WebCore::Style::SharingResolver::canShareStyleWithElement): * style/StyleSharingResolver.h: * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::Parent::Parent): No need for render tree position anymore. (WebCore::Style::TreeResolver::popScope): (WebCore::Style::TreeResolver::styleForElement): (WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): (WebCore::Style::createTextRendererIfNeeded): (WebCore::Style::updateTextRendererAfterContentChange): (WebCore::Style::resetStyleForNonRenderedDescendants): (WebCore::Style::detachChildren): (WebCore::Style::detachSlotAssignees): (WebCore::Style::detachRenderTree): (WebCore::Style::TreeResolver::resolveElement): Just resolve the style and return it, no more applying or entering render tree construction code paths. (WebCore::Style::resolveTextNode): (WebCore::Style::elementImplicitVisibility): (WebCore::Style::TreeResolver::pushParent): (WebCore::Style::TreeResolver::popParent): (WebCore::Style::TreeResolver::popParentsToDepth): (WebCore::Style::shouldResolvePseudoElement): (WebCore::Style::TreeResolver::resolveComposedTree): Add style changes to Style::Update. (WebCore::Style::TreeResolver::resolve): Return Style::Update object if non-empty. (WebCore::Style::postResolutionCallbackQueue): (WebCore::Style::shouldCreateRenderer): Deleted. (WebCore::Style::moveToFlowThreadIfNeeded): Deleted. (WebCore::Style::TreeResolver::createRenderer): Deleted. (WebCore::Style::TreeResolver::createRenderTreeForChildren): Deleted. (WebCore::Style::TreeResolver::createRenderTreeForShadowRoot): Deleted. (WebCore::Style::beforeOrAfterPseudoElement): Deleted. (WebCore::Style::setBeforeOrAfterPseudoElement): Deleted. (WebCore::Style::clearBeforeOrAfterPseudoElement): Deleted. (WebCore::Style::needsPseudoElement): Deleted. (WebCore::Style::TreeResolver::createRenderTreeForBeforeOrAfterPseudoElement): Deleted. (WebCore::Style::TreeResolver::createRenderTreeForSlotAssignees): Deleted. (WebCore::Style::TreeResolver::createRenderTreeRecursively): Deleted. (WebCore::Style::pseudoStyleCacheIsInvalid): Deleted. (WebCore::Style::TreeResolver::resolveBeforeOrAfterPseudoElement): Deleted. Remove the recursive render tree building code path. * style/StyleTreeResolver.h: (WebCore::Style::TreeResolver::scope): * style/StyleUpdate.cpp: Added. (WebCore::Style::Update::Update): (WebCore::Style::Update::elementUpdate): (WebCore::Style::Update::textUpdate): (WebCore::Style::Update::elementStyle): (WebCore::Style::Update::addElement): (WebCore::Style::Update::addText): (WebCore::Style::Update::addPossibleRoot): * style/StyleUpdate.h: Added. (WebCore::Style::Update::roots): (WebCore::Style::Update::document): * svg/SVGElement.h: (WebCore::SVGElement::updateRelativeLengthsInformation): * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::svgAttributeChanged): (WebCore::SVGUseElement::willRecalcStyle): (WebCore::SVGUseElement::willAttachRenderers): Deleted. Switvh willAttachRenderers to willRecalcStyle as the former is now called too late. * svg/SVGUseElement.h: LayoutTests: * TestExpectations: Skip mathml/presentation/menclose-notation-attribute-change-value.html. It will be fixed by upcoming MathML refactoring. * css3/blending/repaint/blend-mode-isolate-stacking-context-expected.txt: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: This is a progression. * editing/mac/spelling/autocorrection-contraction-expected.txt: * editing/mac/spelling/autocorrection-removing-underline-after-paste-expected.txt: * editing/mac/spelling/autocorrection-removing-underline-expected.txt: * editing/mac/spelling/autocorrection-simple-expected.txt: * editing/style/remove-underline-from-stylesheet-expected.txt: * editing/style/typing-style-003-expected.txt: Non-rendered whitespace related changes. * platform/ios-simulator/TestExpectations: Skip fast/regions/position-writing-modes-in-variable-width-regions.html on iOS. Similar tests are mostly already skipped. * platform/ios-simulator/editing/style/typing-style-003-expected.txt: Added. * platform/mac-wk2/editing/mac/spelling/autocorrection-contraction-expected.txt: * platform/mac/editing/inserting/editable-html-element-expected.txt: * platform/mac/editing/inserting/editing-empty-divs-expected.txt: * platform/mac/editing/inserting/insert-at-end-02-expected.txt: * platform/mac/editing/pasteboard/4989774-expected.txt: * platform/mac/editing/selection/4983858-expected.txt: Non-rendered whitespace related changes. Canonical link: https://commits.webkit.org/174230@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198943 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-04-01 09:54:12 +00:00
PASS getComputedStyle(testpseudo, ':after').marginLeft is "100px"
PASS getComputedStyle(testpseudo, ':after').paddingRight is "160px"
font-size with viewport units in calc() doesn't change when viewport resizes https://bugs.webkit.org/show_bug.cgi?id=224614 Reviewed by Zalan Bujtas. Source/WebCore: * css/CSSToLengthConversionData.cpp: (WebCore::CSSToLengthConversionData::zoom const): Updated since m_zoom is now optional. We use effectiveZoom when m_zoom is not specified, which is the same semantic that was implemented before with a separate boolean. (WebCore::CSSToLengthConversionData::viewportWidthFactor const): When calling the setHasViewportUnits function as a side effect, use m_viewportDependencyDetectionStyle, rather than always using m_style. This lets us handle the font-size case correctly. Also removed the explicit computingFontSize check for the same reason. (WebCore::CSSToLengthConversionData::viewportHeightFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMinFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMaxFactor const): Ditto. * css/CSSToLengthConversionData.h: Added a new member, m_viewportDependencyDetectionStyle, which defaults to the same value as m_style. Also changed m_zoom to use Optional instead of a separate boolean and an ignored "must be 1.0" value. Initialized data members in the modern way, allowing us to use the default constructor. * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueFontSize): Pass in the builder's style as the viewportDependencyDetectionStyle. This does the same thing that the existing code to call setHasViewportUnits did directly, but does it even for more complex cases involving calc(). Also made the isLength and isCalculatedPercentageWithLength cases more similar to each other and left a FIXME behind about taking that a bit further, but doing that probably requires creating some more test cases. LayoutTests: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Added tests that involve calc, and broke rules up into multiple elements so that side effects from one style won't give us false negatives. This now has a subtest that was failing without the fix in this patch. Canonical link: https://commits.webkit.org/236669@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-17 01:08:45 +00:00
PASS getComputedStyle(testpseudocalc, ':after').marginLeft is "200px"
PASS getComputedStyle(testpseudocalc, ':after').paddingRight is "320px"
Viewport percentage tests that resize the viewport are flaky https://bugs.webkit.org/show_bug.cgi?id=133351 Reviewed by Anders Carlsson. Source/WebCore: * page/FrameView.cpp: (WebCore::FrameView::setFrameRect): Removed code that explicitly sends a resize event here. The resize event will be sent as a side effect of layout instead. (WebCore::FrameView::sendResizeEventIfNeeded): Don't send a resize event until layout is done, since this is what propagates the new geometry in so the JavaScript code can detect it. Also simplified the logic and streamlined a little, and added a FIXME about the bad idea here where the code enqueues an event for an unknown time in the future. Removed the unneeded code that passes in the DOM window as the target to dispatchWindowEvent, since that gets filled in as the target by default. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (sizeWebViewForCurrentTest): Added a call to reset the window origin, which happens to be stored in the UI delegate object. This is part of resetting the window position. * DumpRenderTree/mac/UIDelegate.h: Store the window origin rather than storing a frame rectangle. The size is stored in the size of the web view itself. * DumpRenderTree/mac/UIDelegate.mm: (-[UIDelegate resetWindowOrigin]): Added. (-[UIDelegate webView:setFrame:]): Changed to set the size of the web view. The old version would store the frame, but not resize the web view! (-[UIDelegate webViewFrame:]): Get the size from the web view. * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: (WTR::PlatformWebView::setWindowFrame): Added code to resize the web view. * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: (WTR::PlatformWebView::resizeTo): Added a comment about missing code to resize the window. * WebKitTestRunner/ios/PlatformWebViewIOS.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. * WebKitTestRunner/mac/PlatformWebViewMac.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. LayoutTests: * css3/viewport-percentage-lengths/resources/resize-test.js: Added code to compensate for the difference between innerWidth/Height and outerWidth/Height so this works well in a browser window. Added code to "warm up" so the first resize triggers a resize event. Tweaked style of the code a bit. Use resize events to avoid flakiness due to race conditions. One thing I did not fix is the "out of order" problem where all the test results get written out after the words TEST COMPLETE. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html: Changed this test to use the shared resize-test.js. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: Updated due to changes to the underlying test machinery, and also to show both expected success, and some expected failures. These failures were going unnoticed before since the test didn't successfully do any resizing of the web view. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Streamlined this test a little. * fast/dom/Window/window-resize-contents-expected.txt: Updated to reflect the test actually resizing. The old test results expected no resizing to occur. * fast/dom/Window/window-resize-contents.html: Updated to use a resize event handler so the test can successfully test asynchronous resizes like the ones done by WebKit2. * fast/dom/rtl-scroll-to-leftmost-and-resize.html: Updated to use a resize event handler so this can test asynchronous resizes. Also fixed code that was treating the arguments to resizeTo as if they were inner coordinates rather than outer. However, the bug this tests for has not been fixed, so need to expect failures. * platform/mac/TestExpectations: Added a failure expection for the test above. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.png: Updated to expect a result that successfully resized. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.txt: Ditto. Canonical link: https://commits.webkit.org/151445@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-01 00:01:16 +00:00
PASS innerWidth is 800
PASS innerHeight is 600
PASS getComputedStyle(test).width is "400px"
font-size with viewport units in calc() doesn't change when viewport resizes https://bugs.webkit.org/show_bug.cgi?id=224614 Reviewed by Zalan Bujtas. Source/WebCore: * css/CSSToLengthConversionData.cpp: (WebCore::CSSToLengthConversionData::zoom const): Updated since m_zoom is now optional. We use effectiveZoom when m_zoom is not specified, which is the same semantic that was implemented before with a separate boolean. (WebCore::CSSToLengthConversionData::viewportWidthFactor const): When calling the setHasViewportUnits function as a side effect, use m_viewportDependencyDetectionStyle, rather than always using m_style. This lets us handle the font-size case correctly. Also removed the explicit computingFontSize check for the same reason. (WebCore::CSSToLengthConversionData::viewportHeightFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMinFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMaxFactor const): Ditto. * css/CSSToLengthConversionData.h: Added a new member, m_viewportDependencyDetectionStyle, which defaults to the same value as m_style. Also changed m_zoom to use Optional instead of a separate boolean and an ignored "must be 1.0" value. Initialized data members in the modern way, allowing us to use the default constructor. * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueFontSize): Pass in the builder's style as the viewportDependencyDetectionStyle. This does the same thing that the existing code to call setHasViewportUnits did directly, but does it even for more complex cases involving calc(). Also made the isLength and isCalculatedPercentageWithLength cases more similar to each other and left a FIXME behind about taking that a bit further, but doing that probably requires creating some more test cases. LayoutTests: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Added tests that involve calc, and broke rules up into multiple elements so that side effects from one style won't give us false negatives. This now has a subtest that was failing without the fix in this patch. Canonical link: https://commits.webkit.org/236669@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-17 01:08:45 +00:00
PASS getComputedStyle(testfontsize).fontSize is "30px"
PASS getComputedStyle(testcalc).width is "800px"
PASS getComputedStyle(testfontsizecalc).fontSize is "60px"
Viewport percentage tests that resize the viewport are flaky https://bugs.webkit.org/show_bug.cgi?id=133351 Reviewed by Anders Carlsson. Source/WebCore: * page/FrameView.cpp: (WebCore::FrameView::setFrameRect): Removed code that explicitly sends a resize event here. The resize event will be sent as a side effect of layout instead. (WebCore::FrameView::sendResizeEventIfNeeded): Don't send a resize event until layout is done, since this is what propagates the new geometry in so the JavaScript code can detect it. Also simplified the logic and streamlined a little, and added a FIXME about the bad idea here where the code enqueues an event for an unknown time in the future. Removed the unneeded code that passes in the DOM window as the target to dispatchWindowEvent, since that gets filled in as the target by default. Tools: * DumpRenderTree/mac/DumpRenderTree.mm: (sizeWebViewForCurrentTest): Added a call to reset the window origin, which happens to be stored in the UI delegate object. This is part of resetting the window position. * DumpRenderTree/mac/UIDelegate.h: Store the window origin rather than storing a frame rectangle. The size is stored in the size of the web view itself. * DumpRenderTree/mac/UIDelegate.mm: (-[UIDelegate resetWindowOrigin]): Added. (-[UIDelegate webView:setFrame:]): Changed to set the size of the web view. The old version would store the frame, but not resize the web view! (-[UIDelegate webViewFrame:]): Get the size from the web view. * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: (WTR::PlatformWebView::setWindowFrame): Added code to resize the web view. * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: (WTR::PlatformWebView::resizeTo): Added a comment about missing code to resize the window. * WebKitTestRunner/ios/PlatformWebViewIOS.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. * WebKitTestRunner/mac/PlatformWebViewMac.mm: (WTR::PlatformWebView::resizeTo): Changed this to call setWindowFrame so the window gets resized too, not just the web view. (WTR::PlatformWebView::setWindowFrame): Added code to set the size of the web view. LayoutTests: * css3/viewport-percentage-lengths/resources/resize-test.js: Added code to compensate for the difference between innerWidth/Height and outerWidth/Height so this works well in a browser window. Added code to "warm up" so the first resize triggers a resize event. Tweaked style of the code a bit. Use resize events to avoid flakiness due to race conditions. One thing I did not fix is the "out of order" problem where all the test results get written out after the words TEST COMPLETE. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html: Changed this test to use the shared resize-test.js. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size-expected.txt: Updated due to changes to the underlying test machinery, and also to show actual expected success. The old results said PASS with various obviously wrong results. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html: Streamlined this test a little. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: Updated due to changes to the underlying test machinery, and also to show both expected success, and some expected failures. These failures were going unnoticed before since the test didn't successfully do any resizing of the web view. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Streamlined this test a little. * fast/dom/Window/window-resize-contents-expected.txt: Updated to reflect the test actually resizing. The old test results expected no resizing to occur. * fast/dom/Window/window-resize-contents.html: Updated to use a resize event handler so the test can successfully test asynchronous resizes like the ones done by WebKit2. * fast/dom/rtl-scroll-to-leftmost-and-resize.html: Updated to use a resize event handler so this can test asynchronous resizes. Also fixed code that was treating the arguments to resizeTo as if they were inner coordinates rather than outer. However, the bug this tests for has not been fixed, so need to expect failures. * platform/mac/TestExpectations: Added a failure expection for the test above. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.png: Updated to expect a result that successfully resized. * platform/mac/fast/dynamic/window-resize-scrollbars-test-expected.txt: Ditto. Canonical link: https://commits.webkit.org/151445@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-01 00:01:16 +00:00
PASS getComputedStyle(testpseudo, ':after').marginLeft is "120px"
PASS getComputedStyle(testpseudo, ':after').paddingRight is "200px"
font-size with viewport units in calc() doesn't change when viewport resizes https://bugs.webkit.org/show_bug.cgi?id=224614 Reviewed by Zalan Bujtas. Source/WebCore: * css/CSSToLengthConversionData.cpp: (WebCore::CSSToLengthConversionData::zoom const): Updated since m_zoom is now optional. We use effectiveZoom when m_zoom is not specified, which is the same semantic that was implemented before with a separate boolean. (WebCore::CSSToLengthConversionData::viewportWidthFactor const): When calling the setHasViewportUnits function as a side effect, use m_viewportDependencyDetectionStyle, rather than always using m_style. This lets us handle the font-size case correctly. Also removed the explicit computingFontSize check for the same reason. (WebCore::CSSToLengthConversionData::viewportHeightFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMinFactor const): Ditto. (WebCore::CSSToLengthConversionData::viewportMaxFactor const): Ditto. * css/CSSToLengthConversionData.h: Added a new member, m_viewportDependencyDetectionStyle, which defaults to the same value as m_style. Also changed m_zoom to use Optional instead of a separate boolean and an ignored "must be 1.0" value. Initialized data members in the modern way, allowing us to use the default constructor. * style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyValueFontSize): Pass in the builder's style as the viewportDependencyDetectionStyle. This does the same thing that the existing code to call setHasViewportUnits did directly, but does it even for more complex cases involving calc(). Also made the isLength and isCalculatedPercentageWithLength cases more similar to each other and left a FIXME behind about taking that a bit further, but doing that probably requires creating some more test cases. LayoutTests: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Added tests that involve calc, and broke rules up into multiple elements so that side effects from one style won't give us false negatives. This now has a subtest that was failing without the fix in this patch. Canonical link: https://commits.webkit.org/236669@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@276187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-04-17 01:08:45 +00:00
PASS getComputedStyle(testpseudocalc, ':after').marginLeft is "240px"
PASS getComputedStyle(testpseudocalc, ':after').paddingRight is "400px"
vw/vh units used as font/line-height values don't scale with the viewport https://bugs.webkit.org/show_bug.cgi?id=87846 Reviewed by Darin Adler. Source/WebCore: This patch moves the resolution of viewport units to style recalc time. Currently viewport units are left unresolved during style recalcs, which leads to many problems with viewport units. Moving the resolution will fix these problems, as well as reduce the plumbing that goes on. This patch touches a lot of files since the valueForLength functions no longer need a RenderView. The interesting changes are in: - CSSToLengthConversionData -> CSSPrimitiveValue: for moving resolution to style recalc time. - Length / LengthFunctions: no longer needs to know about viewport units. - FrameView -> Document -> StyleResolver: for scheduling style recalcs upon resize Note that getComputedStyle will now return pixel values when viewport units are used. This behavior matches Firefox and the css3-cascade spec. This is based on a Blink patch by timloh@chromium.org. Tests: css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html css3/viewport-percentage-lengths/viewport-percentage-lengths-calc.html css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html * WebCore.exp.in: Remove RenderView argument to floatValueForLength. * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (getAttributeSetForAccessibilityObject): Remove RenderView argument. * css/BasicShapeFunctions.cpp: (WebCore::convertToLength): Ditto. (WebCore::floatValueForCenterCoordinate): Ditto. * css/BasicShapeFunctions.h: Ditto. * css/CSSCalculationValue.cpp: (WebCore::unitCategory): Remove special handling for viewport units, as they get resolved to pixels. (WebCore::createCSS): Ditto. * css/CSSComputedStyleDeclaration.cpp: (WebCore::positionOffsetValue): Remove RendewView argument. (WebCore::getBorderRadiusCornerValues): Remove handling of viewport units, as they are already resolve to pixels here. (WebCore::getBorderRadiusCornerValue): Remove RenderView argument. (WebCore::getBorderRadiusShorthandValue): Ditto. (WebCore::specifiedValueForGridTrackBreadth): Remove handling of viewport units, as they are already resolved to pixels here. (WebCore::specifiedValueForGridTrackSize): Remove RenderView argument. (WebCore::valueForGridTrackList): Ditto. (WebCore::lineHeightFromStyle): Ditto. (WebCore::ComputedStyleExtractor::propertyValue): Ditto. * css/CSSGradientValue.cpp: (WebCore::CSSLinearGradientValue::createGradient): Pass RenderView to CSSToLengthConversionData constructor. (WebCore::CSSRadialGradientValue::createGradient): Ditto. * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::unitCategory): Remove handling of viewport units, as they get resolved to pixels. (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Ditto. (WebCore::CSSPrimitiveValue::init): Ditto. (WebCore::CSSPrimitiveValue::computeLengthDouble): Resolve viewport units to pixels. (WebCore::CSSPrimitiveValue::canonicalUnitTypeForCategory): Remove handling of viewport units, since they get resolved to pixels. (WebCore::CSSPrimitiveValue::viewportPercentageLength): Deleted. * css/CSSPrimitiveValue.h: (WebCore::CSSPrimitiveValue::isLength): Remove special handling of viewport units, since they get resolved to pixels. * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::convertToLength): Ditto. * css/CSSToLengthConversionData.cpp: (WebCore::CSSToLengthConversionData::viewportWidthFactor): Caclulate conversion factor for viewport units to pixels. Note this does not set hasViewportUnits on the RenderStyle if computing the font size, because in the font size case, the RenderStyle is the parent's style, not the current renderer's style. (WebCore::CSSToLengthConversionData::viewportHeightFactor): Ditto. (WebCore::CSSToLengthConversionData::viewportMinFactor): Ditto. (WebCore::CSSToLengthConversionData::viewportMaxFactor): Ditto. * css/CSSToLengthConversionData.h: (WebCore::CSSToLengthConversionData::CSSToLengthConversionData): Add RenderView parameter, and make RenderStyle non-const so that hasViewportUnits can be set on the Style.. (WebCore::CSSToLengthConversionData::style): style is now non-const. (WebCore::CSSToLengthConversionData::copyWithAdjustedZoom): Handle RenderView argument. * css/CSSToStyleMap.cpp: (WebCore::CSSToStyleMap::mapFillXPosition): Remove handling of viewport units, as they are already resolved to pixels here. (WebCore::CSSToStyleMap::mapFillYPosition): Ditto. * css/DeprecatedStyleBuilder.cpp: (WebCore::ApplyPropertyLength::applyValue): Ditto. (WebCore::ApplyPropertyBorderRadius::applyValue): Ditto. (WebCore::ApplyPropertyComputeLength::applyValue): Ditto. (WebCore::ApplyPropertyFontSize::applyValue): Ditto. (WebCore::ApplyPropertyLineHeight::applyValue): Ditto. (WebCore::ApplyPropertyLineHeightForIOSTextAutosizing::applyValue): Ditto. (WebCore::ApplyPropertyWordSpacing::applyValue): Ditto. (WebCore::ApplyPropertyVerticalAlign::applyValue): Ditto. (WebCore::ApplyPropertyTextIndent::applyValue): Ditto. * css/LengthFunctions.cpp: (WebCore::minimumIntValueForLength): Remove RenderView argument. (WebCore::intValueForLength): Remove RenderView argument and roundPecentages. (WebCore::minimumValueForLength): Remove RenderView argument, and special handling of viewport units. (WebCore::valueForLength): Ditto. (WebCore::floatValueForLength): Ditto. (WebCore::floatSizeForLengthSize): Remove RenderView argument. * css/LengthFunctions.h: Ditto. * css/MediaQueryEvaluator.cpp: (WebCore::MediaQueryEvaluator::eval): Add RenderView argument for CSSToLengthConversionData constuctor. * css/StyleResolver.cpp: (WebCore::StyleResolver::State::clear): Change to 0 arg constructor for CSSToLengthConversionData. (WebCore::StyleResolver::State::updateConversionData): In order to get the RenderView, we need to have a valid Element set on the state. Since this means that we need to set the conversion data in more places, move the contruction of conversion data into this helper method. (WebCore::StyleResolver::State::initElement): Make sure conversion data is up to date. (WebCore::StyleResolver::State::initForStyleResolve): Ditto. (WebCore::StyleResolver::State::setStyle): When the style is set, we need to make sure to update the conversion data. (WebCore::StyleResolver::styleForElement): If the style has viewport units, flage the document so that we can make sure to recalc the viewport unit values when the viewport is resized. (WebCore::StyleResolver::pseudoStyleForElement): Ditto. (WebCore::StyleResolver::updateFont): Make sure the font having viewport units updates the style. (WebCore::StyleResolver::convertToIntLength): Remove handling of viewport units, as they are resolved to pixels. (WebCore::StyleResolver::convertToFloatLength): Ditto. (WebCore::StyleResolver::clearCachedPropertiesAffectedByViewportUnits): Invalidate the matched properties cache for styles with viewport units when the viewport is resized. (WebCore::createGridTrackBreadth): Remove handling of viewport units, as they are resolved to pixels. (WebCore::StyleResolver::applyProperty): Ditto. (WebCore::StyleResolver::hasMediaQueriesAffectedByViewportChange): Rename to be less confusing, since it has nothing to do with viewport units. (WebCore::StyleResolver::createFilterOperations): Remove handling of viewport units, as they are resolved to pixels. (WebCore::StyleResolver::affectedByViewportChange): Deleted. (WebCore::StyleResolver::viewportPercentageValue): Deleted. * css/StyleResolver.h: (WebCore::StyleResolver::State::State): C++11 cleanup: 0 -> nullptr. (WebCore::StyleResolver::State::setFontSizeHasViewportUnits): Set if the font size is specified in viewport units. (WebCore::StyleResolver::State::fontSizeHasViewportUnits): Ditto. (WebCore::StyleResolver::State::setStyle): Deleted. * css/TransformFunctions.cpp: (WebCore::convertToFloatLength): Remove handling of viewport units, since they are resolved to pixels. * dom/Document.cpp: (WebCore::Document::Document): Add flag to determine if some style in the document has viewport units. (WebCore::Document::pageSizeAndMarginsInPixels): Remove RenderView argument. (WebCore::Document::updateViewportUnitsOnResize): Mark elements with viewport units for style recalc when the viewport size has changed. * dom/Document.h: (WebCore::Document::setHasStyleWithViewportUnits): Flag to determine if some style in the document has viewport units. (WebCore::Document::hasStyleWithViewportUnits): Ditto. * html/HTMLAreaElement.cpp: (WebCore::HTMLAreaElement::getRegion): Remove RenderView argument. * page/FrameView.cpp: (WebCore::FrameView::layout): When the viewport is resized, call updateViewportUnitsOnResize on the document. * platform/Length.h: (WebCore::Length::isSpecified): Remove handling of viewport units, since they are now resolved to pixels. (WebCore::Length::viewportPercentageLength): Deleted. (WebCore::Length::isViewportPercentage): Deleted. * rendering/ClipPathOperation.h: (WebCore::ShapeClipPathOperation::pathForReferenceRect): Remove RenderView argument. (WebCore::BoxClipPathOperation::pathForReferenceRect): Ditto. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::updateBlockChildDirtyBitsBeforeLayout): Remove handling of viewport units, since they get updated by updateViewportUnitsOnResize when the viewport is resized. (WebCore::RenderBlock::nodeAtPoint): Remove RenderView argument. (WebCore::RenderBlock::lineHeight): Ditto. * rendering/RenderBox.cpp: (WebCore::RenderBox::paintBoxDecorations): Remove RenderView argument. (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing): Remove handling of viewport units, as they are resolved to pixels. (WebCore::RenderBox::computePercentageLogicalHeight): Ditto. (WebCore::RenderBox::computeReplacedLogicalWidthUsing): Ditto. (WebCore::RenderBox::computeReplacedLogicalHeightUsing): Ditto. (WebCore::RenderBox::hasViewportPercentageLogicalHeight): Deleted. * rendering/RenderBox.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::getBackgroundRoundedRect): Remove RenderView argument. (WebCore::RenderBoxModelObject::calculateFillTileSize): Remove handling of viewport units, as they are resolved to pixels. (WebCore::computeBorderImageSide): Remove RenderView argument. (WebCore::RenderBoxModelObject::paintNinePieceImage): Ditto. (WebCore::RenderBoxModelObject::paintBorder): Ditto. (WebCore::RenderBoxModelObject::paintBoxShadow): Ditto. * rendering/RenderElement.cpp: (WebCore::RenderElement::repaintAfterLayoutIfNeeded): Ditto. * rendering/RenderElement.h: (WebCore::RenderElement::valueForLength): Remove unused roundPercentages argument. (WebCore::RenderElement::minimumValueForLength): Remove unused RoundPercentages and RenderView arguments. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutGridItems): Remove handling of viewport units as they are resolved to pixels. * rendering/RenderInline.cpp: (WebCore::computeMargin): Ditto. (WebCore::RenderInline::lineHeight): Remove RenderView argument. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::setupClipPath): Ditto. * rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::lineHeight): Ditto. * rendering/RenderScrollbarPart.cpp: (WebCore::calcScrollbarThicknessUsing): Ditto. (WebCore::RenderScrollbarPart::computeScrollbarWidth): Ditto. (WebCore::RenderScrollbarPart::computeScrollbarHeight): Ditto. * rendering/RenderTable.cpp: (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight): Remove handling of viewport units, since they are resolved to pixels. (WebCore::RenderTable::computePreferredLogicalWidths): Now that viewport unit values are resolved to pixels at style recalc time, no special checking is needed to handle them, so update the comment to reflect that. * rendering/RenderThemeIOS.mm: (WebCore::applyCommonButtonPaddingToStyle): Add RenderView argument to CSSToLengthConversionData constructor. (WebCore::RenderThemeIOS::adjustButtonStyle): Ditto. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintMenuListButtonGradients): Remove RenderView argument. * rendering/RenderView.cpp: (WebCore::RenderView::layout): Remove handling of viewport units, since they are resolved to pixels. * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::ascentAndDescentForBox): Remove RenderView argument. * rendering/shapes/Shape.cpp: (WebCore::Shape::createShape): Remove RenderView argument. * rendering/shapes/Shape.h: * rendering/shapes/ShapeOutsideInfo.cpp: (WebCore::ShapeOutsideInfo::computedShape): Ditto. * rendering/style/BasicShapes.cpp: (WebCore::BasicShapeCircle::floatValueForRadiusInBox): Ditto. (WebCore::BasicShapeCircle::path): Ditto. (WebCore::BasicShapeEllipse::floatValueForRadiusInBox): Ditto. (WebCore::BasicShapeEllipse::path): Ditto. (WebCore::BasicShapePolygon::path): Ditto. (WebCore::floatSizeForLengthSize): Ditto. (WebCore::BasicShapeInset::path): Ditto. * rendering/style/BasicShapes.h: * rendering/style/RenderStyle.cpp: (WebCore::calcRadiiFor): Ditto. (WebCore::RenderStyle::getRoundedBorderFor): Ditto. (WebCore::RenderStyle::computedLineHeight): Remove handling of viewport units since they are resolved to pixels. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setHasViewportUnits): Set if this style has a property set with viewport units. (WebCore::RenderStyle::hasViewportUnits): Ditto. * rendering/svg/RenderSVGRoot.cpp: (WebCore::resolveLengthAttributeForSVG): Remove RenderView argument. (WebCore::RenderSVGRoot::computeReplacedLogicalWidth): Ditto. (WebCore::RenderSVGRoot::computeReplacedLogicalHeight): Ditto. * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::prepareToRenderSVGContent): Ditto. LayoutTests: Update existing tests to work with the proper behavior of viewport units. Add tests for some of the things fixed by this patch: handling of viewport units in font sizes, with calc, and when the viewport is resized without a reload. The anonymous block and percent size child tests make sure that the viewport unit updates still work properly when there is another relative unit the depends on the size specified in viewport units. * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle-expected.txt: * css3/viewport-percentage-lengths/css3-viewport-percentage-lengths-getStyle.html: * css3/viewport-percentage-lengths/resources/resize-test.js: Added. (resizeTest): (standardResizeTest): * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block-expected.txt: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-anonymous-block.html: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-calc-expected.txt: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-calc.html: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child-expected.txt: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-percent-size-child.html: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size-expected.txt: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-relative-font-size.html: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt: Added. * css3/viewport-percentage-lengths/viewport-percentage-lengths-resize.html: Added. * fast/canvas/draw-focus-if-needed-expected.txt: Removed. * fast/canvas/draw-focus-if-needed.html: Removed. * fast/masking/parsing-clip-path-shape-expected.txt: * fast/masking/parsing-clip-path-shape.html: * fast/shapes/parsing/parsing-shape-lengths-expected.txt: * fast/shapes/parsing/parsing-shape-lengths.html: Canonical link: https://commits.webkit.org/151360@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-28 01:33:26 +00:00