haikuwebkit/LayoutTests/transforms/2d/scale-and-transform-css-pro...

3 lines
163 B
XML
Raw Permalink Normal View History

Add non-animated support for the CSS scale property https://bugs.webkit.org/show_bug.cgi?id=217291 <rdar://problem/69926254> Reviewed by Simon Fraser. LayoutTests/imported/w3c: WPT progressions showing the correct parsing and computed style output of a non-animated "scale" property. We are also adding some more tests to the invalid "scale" parsing to check that we bail once we get junk for optional values after valid values and move percentage values to invalid tests (also filed a WPT PR at https://github.com/web-platform-tests/wpt/pull/25960). * web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt: * web-platform-tests/css/css-transforms/animation/scale-composition-expected.txt: * web-platform-tests/css/css-transforms/animation/scale-interpolation-expected.txt: * web-platform-tests/css/css-transforms/parsing/scale-parsing-invalid-expected.txt: * web-platform-tests/css/css-transforms/parsing/scale-parsing-invalid.html: * web-platform-tests/css/css-transforms/parsing/scale-parsing-valid-expected.txt: * web-platform-tests/css/css-transforms/parsing/scale-parsing-valid.html: * web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt: Source/WebCore: We add non-animated support for the CSS "scale" property as specifed in by the CSS Transforms Level 2 specification (​https://drafts.csswg.org/css-transforms-2/#propdef-scale). Tests: transforms/2d/scale-and-transform-attribute-in-svg-expected.svg transforms/2d/scale-and-transform-attribute-in-svg.svg transforms/2d/scale-and-transform-css-property-in-svg-expected.svg transforms/2d/scale-and-transform-css-property-in-svg.svg transforms/2d/scale-and-translate-in-svg-expected.svg transforms/2d/scale-and-translate-in-svg.svg transforms/2d/scale-and-translate-order.html transforms/2d/scale-in-svg-expected.svg transforms/2d/scale-in-svg.svg transforms/2d/scale-transform-order.html transforms/2d/scale-transform-origin-order.html * Headers.cmake: * css/CSSComputedStyleDeclaration.cpp: (WebCore::computedTranslate): Remove the extraneous is<RenderInline> check which is already covered by rendererCanBeTransformed(). (WebCore::computedScale): Create a CSSValueList to print out the computed value for the "scale" property. (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSProperties.json: Define the "scale" property with the condition that the runtime setting for individual CSS transform properties is set. * css/TransformFunctions.cpp: (WebCore::scaleForValue): Convert a CSSValue to a TranslateTransformOperation when parsing a "scale" property value. * css/TransformFunctions.h: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeScale): Create a CSSValueList when parsing a "scale" property value. (WebCore::CSSPropertyParser::parseSingleValue): * platform/graphics/transforms/ScaleTransformOperation.h: * rendering/RenderObject.h: (WebCore::RenderObject::hasTransform const): Consider that having the "scale" property is akin to having a "transform" property in the render tree. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::setScale): (WebCore::RenderStyle::applyTransform const): Account for the RenderStyle::scale() value in the right order, after applying the transform origin and translate, but before applying the main transform. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::scale const): (WebCore::RenderStyle::hasTransformRelatedProperty const): (WebCore::RenderStyle::initialScale): * rendering/style/StyleRareNonInheritedData.h: * rendering/style/WillChangeData.cpp: (WebCore::WillChangeData::propertyCreatesStackingContext): * style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertScale): * svg/SVGGraphicsElement.cpp: (WebCore::SVGGraphicsElement::animatedLocalTransform const): Account for the RenderStyle::scale() value when rendering SVG, ensuring that it is applied before the transform specified by either the "transform" CSS property or SVG attribute. LayoutTests: Add tests checking that the "scale" CSS property is applied in the correct order related to "transform-origin" and "transform" and that it is applied in SVG as well. * platform/ios-13/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt: * platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt: * transforms/2d/scale-and-transform-attribute-in-svg-expected.svg: Added. * transforms/2d/scale-and-transform-attribute-in-svg.svg: Added. * transforms/2d/scale-and-transform-css-property-in-svg-expected.svg: Added. * transforms/2d/scale-and-transform-css-property-in-svg.svg: Added. * transforms/2d/scale-and-translate-in-svg-expected.svg: Added. * transforms/2d/scale-and-translate-in-svg.svg: Added. * transforms/2d/scale-and-translate-order-expected.html: Added. * transforms/2d/scale-and-translate-order.html: Added. * transforms/2d/scale-in-svg-expected.svg: Added. * transforms/2d/scale-in-svg.svg: Added. * transforms/2d/scale-transform-order-expected.html: Added. * transforms/2d/scale-transform-order.html: Added. * transforms/2d/scale-transform-origin-order-expected.html: Added. * transforms/2d/scale-transform-origin-order.html: Added. Canonical link: https://commits.webkit.org/230067@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@267958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-10-05 09:46:39 +00:00
<svg xmlns="http://www.w3.org/2000/svg" width="800" height="600">
<rect width="100" height="100" fill="black" transform="scale(2) translate(100 100)" />
</svg>