Title: [261046] trunk
Revision
261046
Author
[email protected]
Date
2020-05-02 02:34:30 -0700 (Sat, 02 May 2020)

Log Message

[CSS Easing 1] implement `jump-*` step positions
https://bugs.webkit.org/show_bug.cgi?id=211271

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-animations/parsing/animation-timing-function-computed-expected.txt:
* web-platform-tests/css/css-animations/parsing/animation-timing-function-valid-expected.txt:
* web-platform-tests/css/css-easing/step-timing-functions-output-expected.txt:
* web-platform-tests/css/css-easing/step-timing-functions-syntax-expected.txt:
* web-platform-tests/css/css-transitions/parsing/transition-timing-function-computed-expected.txt:
* web-platform-tests/css/css-transitions/parsing/transition-timing-function-valid-expected.txt:
* web-platform-tests/web-animations/timing-model/time-transformations/transformed-progress-expected.txt:

Source/WebCore:

Add support for `jump-start`, `jump-end`, `jump-none`, and `jump-both` step positions inside
the `steps()` CSS timing function <https://drafts.csswg.org/css-easing-1/#step-position>.

Adjust existing serialization logic to match the spec <https://drafts.csswg.org/css-easing-1/#serialization>:
 - omit `end` (and `jump-end`)
 - the value `step-start` should result in `steps(1, start)` instead of `step-start`
 - the value `step-end` should result in `steps(1)` instead of `step-end`

Tests: animations/computed-style.html
       fast/css/animation-steps-calculated-value.html
       transitions/transitions-parsing.html
       web-platform-tests/css/css-animations/parsing/animation-timing-function-computed.html
       web-platform-tests/css/css-animations/parsing/animation-timing-function-valid.html
       web-platform-tests/css/css-easing/step-timing-functions-output.html
       web-platform-tests/css/css-easing/step-timing-functions-syntax.html
       web-platform-tests/css/css-transitions/parsing/transition-timing-function-computed.html
       web-platform-tests/css/css-transitions/parsing/transition-timing-function-valid.html
       web-platform-tests/web-animations/timing-model/time-transformations/transformed-progress.html

* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeSteps):
(WebCore::consumeAnimationTimingFunction):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createTimingFunctionValue):
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationTimingFunction):

* css/CSSTimingFunctionValue.h:
(WebCore::CSSStepsTimingFunctionValue::create):
(WebCore::CSSStepsTimingFunctionValue::stepPosition const): Added.
(WebCore::CSSStepsTimingFunctionValue::CSSStepsTimingFunctionValue):
(WebCore::CSSStepsTimingFunctionValue::stepAtStart const): Deleted.
* css/CSSTimingFunctionValue.cpp:
(WebCore::CSSStepsTimingFunctionValue::customCSSText const):
(WebCore::CSSStepsTimingFunctionValue::equals const):

* platform/animation/TimingFunction.h:
(WebCore::StepsTimingFunction::create):
(WebCore::StepsTimingFunction::StepsTimingFunction):
(WebCore::StepsTimingFunction::stepPosition): Added.
(WebCore::StepsTimingFunction::setStepPosition): Added.
(WebCore::StepsTimingFunction::clone):
(WebCore::StepsTimingFunction::stepAtStart): Deleted.
(WebCore::StepsTimingFunction::setStepAtStart): Deleted.
* platform/animation/TimingFunction.cpp:
(WebCore::operator<<):
(WebCore::TimingFunction::transformTime):
(WebCore::TimingFunction::createFromCSSValue):
(WebCore::TimingFunction::cssText const):

Source/WebInspectorUI:

* UserInterface/Models/CSSKeywordCompletions.js:
(WI.CSSKeywordCompletions.forFunction):
Include the step position keywords when autocompleting the `steps()` CSS function.

Source/WebKit:

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<StepsTimingFunction>::encode):
(IPC::ArgumentCoder<StepsTimingFunction>::decode):

LayoutTests:

* animations/computed-style.html:
* animations/computed-style-expected.txt:
* fast/css/animation-steps-calculated-value.html:
* fast/css/animation-steps-calculated-value-expected.txt:
* transitions/transitions-parsing.html:
* transitions/transitions-parsing-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (261045 => 261046)


--- trunk/LayoutTests/ChangeLog	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/LayoutTests/ChangeLog	2020-05-02 09:34:30 UTC (rev 261046)
@@ -1,3 +1,17 @@
+2020-05-02  Devin Rousso  <[email protected]>
+
+        [CSS Easing 1] implement `jump-*` step positions
+        https://bugs.webkit.org/show_bug.cgi?id=211271
+
+        Reviewed by Dean Jackson.
+
+        * animations/computed-style.html:
+        * animations/computed-style-expected.txt:
+        * fast/css/animation-steps-calculated-value.html:
+        * fast/css/animation-steps-calculated-value-expected.txt:
+        * transitions/transitions-parsing.html:
+        * transitions/transitions-parsing-expected.txt:
+
 2020-05-01  Tim Horton  <[email protected]>
 
         Books sometimes ends up with blank pages, especially after adjusting font size

Modified: trunk/LayoutTests/animations/computed-style-expected.txt (261045 => 261046)


--- trunk/LayoutTests/animations/computed-style-expected.txt	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/LayoutTests/animations/computed-style-expected.txt	2020-05-02 09:34:30 UTC (rev 261046)
@@ -14,7 +14,7 @@
 PASS test2Style.webkitAnimationIterationCount is '10, infinite'
 PASS test1Style.webkitAnimationTimingFunction is 'linear'
 PASS test2Style.webkitAnimationTimingFunction is 'linear, ease-in-out'
-PASS test3Style.webkitAnimationTimingFunction is 'steps(1, start), steps(1, end), steps(5, end)'
+PASS test3Style.webkitAnimationTimingFunction is 'steps(1, start), steps(1), steps(5)'
 PASS test1Style.webkitAnimationDirection is 'normal'
 PASS test2Style.webkitAnimationDirection is 'normal, alternate'
 

Modified: trunk/LayoutTests/animations/computed-style.html (261045 => 261046)


--- trunk/LayoutTests/animations/computed-style.html	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/LayoutTests/animations/computed-style.html	2020-05-02 09:34:30 UTC (rev 261046)
@@ -81,7 +81,7 @@
 
 shouldBe("test1Style.webkitAnimationTimingFunction", "'linear'");
 shouldBe("test2Style.webkitAnimationTimingFunction", "'linear, ease-in-out'");
-shouldBe("test3Style.webkitAnimationTimingFunction", "'steps(1, start), steps(1, end), steps(5, end)'");
+shouldBe("test3Style.webkitAnimationTimingFunction", "'steps(1, start), steps(1), steps(5)'");
 
 shouldBe("test1Style.webkitAnimationDirection", "'normal'");
 shouldBe("test2Style.webkitAnimationDirection", "'normal, alternate'");

Modified: trunk/LayoutTests/fast/css/animation-steps-calculated-value-expected.txt (261045 => 261046)


