Implement parsing and animation support for offset-distance, offset-position, offset-anchor
https://bugs.webkit.org/show_bug.cgi?id=231491
Patch by Kiet Ho <Kiet Ho> on 2021-10-18
Reviewed by Antoine Quint.
LayoutTests/imported/w3c:
Updated relevant test expectations.
- web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
- web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
- web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
- web-platform-tests/css/motion/animation/offset-anchor-composition-expected.txt:
- web-platform-tests/css/motion/animation/offset-anchor-interpolation-expected.txt:
- web-platform-tests/css/motion/animation/offset-distance-composition-expected.txt:
- web-platform-tests/css/motion/animation/offset-distance-interpolation-expected.txt:
- web-platform-tests/css/motion/animation/offset-position-composition-expected.txt:
- web-platform-tests/css/motion/animation/offset-position-interpolation-expected.txt:
- web-platform-tests/css/motion/animation/offset-position-interpolation.html:
Fixed test to accept other length expressions as equivalent.
- web-platform-tests/css/motion/inheritance-expected.txt:
- web-platform-tests/css/motion/offset-supports-calc-expected.txt:
- web-platform-tests/css/motion/parsing/offset-anchor-computed-expected.txt:
- web-platform-tests/css/motion/parsing/offset-anchor-parsing-valid-expected.txt:
- web-platform-tests/css/motion/parsing/offset-anchor-parsing-valid.html:
Fixed test to accept "center" as an alternative to "center center",
"calc(20% + 10px) center" as an alternative to "calc(10px + 20%) center".
- web-platform-tests/css/motion/parsing/offset-distance-computed-expected.txt:
- web-platform-tests/css/motion/parsing/offset-distance-parsing-valid-expected.txt:
- web-platform-tests/css/motion/parsing/offset-position-computed-expected.txt:
- web-platform-tests/css/motion/parsing/offset-position-parsing-valid-expected.txt:
- web-platform-tests/css/motion/parsing/offset-position-parsing-valid.html:
Fixed test to accept "center" as an alternative to "center center",
"calc(20% + 10px) center" as an alternative to "calc(10px + 20%) center".
- web-platform-tests/css/motion/parsing/offset-shorthand-expected.txt:
- web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-002-expected.txt:
- web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt:
- web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-002-expected.txt:
Source/WebCore:
Tests: imported/w3c/web-platform-tests/css/motion/animation/offset-anchor-composition.html
imported/w3c/web-platform-tests/css/motion/animation/offset-anchor-interpolation.html
imported/w3c/web-platform-tests/css/motion/animation/offset-distance-composition.html
imported/w3c/web-platform-tests/css/motion/animation/offset-distance-interpolation.html
imported/w3c/web-platform-tests/css/motion/animation/offset-position-composition.html
imported/w3c/web-platform-tests/css/motion/animation/offset-position-interpolation.html
imported/w3c/web-platform-tests/css/motion/inheritance.html
imported/w3c/web-platform-tests/css/motion/offset-supports-calc.html
imported/w3c/web-platform-tests/css/motion/parsing/offset-anchor-computed.html
imported/w3c/web-platform-tests/css/motion/parsing/offset-anchor-parsing-valid.html
imported/w3c/web-platform-tests/css/motion/parsing/offset-distance-computed.html
imported/w3c/web-platform-tests/css/motion/parsing/offset-distance-parsing-valid.html
imported/w3c/web-platform-tests/css/motion/parsing/offset-position-computed.html
imported/w3c/web-platform-tests/css/motion/parsing/offset-position-parsing-valid.html
- animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
- css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForPosition):
(WebCore::valueForPositionOrAuto):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
- css/CSSProperties.json:
- css/parser/CSSPropertyParser.cpp:
(WebCore::consumePositionOrAuto):
(WebCore::CSSPropertyParser::parseSingleValue):
- rendering/style/RenderStyle.h:
(WebCore::RenderStyle::offsetDistance const):
(WebCore::RenderStyle::setOffsetDistance):
(WebCore::RenderStyle::initialOffsetDistance):
(WebCore::RenderStyle::offsetPosition const):
(WebCore::RenderStyle::setOffsetPosition):
(WebCore::RenderStyle::initialOffsetPosition):
(WebCore::RenderStyle::offsetAnchor const):
(WebCore::RenderStyle::setOffsetAnchor):
(WebCore::RenderStyle::initialOffsetAnchor):
- rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
- rendering/style/StyleRareNonInheritedData.h:
- style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertPosition):
(WebCore::Style::BuilderConverter::convertPositionOrAuto):
Source/WTF:
- Scripts/Preferences/WebPreferencesExperimental.yaml: Add new preference for CSS Motion Path support.
LayoutTests:
Update platform-specific test expectations to accommodate for newly added CSS properties.
- platform/gtk/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
- platform/gtk/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
- platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
- platform/ios-wk2/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt:
- platform/ios/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
- platform/wpe/imported/w3c/web-platform-tests/css/cssom/cssstyledeclaration-csstext-expected.txt:
- platform/wpe/imported/w3c/web-platform-tests/css/cssom/getComputedStyle-detached-subtree-expected.txt: