Skip to content

Commit

Permalink
[scroll-animations] implement parsing support for scroll-timeline and…
Browse files Browse the repository at this point in the history
… its longhand properties

https://bugs.webkit.org/show_bug.cgi?id=265302
rdar://118783919

Reviewed by Tim Nguyen.

Add parsing support for the `scroll-timeline` shorthand and its two coordinating list base
property longhands `scroll-timeline-name` and `scroll-timeline-axis` as specified in
https://drafts.csswg.org/scroll-animations-1/#scroll-timelines-named.

Two WPT failures remain for `scroll-timeline` parsing and a WPT issue has been filed to determine
whether the test is correct: web-platform-tests/wpt#43336.

* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-axis-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-axis-parsing-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-name-computed-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-name-parsing-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/scroll-animations/css/scroll-timeline-shorthand-expected.txt:
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/platform/ipad/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/css/css-cascade/all-prop-revert-layer-expected.txt:
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml-expected.txt:
* Source/WebCore/Headers.cmake:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* Source/WebCore/animation/ScrollTimeline.cpp:
(WebCore::ScrollTimeline::create):
(WebCore::ScrollTimeline::ScrollTimeline):
* Source/WebCore/animation/ScrollTimeline.h:
* Source/WebCore/css/CSSPrimitiveValueMappings.h:
* Source/WebCore/css/CSSProperties.json:
* Source/WebCore/css/ComputedStyleExtractor.cpp:
(WebCore::valueForScrollTimelineAxis):
(WebCore::valueForScrollTimelineName):
(WebCore::scrollTimelineShorthandValue):
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle const):
* Source/WebCore/css/ShorthandSerializer.cpp:
(WebCore::ShorthandSerializer::serialize):
(WebCore::ShorthandSerializer::serializeLayered const):
* Source/WebCore/css/parser/CSSPropertyParser.cpp:
(WebCore::initialValueForLonghand):
(WebCore::CSSPropertyParser::consumeScrollTimelineShorthand):
(WebCore::CSSPropertyParser::parseShorthand):
* Source/WebCore/css/parser/CSSPropertyParser.h:
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::adjustScrollTimelines):
* Source/WebCore/rendering/style/RenderStyle.h:
(WebCore::RenderStyle::initialScrollTimelineAxes):
(WebCore::RenderStyle::initialScrollTimelineNames):
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::scrollTimelines const):
(WebCore::RenderStyle::scrollTimelineAxes const):
(WebCore::RenderStyle::scrollTimelineNames const):
* Source/WebCore/rendering/style/RenderStyleSetters.h:
(WebCore::RenderStyle::setScrollTimelineAxes):
(WebCore::RenderStyle::setScrollTimelineNames):
* Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* Source/WebCore/rendering/style/StyleRareNonInheritedData.h:
* Source/WebCore/style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjust const):
* Source/WebCore/style/StyleBuilderConverter.h:
(WebCore::Style::BuilderConverter::convertScrollTimelineName):
(WebCore::Style::BuilderConverter::convertScrollTimelineAxis):

Canonical link: https://commits.webkit.org/271189@main
  • Loading branch information
graouts committed Nov 28, 2023
1 parent 481f557 commit 0f2aca5
Show file tree
Hide file tree
Showing 32 changed files with 389 additions and 96 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ PASS scroll-padding-top
PASS scroll-snap-align
PASS scroll-snap-stop
PASS scroll-snap-type
PASS scroll-timeline-axis
PASS scroll-timeline-name
PASS scrollbar-color
PASS scrollbar-gutter
PASS scrollbar-width
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ PASS scroll-padding-top
PASS scroll-snap-align
PASS scroll-snap-stop
PASS scroll-snap-type
PASS scroll-timeline-axis
PASS scroll-timeline-name
PASS scrollbar-color
PASS scrollbar-gutter
PASS scrollbar-width
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

FAIL Property scroll-timeline-axis value 'initial' assert_true: scroll-timeline-axis doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-axis value 'inherit' assert_true: scroll-timeline-axis doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-axis value 'unset' assert_true: scroll-timeline-axis doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-axis value 'revert' assert_true: scroll-timeline-axis doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-axis value 'block' assert_true: scroll-timeline-axis doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-axis value 'inline' assert_true: scroll-timeline-axis doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-axis value 'y' assert_true: scroll-timeline-axis doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-axis value 'x' assert_true: scroll-timeline-axis doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-axis value 'block, inline' assert_true: scroll-timeline-axis doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-axis value 'inline, block' assert_true: scroll-timeline-axis doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-axis value 'block, y, x, inline' assert_true: scroll-timeline-axis doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-axis value 'inline, inline, inline, inline' assert_true: scroll-timeline-axis doesn't seem to be supported in the computed style expected true got false
FAIL The scroll-timeline-axis property shows up in CSSStyleDeclaration enumeration assert_not_equals: got disallowed value -1
FAIL The scroll-timeline-axis property shows up in CSSStyleDeclaration.cssText assert_not_equals: got disallowed value -1
PASS Property scroll-timeline-axis value 'initial'
PASS Property scroll-timeline-axis value 'inherit'
PASS Property scroll-timeline-axis value 'unset'
PASS Property scroll-timeline-axis value 'revert'
PASS Property scroll-timeline-axis value 'block'
PASS Property scroll-timeline-axis value 'inline'
PASS Property scroll-timeline-axis value 'y'
PASS Property scroll-timeline-axis value 'x'
PASS Property scroll-timeline-axis value 'block, inline'
PASS Property scroll-timeline-axis value 'inline, block'
PASS Property scroll-timeline-axis value 'block, y, x, inline'
PASS Property scroll-timeline-axis value 'inline, inline, inline, inline'
PASS The scroll-timeline-axis property shows up in CSSStyleDeclaration enumeration
PASS The scroll-timeline-axis property shows up in CSSStyleDeclaration.cssText

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

FAIL e.style['scroll-timeline-axis'] = "initial" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-axis'] = "inherit" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-axis'] = "unset" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-axis'] = "revert" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-axis'] = "block" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-axis'] = "inline" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-axis'] = "y" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-axis'] = "x" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-axis'] = "block, inline" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-axis'] = "inline, block" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-axis'] = "block, y, x, inline" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-axis'] = "inline, inline, inline, inline" should set the property value assert_not_equals: property should be set got disallowed value ""
PASS e.style['scroll-timeline-axis'] = "initial" should set the property value
PASS e.style['scroll-timeline-axis'] = "inherit" should set the property value
PASS e.style['scroll-timeline-axis'] = "unset" should set the property value
PASS e.style['scroll-timeline-axis'] = "revert" should set the property value
PASS e.style['scroll-timeline-axis'] = "block" should set the property value
PASS e.style['scroll-timeline-axis'] = "inline" should set the property value
PASS e.style['scroll-timeline-axis'] = "y" should set the property value
PASS e.style['scroll-timeline-axis'] = "x" should set the property value
PASS e.style['scroll-timeline-axis'] = "block, inline" should set the property value
PASS e.style['scroll-timeline-axis'] = "inline, block" should set the property value
PASS e.style['scroll-timeline-axis'] = "block, y, x, inline" should set the property value
PASS e.style['scroll-timeline-axis'] = "inline, inline, inline, inline" should set the property value
PASS e.style['scroll-timeline-axis'] = "abc" should not set the property value
PASS e.style['scroll-timeline-axis'] = "10px" should not set the property value
PASS e.style['scroll-timeline-axis'] = "auto" should not set the property value
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

FAIL Property scroll-timeline-name value 'initial' assert_true: scroll-timeline-name doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-name value 'inherit' assert_true: scroll-timeline-name doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-name value 'unset' assert_true: scroll-timeline-name doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-name value 'revert' assert_true: scroll-timeline-name doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-name value 'none' assert_true: scroll-timeline-name doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-name value '--foo' assert_true: scroll-timeline-name doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-name value '--foo, --bar' assert_true: scroll-timeline-name doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-name value '--bar, --foo' assert_true: scroll-timeline-name doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-name value '--a, --b, --c, --D, --e' assert_true: scroll-timeline-name doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-name value 'none, none' assert_true: scroll-timeline-name doesn't seem to be supported in the computed style expected true got false
FAIL Property scroll-timeline-name value '--a, --b, --c, none, --d, --e' assert_true: scroll-timeline-name doesn't seem to be supported in the computed style expected true got false
FAIL The scroll-timeline-name property shows up in CSSStyleDeclaration enumeration assert_not_equals: got disallowed value -1
FAIL The scroll-timeline-name property shows up in CSSStyleDeclaration.cssText assert_not_equals: got disallowed value -1
PASS Property scroll-timeline-name value 'initial'
PASS Property scroll-timeline-name value 'inherit'
PASS Property scroll-timeline-name value 'unset'
PASS Property scroll-timeline-name value 'revert'
PASS Property scroll-timeline-name value 'none'
PASS Property scroll-timeline-name value '--foo'
PASS Property scroll-timeline-name value '--foo, --bar'
PASS Property scroll-timeline-name value '--bar, --foo'
PASS Property scroll-timeline-name value '--a, --b, --c, --D, --e'
PASS Property scroll-timeline-name value 'none, none'
PASS Property scroll-timeline-name value '--a, --b, --c, none, --d, --e'
PASS The scroll-timeline-name property shows up in CSSStyleDeclaration enumeration
PASS The scroll-timeline-name property shows up in CSSStyleDeclaration.cssText

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@

FAIL e.style['scroll-timeline-name'] = "initial" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-name'] = "inherit" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-name'] = "unset" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-name'] = "revert" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-name'] = "none" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-name'] = "--abc" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-name'] = " --abc" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-name'] = "--aBc" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-name'] = "--foo, --bar" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-name'] = "--bar, --foo" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-name'] = "none, none" should set the property value assert_not_equals: property should be set got disallowed value ""
FAIL e.style['scroll-timeline-name'] = "--a, none, --b" should set the property value assert_not_equals: property should be set got disallowed value ""
PASS e.style['scroll-timeline-name'] = "initial" should set the property value
PASS e.style['scroll-timeline-name'] = "inherit" should set the property value
PASS e.style['scroll-timeline-name'] = "unset" should set the property value
PASS e.style['scroll-timeline-name'] = "revert" should set the property value
PASS e.style['scroll-timeline-name'] = "none" should set the property value
PASS e.style['scroll-timeline-name'] = "--abc" should set the property value
PASS e.style['scroll-timeline-name'] = " --abc" should set the property value
PASS e.style['scroll-timeline-name'] = "--aBc" should set the property value
PASS e.style['scroll-timeline-name'] = "--foo, --bar" should set the property value
PASS e.style['scroll-timeline-name'] = "--bar, --foo" should set the property value
PASS e.style['scroll-timeline-name'] = "none, none" should set the property value
PASS e.style['scroll-timeline-name'] = "--a, none, --b" should set the property value
PASS e.style['scroll-timeline-name'] = "auto" should not set the property value
PASS e.style['scroll-timeline-name'] = "abc" should not set the property value
PASS e.style['scroll-timeline-name'] = "default" should not set the property value
Expand Down
Loading

0 comments on commit 0f2aca5

Please sign in to comment.