--- trunk/LayoutTests/fast/css/animation-steps-calculated-value-expected.txt	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/LayoutTests/fast/css/animation-steps-calculated-value-expected.txt	2020-05-02 09:34:30 UTC (rev 261046)
@@ -5,8 +5,8 @@
 
 PASS testDiv.style['-webkit-animation-timing-function'] is ""
 testDiv.style['-webkit-animation-timing-function'] = 'steps(calc(1 + 2), end)'
-PASS testDiv.style['-webkit-animation-timing-function'] is "steps(3, end)"
-PASS window.getComputedStyle(testDiv).getPropertyValue('-webkit-animation-timing-function') is "steps(3, end)"
+PASS testDiv.style['-webkit-animation-timing-function'] is "steps(3)"
+PASS window.getComputedStyle(testDiv).getPropertyValue('-webkit-animation-timing-function') is "steps(3)"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/css/animation-steps-calculated-value.html (261045 => 261046)


--- trunk/LayoutTests/fast/css/animation-steps-calculated-value.html	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/LayoutTests/fast/css/animation-steps-calculated-value.html	2020-05-02 09:34:30 UTC (rev 261046)
@@ -9,8 +9,8 @@
 
 shouldBeEmptyString("testDiv.style['-webkit-animation-timing-function']");
 evalAndLog("testDiv.style['-webkit-animation-timing-function'] = 'steps(calc(1 + 2), end)'");
-shouldBeEqualToString("testDiv.style['-webkit-animation-timing-function']", "steps(3, end)");
-shouldBeEqualToString("window.getComputedStyle(testDiv).getPropertyValue('-webkit-animation-timing-function')", "steps(3, end)");
+shouldBeEqualToString("testDiv.style['-webkit-animation-timing-function']", "steps(3)");
+shouldBeEqualToString("window.getComputedStyle(testDiv).getPropertyValue('-webkit-animation-timing-function')", "steps(3)");
 
 </script>
 <script src=""

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (261045 => 261046)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2020-05-02 09:34:30 UTC (rev 261046)
@@ -1,3 +1,18 @@
+2020-05-02  Devin Rousso  <[email protected]>
+
+        [CSS Easing 1] implement `jump-*` step positions
+        https://bugs.webkit.org/show_bug.cgi?id=211271
+
+        Reviewed by Dean Jackson.
+
+        * web-platform-tests/css/css-animations/parsing/animation-timing-function-computed-expected.txt:
+        * web-platform-tests/css/css-animations/parsing/animation-timing-function-valid-expected.txt:
+        * web-platform-tests/css/css-easing/step-timing-functions-output-expected.txt:
+        * web-platform-tests/css/css-easing/step-timing-functions-syntax-expected.txt:
+        * web-platform-tests/css/css-transitions/parsing/transition-timing-function-computed-expected.txt:
+        * web-platform-tests/css/css-transitions/parsing/transition-timing-function-valid-expected.txt:
+        * web-platform-tests/web-animations/timing-model/time-transformations/transformed-progress-expected.txt:
+
 2020-05-01  Alexey Shvayka  <[email protected]>
 
         [WebIDL] Interface prototype objects should define @@toStringTag

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-timing-function-computed-expected.txt (261045 => 261046)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-timing-function-computed-expected.txt	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-timing-function-computed-expected.txt	2020-05-02 09:34:30 UTC (rev 261046)
@@ -8,10 +8,10 @@
 PASS Property animation-timing-function value 'cubic-bezier(0, -2, 1, 3)' computes to 'cubic-bezier(0, -2, 1, 3)' 
 PASS Property animation-timing-function value 'cubic-bezier(0, 0.7, 1, 1.3)' computes to 'cubic-bezier(0, 0.7, 1, 1.3)' 
 PASS Property animation-timing-function value 'steps(4, start)' computes to 'steps(4, start)' 
-FAIL Property animation-timing-function value 'steps(2, end)' computes to 'steps(2)' assert_equals: expected "steps(2)" but got "steps(2, end)"
-FAIL Property animation-timing-function value 'steps(2, jump-start)' computes to 'steps(2, jump-start)' assert_true: 'steps(2, jump-start)' is a supported value for animation-timing-function. expected true got false
-FAIL Property animation-timing-function value 'steps(2, jump-end)' computes to 'steps(2)' assert_true: 'steps(2, jump-end)' is a supported value for animation-timing-function. expected true got false
-FAIL Property animation-timing-function value 'steps(2, jump-both)' computes to 'steps(2, jump-both)' assert_true: 'steps(2, jump-both)' is a supported value for animation-timing-function. expected true got false
-FAIL Property animation-timing-function value 'steps(2, jump-none)' computes to 'steps(2, jump-none)' assert_true: 'steps(2, jump-none)' is a supported value for animation-timing-function. expected true got false
+PASS Property animation-timing-function value 'steps(2, end)' computes to 'steps(2)' 
+PASS Property animation-timing-function value 'steps(2, jump-start)' computes to 'steps(2, jump-start)' 
+PASS Property animation-timing-function value 'steps(2, jump-end)' computes to 'steps(2)' 
+PASS Property animation-timing-function value 'steps(2, jump-both)' computes to 'steps(2, jump-both)' 
+PASS Property animation-timing-function value 'steps(2, jump-none)' computes to 'steps(2, jump-none)' 
 PASS Property animation-timing-function value 'linear, ease, linear' computes to 'linear, ease, linear' 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-timing-function-valid-expected.txt (261045 => 261046)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-timing-function-valid-expected.txt	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/parsing/animation-timing-function-valid-expected.txt	2020-05-02 09:34:30 UTC (rev 261046)
@@ -8,10 +8,10 @@
 PASS e.style['animation-timing-function'] = "cubic-bezier(0, -2, 1, 3)" should set the property value 
 PASS e.style['animation-timing-function'] = "cubic-bezier(0, 0.7, 1, 1.3)" should set the property value 
 PASS e.style['animation-timing-function'] = "steps(4, start)" should set the property value 
-FAIL e.style['animation-timing-function'] = "steps(2, end)" should set the property value assert_equals: serialization should be canonical expected "steps(2)" but got "steps(2, end)"
-FAIL e.style['animation-timing-function'] = "steps(2, jump-start)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['animation-timing-function'] = "steps(2, jump-end)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['animation-timing-function'] = "steps(2, jump-both)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['animation-timing-function'] = "steps(2, jump-none)" should set the property value assert_not_equals: property should be set got disallowed value ""
+PASS e.style['animation-timing-function'] = "steps(2, end)" should set the property value 
+PASS e.style['animation-timing-function'] = "steps(2, jump-start)" should set the property value 
+PASS e.style['animation-timing-function'] = "steps(2, jump-end)" should set the property value 
+PASS e.style['animation-timing-function'] = "steps(2, jump-both)" should set the property value 
+PASS e.style['animation-timing-function'] = "steps(2, jump-none)" should set the property value 
 PASS e.style['animation-timing-function'] = "linear, ease, linear" should set the property value 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-easing/step-timing-functions-output-expected.txt (261045 => 261046)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-easing/step-timing-functions-output-expected.txt	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-easing/step-timing-functions-output-expected.txt	2020-05-02 09:34:30 UTC (rev 261046)
@@ -6,10 +6,10 @@
 PASS step-end easing with input progress greater than 1 
 PASS step-end easing with input progress greater than 2 
 PASS step-end easing with input progress less than 0 
-FAIL steps(1, jump-both) easing with input progress greater than 1 Type error
-FAIL steps(1, jump-both) easing with input progress greater than 2 Type error
-FAIL steps(1, jump-both) easing with input progress less than 0 Type error
-FAIL steps(2, jump-none) easing with input progress greater than 1 Type error
-FAIL steps(2, jump-none) easing with input progress greater than 2 Type error
-FAIL steps(2, jump-none) easing with input progress less than 0 Type error
+PASS steps(1, jump-both) easing with input progress greater than 1 
+PASS steps(1, jump-both) easing with input progress greater than 2 
+PASS steps(1, jump-both) easing with input progress less than 0 
+PASS steps(2, jump-none) easing with input progress greater than 1 
+PASS steps(2, jump-none) easing with input progress greater than 2 
+PASS steps(2, jump-none) easing with input progress less than 0 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-easing/step-timing-functions-syntax-expected.txt (261045 => 261046)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-easing/step-timing-functions-syntax-expected.txt	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-easing/step-timing-functions-syntax-expected.txt	2020-05-02 09:34:30 UTC (rev 261046)
@@ -1,12 +1,12 @@
 
-FAIL e.style['animation-timing-function'] = "step-start" should set the property value assert_equals: serialization should be canonical expected "steps(1, start)" but got "step-start"
-FAIL e.style['animation-timing-function'] = "step-end" should set the property value assert_equals: serialization should be canonical expected "steps(1)" but got "step-end"
+PASS e.style['animation-timing-function'] = "step-start" should set the property value 
+PASS e.style['animation-timing-function'] = "step-end" should set the property value 
 PASS e.style['animation-timing-function'] = "steps(1, start)" should set the property value 
-FAIL e.style['animation-timing-function'] = "steps(1, end)" should set the property value assert_equals: serialization should be canonical expected "steps(1)" but got "steps(1, end)"
-FAIL e.style['animation-timing-function'] = "steps(1, jump-start)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['animation-timing-function'] = "steps(1, jump-end)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['animation-timing-function'] = "steps(1, jump-both)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['animation-timing-function'] = "steps(2, jump-none)" should set the property value assert_not_equals: property should be set got disallowed value ""
+PASS e.style['animation-timing-function'] = "steps(1, end)" should set the property value 
+PASS e.style['animation-timing-function'] = "steps(1, jump-start)" should set the property value 
+PASS e.style['animation-timing-function'] = "steps(1, jump-end)" should set the property value 
+PASS e.style['animation-timing-function'] = "steps(1, jump-both)" should set the property value 
+PASS e.style['animation-timing-function'] = "steps(2, jump-none)" should set the property value 
 PASS e.style['animation-timing-function'] = "steps(0, start)" should not set the property value 
 PASS e.style['animation-timing-function'] = "steps(0, end)" should not set the property value 
 PASS e.style['animation-timing-function'] = "steps(0, jump-start)" should not set the property value 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-timing-function-computed-expected.txt (261045 => 261046)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-timing-function-computed-expected.txt	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-timing-function-computed-expected.txt	2020-05-02 09:34:30 UTC (rev 261046)
@@ -8,13 +8,13 @@
 PASS Property transition-timing-function value 'cubic-bezier(0, -2, 1, 3)' computes to 'cubic-bezier(0, -2, 1, 3)' 
 PASS Property transition-timing-function value 'cubic-bezier(0, 0.7, 1, 1.3)' computes to 'cubic-bezier(0, 0.7, 1, 1.3)' 
 PASS Property transition-timing-function value 'step-start' computes to 'steps(1, start)' 
-FAIL Property transition-timing-function value 'step-end' computes to 'steps(1)' assert_equals: expected "steps(1)" but got "steps(1, end)"
-FAIL Property transition-timing-function value 'steps(4)' computes to 'steps(4)' assert_equals: expected "steps(4)" but got "steps(4, end)"
+PASS Property transition-timing-function value 'step-end' computes to 'steps(1)' 
+PASS Property transition-timing-function value 'steps(4)' computes to 'steps(4)' 
 PASS Property transition-timing-function value 'steps(4, start)' computes to 'steps(4, start)' 
-FAIL Property transition-timing-function value 'steps(2, end)' computes to 'steps(2)' assert_equals: expected "steps(2)" but got "steps(2, end)"
-FAIL Property transition-timing-function value 'steps(2, jump-start)' computes to 'steps(2, jump-start)' assert_true: 'steps(2, jump-start)' is a supported value for transition-timing-function. expected true got false
-FAIL Property transition-timing-function value 'steps(2, jump-end)' computes to 'steps(2)' assert_true: 'steps(2, jump-end)' is a supported value for transition-timing-function. expected true got false
-FAIL Property transition-timing-function value 'steps(2, jump-both)' computes to 'steps(2, jump-both)' assert_true: 'steps(2, jump-both)' is a supported value for transition-timing-function. expected true got false
-FAIL Property transition-timing-function value 'steps(2, jump-none)' computes to 'steps(2, jump-none)' assert_true: 'steps(2, jump-none)' is a supported value for transition-timing-function. expected true got false
+PASS Property transition-timing-function value 'steps(2, end)' computes to 'steps(2)' 
+PASS Property transition-timing-function value 'steps(2, jump-start)' computes to 'steps(2, jump-start)' 
+PASS Property transition-timing-function value 'steps(2, jump-end)' computes to 'steps(2)' 
+PASS Property transition-timing-function value 'steps(2, jump-both)' computes to 'steps(2, jump-both)' 
+PASS Property transition-timing-function value 'steps(2, jump-none)' computes to 'steps(2, jump-none)' 
 FAIL Property transition-timing-function value 'linear, ease, linear' computes to 'linear, ease, linear' assert_equals: expected "linear, ease, linear" but got "linear"
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-timing-function-valid-expected.txt (261045 => 261046)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-timing-function-valid-expected.txt	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-timing-function-valid-expected.txt	2020-05-02 09:34:30 UTC (rev 261046)
@@ -7,14 +7,14 @@
 PASS e.style['transition-timing-function'] = "cubic-bezier(0.1, 0.2, 0.8, 0.9)" should set the property value 
 PASS e.style['transition-timing-function'] = "cubic-bezier(0, -2, 1, 3)" should set the property value 
 PASS e.style['transition-timing-function'] = "cubic-bezier(0, 0.7, 1, 1.3)" should set the property value 
-FAIL e.style['transition-timing-function'] = "step-start" should set the property value assert_equals: serialization should be canonical expected "steps(1, start)" but got "step-start"
-FAIL e.style['transition-timing-function'] = "step-end" should set the property value assert_equals: serialization should be canonical expected "steps(1)" but got "step-end"
-FAIL e.style['transition-timing-function'] = "steps(4)" should set the property value assert_equals: serialization should be canonical expected "steps(4)" but got "steps(4, end)"
+PASS e.style['transition-timing-function'] = "step-start" should set the property value 
+PASS e.style['transition-timing-function'] = "step-end" should set the property value 
+PASS e.style['transition-timing-function'] = "steps(4)" should set the property value 
 PASS e.style['transition-timing-function'] = "steps(4, start)" should set the property value 
-FAIL e.style['transition-timing-function'] = "steps(2, end)" should set the property value assert_equals: serialization should be canonical expected "steps(2)" but got "steps(2, end)"
-FAIL e.style['transition-timing-function'] = "steps(2, jump-start)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['transition-timing-function'] = "steps(2, jump-end)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['transition-timing-function'] = "steps(2, jump-both)" should set the property value assert_not_equals: property should be set got disallowed value ""
-FAIL e.style['transition-timing-function'] = "steps(2, jump-none)" should set the property value assert_not_equals: property should be set got disallowed value ""
+PASS e.style['transition-timing-function'] = "steps(2, end)" should set the property value 
+PASS e.style['transition-timing-function'] = "steps(2, jump-start)" should set the property value 
+PASS e.style['transition-timing-function'] = "steps(2, jump-end)" should set the property value 
+PASS e.style['transition-timing-function'] = "steps(2, jump-both)" should set the property value 
+PASS e.style['transition-timing-function'] = "steps(2, jump-none)" should set the property value 
 PASS e.style['transition-timing-function'] = "linear, ease, linear" should set the property value 
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/timing-model/time-transformations/transformed-progress-expected.txt (261045 => 261046)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/timing-model/time-transformations/transformed-progress-expected.txt	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/timing-model/time-transformations/transformed-progress-expected.txt	2020-05-02 09:34:30 UTC (rev 261046)
@@ -24,10 +24,10 @@
 PASS Test bounds point of step-end easing 
 PASS Test bounds point of step-end easing with iterationStart and delay 
 PASS Test bounds point of step-end easing with iterationStart not at a transition point 
-FAIL Test bounds point of steps(jump-both) easing Type error
-FAIL Test bounds point of steps(jump-both) easing with iterationStart and delay Type error
-FAIL Test bounds point of steps(jump-both) easing with iterationStart not at a transition point Type error
-FAIL Test bounds point of steps(jump-none) easing Type error
-FAIL Test bounds point of steps(jump-none) easing with iterationStart and delay Type error
-FAIL Test bounds point of steps(jump-none) easing with iterationStart not at a transition point Type error
+PASS Test bounds point of steps(jump-both) easing 
+PASS Test bounds point of steps(jump-both) easing with iterationStart and delay 
+PASS Test bounds point of steps(jump-both) easing with iterationStart not at a transition point 
+PASS Test bounds point of steps(jump-none) easing 
+PASS Test bounds point of steps(jump-none) easing with iterationStart and delay 
+PASS Test bounds point of steps(jump-none) easing with iterationStart not at a transition point 
 

Modified: trunk/LayoutTests/transitions/transitions-parsing-expected.txt (261045 => 261046)


--- trunk/LayoutTests/transitions/transitions-parsing-expected.txt	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/LayoutTests/transitions/transitions-parsing-expected.txt	2020-05-02 09:34:30 UTC (rev 261046)
@@ -200,22 +200,22 @@
 PASS computedStyle.transitionTimingFunction is 'cubic-bezier(0.2, -2, 0.2, 0.4)'
 PASS style.webkitTransitionTimingFunction is 'cubic-bezier(0.2, -2, 0.2, 0.4)'
 PASS computedStyle.webkitTransitionTimingFunction is 'cubic-bezier(0.2, -2, 0.2, 0.4)'
-PASS style.transitionTimingFunction is 'step-start'
+PASS style.transitionTimingFunction is 'steps(1, start)'
 PASS computedStyle.transitionTimingFunction is 'steps(1, start)'
-PASS style.webkitTransitionTimingFunction is 'step-start'
+PASS style.webkitTransitionTimingFunction is 'steps(1, start)'
 PASS computedStyle.webkitTransitionTimingFunction is 'steps(1, start)'
-PASS style.transitionTimingFunction is 'step-end'
-PASS computedStyle.transitionTimingFunction is 'steps(1, end)'
-PASS style.webkitTransitionTimingFunction is 'step-end'
-PASS computedStyle.webkitTransitionTimingFunction is 'steps(1, end)'
-PASS style.transitionTimingFunction is 'steps(3, end)'
-PASS computedStyle.transitionTimingFunction is 'steps(3, end)'
-PASS style.webkitTransitionTimingFunction is 'steps(3, end)'
-PASS computedStyle.webkitTransitionTimingFunction is 'steps(3, end)'
-PASS style.transitionTimingFunction is 'steps(4, end)'
-PASS computedStyle.transitionTimingFunction is 'steps(4, end)'
-PASS style.webkitTransitionTimingFunction is 'steps(4, end)'
-PASS computedStyle.webkitTransitionTimingFunction is 'steps(4, end)'
+PASS style.transitionTimingFunction is 'steps(1)'
+PASS computedStyle.transitionTimingFunction is 'steps(1)'
+PASS style.webkitTransitionTimingFunction is 'steps(1)'
+PASS computedStyle.webkitTransitionTimingFunction is 'steps(1)'
+PASS style.transitionTimingFunction is 'steps(3)'
+PASS computedStyle.transitionTimingFunction is 'steps(3)'
+PASS style.webkitTransitionTimingFunction is 'steps(3)'
+PASS computedStyle.webkitTransitionTimingFunction is 'steps(3)'
+PASS style.transitionTimingFunction is 'steps(4)'
+PASS computedStyle.transitionTimingFunction is 'steps(4)'
+PASS style.webkitTransitionTimingFunction is 'steps(4)'
+PASS computedStyle.webkitTransitionTimingFunction is 'steps(4)'
 PASS style.transitionTimingFunction is 'steps(5, start)'
 PASS computedStyle.transitionTimingFunction is 'steps(5, start)'
 PASS style.webkitTransitionTimingFunction is 'steps(5, start)'

Modified: trunk/LayoutTests/transitions/transitions-parsing.html (261045 => 261046)


--- trunk/LayoutTests/transitions/transitions-parsing.html	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/LayoutTests/transitions/transitions-parsing.html	2020-05-02 09:34:30 UTC (rev 261046)
@@ -330,28 +330,28 @@
 shouldBe("computedStyle.webkitTransitionTimingFunction", "'cubic-bezier(0.2, -2, 0.2, 0.4)'");
 
 style.transitionTimingFunction = "step-start";
-shouldBe("style.transitionTimingFunction", "'step-start'");
+shouldBe("style.transitionTimingFunction", "'steps(1, start)'");
 shouldBe("computedStyle.transitionTimingFunction", "'steps(1, start)'");
-shouldBe("style.webkitTransitionTimingFunction", "'step-start'");
+shouldBe("style.webkitTransitionTimingFunction", "'steps(1, start)'");
 shouldBe("computedStyle.webkitTransitionTimingFunction", "'steps(1, start)'");
 
 style.transitionTimingFunction = "step-end";
-shouldBe("style.transitionTimingFunction", "'step-end'");
-shouldBe("computedStyle.transitionTimingFunction", "'steps(1, end)'");
-shouldBe("style.webkitTransitionTimingFunction", "'step-end'");
-shouldBe("computedStyle.webkitTransitionTimingFunction", "'steps(1, end)'");
+shouldBe("style.transitionTimingFunction", "'steps(1)'");
+shouldBe("computedStyle.transitionTimingFunction", "'steps(1)'");
+shouldBe("style.webkitTransitionTimingFunction", "'steps(1)'");
+shouldBe("computedStyle.webkitTransitionTimingFunction", "'steps(1)'");
 
 style.transitionTimingFunction = "steps(3)";
-shouldBe("style.transitionTimingFunction", "'steps(3, end)'");
-shouldBe("computedStyle.transitionTimingFunction", "'steps(3, end)'");
-shouldBe("style.webkitTransitionTimingFunction", "'steps(3, end)'");
-shouldBe("computedStyle.webkitTransitionTimingFunction", "'steps(3, end)'");
+shouldBe("style.transitionTimingFunction", "'steps(3)'");
+shouldBe("computedStyle.transitionTimingFunction", "'steps(3)'");
+shouldBe("style.webkitTransitionTimingFunction", "'steps(3)'");
+shouldBe("computedStyle.webkitTransitionTimingFunction", "'steps(3)'");
 
-style.transitionTimingFunction = "steps(4, end)";
-shouldBe("style.transitionTimingFunction", "'steps(4, end)'");
-shouldBe("computedStyle.transitionTimingFunction", "'steps(4, end)'");
-shouldBe("style.webkitTransitionTimingFunction", "'steps(4, end)'");
-shouldBe("computedStyle.webkitTransitionTimingFunction", "'steps(4, end)'");
+style.transitionTimingFunction = "steps(4)";
+shouldBe("style.transitionTimingFunction", "'steps(4)'");
+shouldBe("computedStyle.transitionTimingFunction", "'steps(4)'");
+shouldBe("style.webkitTransitionTimingFunction", "'steps(4)'");
+shouldBe("computedStyle.webkitTransitionTimingFunction", "'steps(4)'");
 
 style.transitionTimingFunction = "steps(5, start)";
 shouldBe("style.transitionTimingFunction", "'steps(5, start)'");

Modified: trunk/Source/WebCore/ChangeLog (261045 => 261046)


--- trunk/Source/WebCore/ChangeLog	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/Source/WebCore/ChangeLog	2020-05-02 09:34:30 UTC (rev 261046)
@@ -1,3 +1,61 @@
+2020-05-02  Devin Rousso  <[email protected]>
+
+        [CSS Easing 1] implement `jump-*` step positions
+        https://bugs.webkit.org/show_bug.cgi?id=211271
+
+        Reviewed by Dean Jackson.
+
+        Add support for `jump-start`, `jump-end`, `jump-none`, and `jump-both` step positions inside
+        the `steps()` CSS timing function <https://drafts.csswg.org/css-easing-1/#step-position>.
+
+        Adjust existing serialization logic to match the spec <https://drafts.csswg.org/css-easing-1/#serialization>:
+         - omit `end` (and `jump-end`)
+         - the value `step-start` should result in `steps(1, start)` instead of `step-start`
+         - the value `step-end` should result in `steps(1)` instead of `step-end`
+
+        Tests: animations/computed-style.html
+               fast/css/animation-steps-calculated-value.html
+               transitions/transitions-parsing.html
+               web-platform-tests/css/css-animations/parsing/animation-timing-function-computed.html
+               web-platform-tests/css/css-animations/parsing/animation-timing-function-valid.html
+               web-platform-tests/css/css-easing/step-timing-functions-output.html
+               web-platform-tests/css/css-easing/step-timing-functions-syntax.html
+               web-platform-tests/css/css-transitions/parsing/transition-timing-function-computed.html
+               web-platform-tests/css/css-transitions/parsing/transition-timing-function-valid.html
+               web-platform-tests/web-animations/timing-model/time-transformations/transformed-progress.html
+
+        * css/CSSValueKeywords.in:
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::consumeSteps):
+        (WebCore::consumeAnimationTimingFunction):
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::createTimingFunctionValue):
+        * css/CSSToStyleMap.cpp:
+        (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
+
+        * css/CSSTimingFunctionValue.h:
+        (WebCore::CSSStepsTimingFunctionValue::create):
+        (WebCore::CSSStepsTimingFunctionValue::stepPosition const): Added.
+        (WebCore::CSSStepsTimingFunctionValue::CSSStepsTimingFunctionValue):
+        (WebCore::CSSStepsTimingFunctionValue::stepAtStart const): Deleted.
+        * css/CSSTimingFunctionValue.cpp:
+        (WebCore::CSSStepsTimingFunctionValue::customCSSText const):
+        (WebCore::CSSStepsTimingFunctionValue::equals const):
+
+        * platform/animation/TimingFunction.h:
+        (WebCore::StepsTimingFunction::create):
+        (WebCore::StepsTimingFunction::StepsTimingFunction):
+        (WebCore::StepsTimingFunction::stepPosition): Added.
+        (WebCore::StepsTimingFunction::setStepPosition): Added.
+        (WebCore::StepsTimingFunction::clone):
+        (WebCore::StepsTimingFunction::stepAtStart): Deleted.
+        (WebCore::StepsTimingFunction::setStepAtStart): Deleted.
+        * platform/animation/TimingFunction.cpp:
+        (WebCore::operator<<):
+        (WebCore::TimingFunction::transformTime):
+        (WebCore::TimingFunction::createFromCSSValue):
+        (WebCore::TimingFunction::cssText const):
+
 2020-05-01  Tim Horton  <[email protected]>
 
         Books sometimes ends up with blank pages, especially after adjusting font size

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (261045 => 261046)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2020-05-02 09:34:30 UTC (rev 261046)
@@ -1287,7 +1287,7 @@
     }
     case TimingFunction::StepsFunction: {
         auto& function = downcast<StepsTimingFunction>(timingFunction);
-        return CSSStepsTimingFunctionValue::create(function.numberOfSteps(), function.stepAtStart());
+        return CSSStepsTimingFunctionValue::create(function.numberOfSteps(), function.stepPosition());
     }
     case TimingFunction::SpringFunction: {
         auto& function = downcast<SpringTimingFunction>(timingFunction);

Modified: trunk/Source/WebCore/css/CSSTimingFunctionValue.cpp (261045 => 261046)


--- trunk/Source/WebCore/css/CSSTimingFunctionValue.cpp	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/Source/WebCore/css/CSSTimingFunctionValue.cpp	2020-05-02 09:34:30 UTC (rev 261046)
@@ -45,16 +45,36 @@
     StringBuilder builder;
     builder.appendLiteral("steps(");
     builder.appendNumber(m_steps);
-    if (m_stepAtStart)
-        builder.appendLiteral(", start)");
-    else
-        builder.appendLiteral(", end)");
+    if (m_stepPosition) {
+        switch (m_stepPosition.value()) {
+        case StepsTimingFunction::StepPosition::JumpStart:
+            builder.appendLiteral(", jump-start");
+            break;
+
+        case StepsTimingFunction::StepPosition::JumpNone:
+            builder.appendLiteral(", jump-none");
+            break;
+
+        case StepsTimingFunction::StepPosition::JumpBoth:
+            builder.appendLiteral(", jump-both");
+            break;
+
+        case StepsTimingFunction::StepPosition::Start:
+            builder.appendLiteral(", start");
+            break;
+
+        case StepsTimingFunction::StepPosition::JumpEnd:
+        case StepsTimingFunction::StepPosition::End:
+            break;
+        }
+    }
+    builder.appendLiteral(")");
     return builder.toString();
 }
 
 bool CSSStepsTimingFunctionValue::equals(const CSSStepsTimingFunctionValue& other) const
 {
-    return m_steps == other.m_steps && m_stepAtStart == other.m_stepAtStart;
+    return m_steps == other.m_steps && m_stepPosition == other.m_stepPosition;
 }
 
 String CSSSpringTimingFunctionValue::customCSSText() const

Modified: trunk/Source/WebCore/css/CSSTimingFunctionValue.h (261045 => 261046)


--- trunk/Source/WebCore/css/CSSTimingFunctionValue.h	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/Source/WebCore/css/CSSTimingFunctionValue.h	2020-05-02 09:34:30 UTC (rev 261046)
@@ -26,6 +26,7 @@
 #pragma once
 
 #include "CSSValue.h"
+#include "TimingFunction.h"
 
 namespace WebCore {
 
@@ -63,13 +64,13 @@
 
 class CSSStepsTimingFunctionValue final : public CSSValue {
 public:
-    static Ref<CSSStepsTimingFunctionValue> create(int steps, bool stepAtStart)
+    static Ref<CSSStepsTimingFunctionValue> create(int steps, Optional<StepsTimingFunction::StepPosition> stepPosition)
     {
-        return adoptRef(*new CSSStepsTimingFunctionValue(steps, stepAtStart));
+        return adoptRef(*new CSSStepsTimingFunctionValue(steps, stepPosition));
     }
 
     int numberOfSteps() const { return m_steps; }
-    bool stepAtStart() const { return m_stepAtStart; }
+    Optional<StepsTimingFunction::StepPosition> stepPosition() const { return m_stepPosition; }
 
     String customCSSText() const;
 
@@ -76,15 +77,15 @@
     bool equals(const CSSStepsTimingFunctionValue&) const;
 
 private:
-    CSSStepsTimingFunctionValue(int steps, bool stepAtStart)
+    CSSStepsTimingFunctionValue(int steps, Optional<StepsTimingFunction::StepPosition> stepPosition)
         : CSSValue(StepsTimingFunctionClass)
         , m_steps(steps)
-        , m_stepAtStart(stepAtStart)
+        , m_stepPosition(stepPosition)
     {
     }
 
     int m_steps;
-    bool m_stepAtStart;
+    Optional<StepsTimingFunction::StepPosition> m_stepPosition;
 };
 
 class CSSSpringTimingFunctionValue final : public CSSValue {

Modified: trunk/Source/WebCore/css/CSSToStyleMap.cpp (261045 => 261046)


--- trunk/Source/WebCore/css/CSSToStyleMap.cpp	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/Source/WebCore/css/CSSToStyleMap.cpp	2020-05-02 09:34:30 UTC (rev 261046)
@@ -474,10 +474,10 @@
             animation.setTimingFunction(CubicBezierTimingFunction::create(CubicBezierTimingFunction::EaseInOut));
             break;
         case CSSValueStepStart:
-            animation.setTimingFunction(StepsTimingFunction::create(1, true));
+            animation.setTimingFunction(StepsTimingFunction::create(1, StepsTimingFunction::StepPosition::Start));
             break;
         case CSSValueStepEnd:
-            animation.setTimingFunction(StepsTimingFunction::create(1, false));
+            animation.setTimingFunction(StepsTimingFunction::create(1, StepsTimingFunction::StepPosition::End));
             break;
         default:
             break;
@@ -490,7 +490,7 @@
         animation.setTimingFunction(CubicBezierTimingFunction::create(cubicTimingFunction.x1(), cubicTimingFunction.y1(), cubicTimingFunction.x2(), cubicTimingFunction.y2()));
     } else if (is<CSSStepsTimingFunctionValue>(value)) {
         auto& stepsTimingFunction = downcast<CSSStepsTimingFunctionValue>(value);
-        animation.setTimingFunction(StepsTimingFunction::create(stepsTimingFunction.numberOfSteps(), stepsTimingFunction.stepAtStart()));
+        animation.setTimingFunction(StepsTimingFunction::create(stepsTimingFunction.numberOfSteps(), stepsTimingFunction.stepPosition()));
     } else if (is<CSSSpringTimingFunctionValue>(value)) {
         auto& springTimingFunction = downcast<CSSSpringTimingFunctionValue>(value);
         animation.setTimingFunction(SpringTimingFunction::create(springTimingFunction.mass(), springTimingFunction.stiffness(), springTimingFunction.damping(), springTimingFunction.initialVelocity()));

Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (261045 => 261046)


--- trunk/Source/WebCore/css/CSSValueKeywords.in	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in	2020-05-02 09:34:30 UTC (rev 261046)
@@ -977,6 +977,12 @@
 ease-in-out
 step-start
 step-end
+jump-start
+jump-end
+jump-none
+jump-both
+// start
+// end
 
 //
 // CSS_PROP_ZOOM

Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (261045 => 261046)


--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp	2020-05-02 09:34:30 UTC (rev 261046)
@@ -1456,34 +1456,57 @@
     
 static RefPtr<CSSValue> consumeSteps(CSSParserTokenRange& range)
 {
+    // https://drafts.csswg.org/css-easing-1/#funcdef-step-easing-function-steps
+
     ASSERT(range.peek().functionId() == CSSValueSteps);
     CSSParserTokenRange rangeCopy = range;
     CSSParserTokenRange args = consumeFunction(rangeCopy);
     
-    RefPtr<CSSPrimitiveValue> steps = consumePositiveInteger(args);
-    if (!steps)
+    RefPtr<CSSPrimitiveValue> stepsValue = consumePositiveInteger(args);
+    if (!stepsValue)
         return nullptr;
     
-    // FIXME-NEWPARSER: Support the middle value and change from a boolean to an enum.
-    bool stepAtStart = false;
+    Optional<StepsTimingFunction::StepPosition> stepPosition;
     if (consumeCommaIncludingWhitespace(args)) {
         switch (args.consumeIncludingWhitespace().id()) {
-            case CSSValueStart:
-                stepAtStart = true;
+        case CSSValueJumpStart:
+            stepPosition = StepsTimingFunction::StepPosition::JumpStart;
             break;
-            case CSSValueEnd:
-                stepAtStart = false;
-                break;
-            default:
-                return nullptr;
+
+        case CSSValueJumpEnd:
+            stepPosition = StepsTimingFunction::StepPosition::JumpEnd;
+            break;
+
+        case CSSValueJumpNone:
+            stepPosition = StepsTimingFunction::StepPosition::JumpNone;
+            break;
+
+        case CSSValueJumpBoth:
+            stepPosition = StepsTimingFunction::StepPosition::JumpBoth;
+            break;
+
+        case CSSValueStart:
+            stepPosition = StepsTimingFunction::StepPosition::Start;
+            break;
+
+        case CSSValueEnd:
+            stepPosition = StepsTimingFunction::StepPosition::End;
+            break;
+
+        default:
+            return nullptr;
         }
     }
     
     if (!args.atEnd())
         return nullptr;
+
+    auto steps = stepsValue->intValue();
+    if (steps <= 1 && stepPosition == StepsTimingFunction::StepPosition::JumpNone)
+        return nullptr;
     
     range = rangeCopy;
-    return CSSStepsTimingFunctionValue::create(steps->intValue(), stepAtStart);
+    return CSSStepsTimingFunctionValue::create(steps, stepPosition);
 }
 
 static RefPtr<CSSValue> consumeCubicBezier(CSSParserTokenRange& range)
@@ -1546,11 +1569,26 @@
 
 static RefPtr<CSSValue> consumeAnimationTimingFunction(CSSParserTokenRange& range, const CSSParserContext& context)
 {
-    CSSValueID id = range.peek().id();
-    if (id == CSSValueEase || id == CSSValueLinear || id == CSSValueEaseIn
-        || id == CSSValueEaseOut || id == CSSValueEaseInOut || id == CSSValueStepStart || id == CSSValueStepEnd)
+    switch (range.peek().id()) {
+    case CSSValueLinear:
+    case CSSValueEase:
+    case CSSValueEaseIn:
+    case CSSValueEaseOut:
+    case CSSValueEaseInOut:
         return consumeIdent(range);
 
+    case CSSValueStepStart:
+        range.consumeIncludingWhitespace();
+        return CSSStepsTimingFunctionValue::create(1, StepsTimingFunction::StepPosition::Start);
+
+    case CSSValueStepEnd:
+        range.consumeIncludingWhitespace();
+        return CSSStepsTimingFunctionValue::create(1, StepsTimingFunction::StepPosition::End);
+
+    default:
+        break;
+    }
+
     CSSValueID function = range.peek().functionId();
     if (function == CSSValueCubicBezier)
         return consumeCubicBezier(range);

Modified: trunk/Source/WebCore/platform/animation/TimingFunction.cpp (261045 => 261046)


--- trunk/Source/WebCore/platform/animation/TimingFunction.cpp	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/Source/WebCore/platform/animation/TimingFunction.cpp	2020-05-02 09:34:30 UTC (rev 261046)
@@ -48,7 +48,36 @@
     }
     case TimingFunction::StepsFunction: {
         auto& function = downcast<StepsTimingFunction>(timingFunction);
-        ts << "steps(" << function.numberOfSteps() << ", " << (function.stepAtStart() ? "start" : "end") << ")";
+        ts << "steps(" << function.numberOfSteps();
+        if (auto stepPosition = function.stepPosition()) {
+            ts << ", ";
+            switch (stepPosition.value()) {
+            case StepsTimingFunction::StepPosition::JumpStart:
+                ts << "jump-start";
+                break;
+
+            case StepsTimingFunction::StepPosition::JumpEnd:
+                ts << "jump-end";
+                break;
+
+            case StepsTimingFunction::StepPosition::JumpNone:
+                ts << "jump-none";
+                break;
+
+            case StepsTimingFunction::StepPosition::JumpBoth:
+                ts << "jump-both";
+                break;
+
+            case StepsTimingFunction::StepPosition::Start:
+                ts << "start";
+                break;
+
+            case StepsTimingFunction::StepPosition::End:
+                ts << "end";
+                break;
+            }
+        }
+        ts << ")";
         break;
     }
     case TimingFunction::SpringFunction: {
@@ -73,14 +102,15 @@
         return UnitBezier(function.x1(), function.y1(), function.x2(), function.y2()).solve(inputTime, epsilon);
     }
     case TimingFunction::StepsFunction: {
-        // https://drafts.csswg.org/css-timing/#step-timing-functions
+        // https://drafts.csswg.org/css-easing-1/#step-timing-functions
         auto& function = downcast<StepsTimingFunction>(*this);
         auto steps = function.numberOfSteps();
+        auto stepPosition = function.stepPosition();
         // 1. Calculate the current step as floor(input progress value × steps).
         auto currentStep = std::floor(inputTime * steps);
         // 2. If the step position property is start, increment current step by one.
-        if (function.stepAtStart())
-            currentStep++;
+        if (stepPosition == StepsTimingFunction::StepPosition::JumpStart || stepPosition == StepsTimingFunction::StepPosition::Start || stepPosition == StepsTimingFunction::StepPosition::JumpBoth)
+            ++currentStep;
         // 3. If both of the following conditions are true:
         //    - the before flag is set, and
         //    - input progress value × steps mod 1 equals zero (that is, if input progress value × steps is integral), then
@@ -90,10 +120,15 @@
         // 4. If input progress value ≥ 0 and current step < 0, let current step be zero.
         if (inputTime >= 0 && currentStep < 0)
             currentStep = 0;
-        // 5. If input progress value ≤ 1 and current step > steps, let current step be steps.
+        // 5. Calculate jumps based on the step position.
+        if (stepPosition == StepsTimingFunction::StepPosition::JumpNone)
+            --steps;
+        else if (stepPosition == StepsTimingFunction::StepPosition::JumpBoth)
+            ++steps;
+        // 6. If input progress value ≤ 1 and current step > jumps, let current step be jumps.
         if (inputTime <= 1 && currentStep > steps)
             currentStep = steps;
-        // 6. The output progress value is current step / steps.
+        // 7. The output progress value is current step / jumps.
         return currentStep / steps;
     }
     case TimingFunction::SpringFunction: {
@@ -140,9 +175,9 @@
         case CSSValueEaseInOut:
             return CubicBezierTimingFunction::create(CubicBezierTimingFunction::EaseInOut);
         case CSSValueStepStart:
-            return StepsTimingFunction::create(1, true);
+            return StepsTimingFunction::create(1, StepsTimingFunction::StepPosition::Start);
         case CSSValueStepEnd:
-            return StepsTimingFunction::create(1, false);
+            return StepsTimingFunction::create(1, StepsTimingFunction::StepPosition::End);
         default:
             return nullptr;
         }
@@ -154,7 +189,7 @@
     }
     if (is<CSSStepsTimingFunctionValue>(value)) {
         auto& stepsTimingFunction = downcast<CSSStepsTimingFunctionValue>(value);
-        return StepsTimingFunction::create(stepsTimingFunction.numberOfSteps(), stepsTimingFunction.stepAtStart());
+        return StepsTimingFunction::create(stepsTimingFunction.numberOfSteps(), stepsTimingFunction.stepPosition());
     }
     if (is<CSSSpringTimingFunctionValue>(value)) {
         auto& springTimingFunction = downcast<CSSSpringTimingFunctionValue>(value);
@@ -181,7 +216,7 @@
 
     if (m_type == TimingFunction::StepsFunction) {
         auto& function = downcast<StepsTimingFunction>(*this);
-        if (!function.stepAtStart())
+        if (function.stepPosition() == StepsTimingFunction::StepPosition::JumpEnd || function.stepPosition() == StepsTimingFunction::StepPosition::End)
             return makeString("steps(", function.numberOfSteps(), ')');
     }
 

Modified: trunk/Source/WebCore/platform/animation/TimingFunction.h (261045 => 261046)


--- trunk/Source/WebCore/platform/animation/TimingFunction.h	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/Source/WebCore/platform/animation/TimingFunction.h	2020-05-02 09:34:30 UTC (rev 261046)
@@ -192,13 +192,22 @@
 
 class StepsTimingFunction final : public TimingFunction {
 public:
-    static Ref<StepsTimingFunction> create(int steps, bool stepAtStart)
+    enum class StepPosition {
+        JumpStart,
+        JumpEnd,
+        JumpNone,
+        JumpBoth,
+        Start,
+        End,
+    };
+
+    static Ref<StepsTimingFunction> create(int steps, Optional<StepPosition> stepPosition)
     {
-        return adoptRef(*new StepsTimingFunction(steps, stepAtStart));
+        return adoptRef(*new StepsTimingFunction(steps, stepPosition));
     }
     static Ref<StepsTimingFunction> create()
     {
-        return adoptRef(*new StepsTimingFunction(1, true));
+        return adoptRef(*new StepsTimingFunction(1, StepPosition::End));
     }
     
     bool operator==(const TimingFunction& other) const final
@@ -206,30 +215,30 @@
         if (!is<StepsTimingFunction>(other))
             return false;
         auto& otherSteps = downcast<StepsTimingFunction>(other);
-        return m_steps == otherSteps.m_steps && m_stepAtStart == otherSteps.m_stepAtStart;
+        return m_steps == otherSteps.m_steps && m_stepPosition == otherSteps.m_stepPosition;
     }
     
     int numberOfSteps() const { return m_steps; }
     void setNumberOfSteps(int steps) { m_steps = steps; }
 
-    bool stepAtStart() const { return m_stepAtStart; }
-    void setStepAtStart(bool stepAtStart) { m_stepAtStart = stepAtStart; }
+    Optional<StepPosition> stepPosition() const { return m_stepPosition; }
+    void setStepPosition(Optional<StepPosition> stepPosition) { m_stepPosition = stepPosition; }
 
 private:
-    StepsTimingFunction(int steps, bool stepAtStart)
+    StepsTimingFunction(int steps, Optional<StepPosition> stepPosition)
         : TimingFunction(StepsFunction)
         , m_steps(steps)
-        , m_stepAtStart(stepAtStart)
+        , m_stepPosition(stepPosition)
     {
     }
 
     Ref<TimingFunction> clone() const final
     {
-        return adoptRef(*new StepsTimingFunction(m_steps, m_stepAtStart));
+        return adoptRef(*new StepsTimingFunction(m_steps, m_stepPosition));
     }
     
     int m_steps;
-    bool m_stepAtStart;
+    Optional<StepPosition> m_stepPosition;
 };
 
 class SpringTimingFunction final : public TimingFunction {
@@ -301,3 +310,19 @@
 SPECIALIZE_TYPE_TRAITS_TIMINGFUNCTION(WebCore::CubicBezierTimingFunction, isCubicBezierTimingFunction())
 SPECIALIZE_TYPE_TRAITS_TIMINGFUNCTION(WebCore::StepsTimingFunction, isStepsTimingFunction())
 SPECIALIZE_TYPE_TRAITS_TIMINGFUNCTION(WebCore::SpringTimingFunction, isSpringTimingFunction())
+
+namespace WTF {
+
+template<> struct EnumTraits<WebCore::StepsTimingFunction::StepPosition> {
+    using values = EnumValues<
+        WebCore::StepsTimingFunction::StepPosition,
+        WebCore::StepsTimingFunction::StepPosition::JumpStart,
+        WebCore::StepsTimingFunction::StepPosition::JumpEnd,
+        WebCore::StepsTimingFunction::StepPosition::JumpNone,
+        WebCore::StepsTimingFunction::StepPosition::JumpBoth,
+        WebCore::StepsTimingFunction::StepPosition::Start,
+        WebCore::StepsTimingFunction::StepPosition::End
+    >;
+};
+
+} // namespace WTF

Modified: trunk/Source/WebInspectorUI/ChangeLog (261045 => 261046)


--- trunk/Source/WebInspectorUI/ChangeLog	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/Source/WebInspectorUI/ChangeLog	2020-05-02 09:34:30 UTC (rev 261046)
@@ -1,3 +1,14 @@
+2020-05-02  Devin Rousso  <[email protected]>
+
+        [CSS Easing 1] implement `jump-*` step positions
+        https://bugs.webkit.org/show_bug.cgi?id=211271
+
+        Reviewed by Dean Jackson.
+
+        * UserInterface/Models/CSSKeywordCompletions.js:
+        (WI.CSSKeywordCompletions.forFunction):
+        Include the step position keywords when autocompleting the `steps()` CSS function.
+
 2020-04-30  Nikita Vasilyev  <[email protected]>
 
         Web Inspector: Computed: shouldn't display focus outline on click

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js (261045 => 261046)


--- trunk/Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/CSSKeywordCompletions.js	2020-05-02 09:34:30 UTC (rev 261046)
@@ -114,6 +114,8 @@
         suggestions.push("url()");
     else if (functionName === "repeat")
         suggestions.push("auto", "auto-fill", "auto-fit", "min-content", "max-content");
+    else if (functionName === "steps")
+        suggestions.push("jump-none", "jump-start", "jump-end", "jump-both", "start", "end");
     else if (functionName.endsWith("gradient")) {
         suggestions.push("to", "left", "right", "top", "bottom");
         suggestions.pushAll(WI.CSSKeywordCompletions._colors);

Modified: trunk/Source/WebKit/ChangeLog (261045 => 261046)


--- trunk/Source/WebKit/ChangeLog	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/Source/WebKit/ChangeLog	2020-05-02 09:34:30 UTC (rev 261046)
@@ -1,3 +1,14 @@
+2020-05-02  Devin Rousso  <[email protected]>
+
+        [CSS Easing 1] implement `jump-*` step positions
+        https://bugs.webkit.org/show_bug.cgi?id=211271
+
+        Reviewed by Dean Jackson.
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (IPC::ArgumentCoder<StepsTimingFunction>::encode):
+        (IPC::ArgumentCoder<StepsTimingFunction>::decode):
+
 2020-05-01  Tim Horton  <[email protected]>
 
         Books sometimes ends up with blank pages, especially after adjusting font size

Modified: trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp (261045 => 261046)


--- trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp	2020-05-02 08:32:06 UTC (rev 261045)
+++ trunk/Source/WebKit/Shared/WebCoreArgumentCoders.cpp	2020-05-02 09:34:30 UTC (rev 261046)
@@ -546,7 +546,7 @@
     encoder.encodeEnum(timingFunction.type());
     
     encoder << timingFunction.numberOfSteps();
-    encoder << timingFunction.stepAtStart();
+    encoder << timingFunction.stepPosition();
 }
 
 bool ArgumentCoder<StepsTimingFunction>::decode(Decoder& decoder, StepsTimingFunction& timingFunction)
@@ -556,12 +556,12 @@
     if (!decoder.decode(numSteps))
         return false;
 
-    bool stepAtStart;
-    if (!decoder.decode(stepAtStart))
+    Optional<StepsTimingFunction::StepPosition> stepPosition;
+    if (!decoder.decode(stepPosition))
         return false;
 
     timingFunction.setNumberOfSteps(numSteps);
-    timingFunction.setStepAtStart(stepAtStart);
+    timingFunction.setStepPosition(stepPosition);
 
     return true;
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to