Title: [287678] trunk
Revision
287678
Author
[email protected]
Date
2022-01-06 02:46:20 -0800 (Thu, 06 Jan 2022)

Log Message

computed style for transition longhand properties is wrong
https://bugs.webkit.org/show_bug.cgi?id=234880

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Mark WPT progressions.

* web-platform-tests/css/css-transitions/parsing/transition-delay-computed-expected.txt:
* web-platform-tests/css/css-transitions/parsing/transition-duration-computed-expected.txt:
* web-platform-tests/css/css-transitions/parsing/transition-property-computed-expected.txt:
* web-platform-tests/css/css-transitions/parsing/transition-timing-function-computed-expected.txt:
* web-platform-tests/css/css-transitions/transition-delay-001-expected.txt:
* web-platform-tests/css/css-transitions/transition-duration-001-expected.txt:

Source/WebCore:

We had two issues in the way we treated animation lists.

First, we would always output the filled-in values in the computed style, which
meant that setting `animation-name: one, two; animation-duration: 1s` would yield
`1s, 1s` instead of just `1s` for animation-duration. So we now maintain a bit
on Animation to indicate whether a given value was set for filling and
ComputedStyleExtractor::addValueForAnimationPropertyToList() can now query it
before adding this value when returning the computed style.

Second, in RenderStyle::adjustTransitions(), we would mistakenly try to remove entries
if we found a transition-property repeated. However, this is valid so we remove the
code related to this entirely.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::addValueForAnimationPropertyToList):
* platform/animation/Animation.cpp:
(WebCore::Animation::Animation):
* platform/animation/Animation.h:
(WebCore::Animation::clearDelay):
(WebCore::Animation::clearDirection):
(WebCore::Animation::clearDuration):
(WebCore::Animation::clearFillMode):
(WebCore::Animation::clearIterationCount):
(WebCore::Animation::clearPlayState):
(WebCore::Animation::clearProperty):
(WebCore::Animation::clearTimingFunction):
(WebCore::Animation::fillDelay):
(WebCore::Animation::fillDirection):
(WebCore::Animation::fillDuration):
(WebCore::Animation::fillFillMode):
(WebCore::Animation::fillIterationCount):
(WebCore::Animation::fillPlayState):
(WebCore::Animation::fillProperty):
(WebCore::Animation::fillTimingFunction):
(WebCore::Animation::isDelayFilled const):
(WebCore::Animation::isDirectionFilled const):
(WebCore::Animation::isDurationFilled const):
(WebCore::Animation::isFillModeFilled const):
(WebCore::Animation::isIterationCountFilled const):
(WebCore::Animation::isPlayStateFilled const):
(WebCore::Animation::isPropertyFilled const):
(WebCore::Animation::isTimingFunctionFilled const):
* platform/animation/AnimationList.cpp:
(WebCore::AnimationList::fillUnsetProperties):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::adjustTransitions):

LayoutTests:

This test was incorrect since it assumed that filled-in values in animation lists
would be part of the computed style. We update the expectation and add other properties
that weren't being tested.

* animations/fill-unset-properties-expected.txt:
* animations/fill-unset-properties.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (287677 => 287678)


--- trunk/LayoutTests/ChangeLog	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/LayoutTests/ChangeLog	2022-01-06 10:46:20 UTC (rev 287678)
@@ -1,3 +1,17 @@
+2022-01-05  Antoine Quint  <[email protected]>
+
+        computed style for transition longhand properties is wrong
+        https://bugs.webkit.org/show_bug.cgi?id=234880
+
+        Reviewed by Antti Koivisto.
+
+        This test was incorrect since it assumed that filled-in values in animation lists
+        would be part of the computed style. We update the expectation and add other properties
+        that weren't being tested.
+
+        * animations/fill-unset-properties-expected.txt:
+        * animations/fill-unset-properties.html:
+
 2022-01-06  Youenn Fablet  <[email protected]>
 
         "ReadableStream uploading is not supported" when fetch()ing a Request that has been logged to console

Modified: trunk/LayoutTests/animations/fill-unset-properties-expected.txt (287677 => 287678)


--- trunk/LayoutTests/animations/fill-unset-properties-expected.txt	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/LayoutTests/animations/fill-unset-properties-expected.txt	2022-01-06 10:46:20 UTC (rev 287678)
@@ -1,9 +1,13 @@
-Testing webkitTransitionDuration: PASS
-Testing webkitTransitionProperty: PASS
-Testing webkitTransitionDelay: PASS
-Testing webkitTransitionTimingFunction: PASS
-Testing webkitAnimationName: PASS
-Testing webkitAnimationDuration: PASS
-Testing webkitAnimationDelay: PASS
-Testing webkitAnimationFillMode: PASS
+Testing transitionDuration: PASS
+Testing transitionProperty: PASS
+Testing transitionDelay: PASS
+Testing transitionTimingFunction: PASS
+Testing animationName: PASS
+Testing animationDuration: PASS
+Testing animationDelay: PASS
+Testing animationDirection: PASS
+Testing animationFillMode: PASS
+Testing animationPlayState: PASS
+Testing animationIterationCount: PASS
+Testing animationTimingFunction: PASS
 

Modified: trunk/LayoutTests/animations/fill-unset-properties.html (287677 => 287678)


--- trunk/LayoutTests/animations/fill-unset-properties.html	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/LayoutTests/animations/fill-unset-properties.html	2022-01-06 10:46:20 UTC (rev 287678)
@@ -6,20 +6,26 @@
     height: 50px;
     width: 200px;
     background-color: blue;
-    -webkit-transition-duration: 1s,2s;
-    -webkit-transition-property: opacity, left, opacity, top, width, opacity, height, opacity;
-    -webkit-transition-delay: 3s,4s,5s;
-    -webkit-transition-timing-function: linear;
-    -webkit-animation-name: a, b, c, d, e;
-    -webkit-animation-duration: 10s, 20s;
-    -webkit-animation-delay: 1s;
-    -webkit-animation-fill-mode: forwards, backwards;
+
+    transition-property: opacity, left, opacity, top, width, opacity, height, opacity;
+    transition-duration: 1s,2s;
+    transition-delay: 3s,4s,5s;
+    transition-timing-function: linear;
+    
+    animation-name: a, b, c, d, e;
+    animation-duration: 10s, 20s;
+    animation-delay: 1s;
+    animation-direction: normal, alternate, reverse, alternate-reverse;
+    animation-fill-mode: forwards, backwards;
+    animation-play-state: running, paused, running;
+    animation-iteration-count: 1, 2, 3;
+    animation-timing-function: linear;
 }
-@-webkit-keyframes a { }
-@-webkit-keyframes b { }
-@-webkit-keyframes c { }
-@-webkit-keyframes d { }
-@-webkit-keyframes e { }
+@keyframes a { }
+@keyframes b { }
+@keyframes c { }
+@keyframes d { }
+@keyframes e { }
 </style>
   <script type="text/_javascript_" charset="utf-8">
     if (window.testRunner)
@@ -26,14 +32,18 @@
         testRunner.dumpAsText();
   
     const kExpectedResults = [
-      { 'property': 'webkitTransitionDuration', 'value': '2s, 2s, 1s, 1s, 2s' },
-      { 'property': 'webkitTransitionProperty', 'value': 'left, top, width, height, opacity' },
-      { 'property': 'webkitTransitionDelay',    'value': '4s, 3s, 4s, 3s, 4s' },
-      { 'property': 'webkitTransitionTimingFunction', 'value': 'linear, linear, linear, linear, linear' },
-      { 'property': 'webkitAnimationName',      'value': 'a, b, c, d, e' },
-      { 'property': 'webkitAnimationDuration',  'value': '10s, 20s, 10s, 20s, 10s' },
-      { 'property': 'webkitAnimationDelay',     'value': '1s, 1s, 1s, 1s, 1s' },
-      { 'property': 'webkitAnimationFillMode',  'value': 'forwards, backwards, forwards, backwards, forwards' },
+      { 'property': 'transitionDuration', 'value': '1s, 2s' },
+      { 'property': 'transitionProperty', 'value': 'opacity, left, opacity, top, width, opacity, height, opacity' },
+      { 'property': 'transitionDelay',    'value': '3s, 4s, 5s' },
+      { 'property': 'transitionTimingFunction', 'value': 'linear' },
+      { 'property': 'animationName',      'value': 'a, b, c, d, e' },
+      { 'property': 'animationDuration',  'value': '10s, 20s' },
+      { 'property': 'animationDelay',     'value': '1s' },
+      { 'property': 'animationDirection', 'value': 'normal, alternate, reverse, alternate-reverse' },
+      { 'property': 'animationFillMode',  'value': 'forwards, backwards' },
+      { 'property': 'animationPlayState', 'value': 'running, paused, running' },
+      { 'property': 'animationIterationCount', 'value': '1, 2, 3' },
+      { 'property': 'animationTimingFunction', 'value': 'linear' }
     ];
     
     function start()

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (287677 => 287678)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-06 10:46:20 UTC (rev 287678)
@@ -1,5 +1,21 @@
 2022-01-05  Antoine Quint  <[email protected]>
 
+        computed style for transition longhand properties is wrong
+        https://bugs.webkit.org/show_bug.cgi?id=234880
+
+        Reviewed by Antti Koivisto.
+
+        Mark WPT progressions.
+
+        * web-platform-tests/css/css-transitions/parsing/transition-delay-computed-expected.txt:
+        * web-platform-tests/css/css-transitions/parsing/transition-duration-computed-expected.txt:
+        * web-platform-tests/css/css-transitions/parsing/transition-property-computed-expected.txt:
+        * web-platform-tests/css/css-transitions/parsing/transition-timing-function-computed-expected.txt:
+        * web-platform-tests/css/css-transitions/transition-delay-001-expected.txt:
+        * web-platform-tests/css/css-transitions/transition-duration-001-expected.txt:
+
+2022-01-05  Antoine Quint  <[email protected]>
+
         Refactor computed style code for transition-property and the transition shorthand
         https://bugs.webkit.org/show_bug.cgi?id=234872
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-delay-computed-expected.txt (287677 => 287678)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-delay-computed-expected.txt	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-delay-computed-expected.txt	2022-01-06 10:46:20 UTC (rev 287678)
@@ -1,3 +1,3 @@
 
-FAIL Property transition-delay value '-500ms, calc(2 * 3s)' assert_equals: expected "-0.5s, 6s" but got "6s"
+PASS Property transition-delay value '-500ms, calc(2 * 3s)'
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-duration-computed-expected.txt (287677 => 287678)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-duration-computed-expected.txt	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-duration-computed-expected.txt	2022-01-06 10:46:20 UTC (rev 287678)
@@ -1,5 +1,5 @@
 
 PASS Property transition-duration value '500ms'
 PASS Property transition-duration value 'calc(2 * 3s)'
-FAIL Property transition-duration value '20s, 10s' assert_equals: expected "20s, 10s" but got "10s"
+PASS Property transition-duration value '20s, 10s'
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-property-computed-expected.txt (287677 => 287678)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-property-computed-expected.txt	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-property-computed-expected.txt	2022-01-06 10:46:20 UTC (rev 287678)
@@ -1,4 +1,4 @@
 
 PASS Property transition-property value 'left, top, right, bottom'
-FAIL Property transition-property value 'one, two, three' assert_equals: expected "one, two, three" but got "three"
+PASS Property transition-property value 'one, two, three'
 

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


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-timing-function-computed-expected.txt	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/parsing/transition-timing-function-computed-expected.txt	2022-01-06 10:46:20 UTC (rev 287678)
@@ -16,5 +16,5 @@
 PASS Property transition-timing-function value 'steps(2, jump-end)'
 PASS Property transition-timing-function value 'steps(2, jump-both)'
 PASS Property transition-timing-function value 'steps(2, jump-none)'
-FAIL Property transition-timing-function value 'linear, ease, linear' assert_equals: expected "linear, ease, linear" but got "linear"
+PASS Property transition-timing-function value 'linear, ease, linear'
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/transition-delay-001-expected.txt (287677 => 287678)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/transition-delay-001-expected.txt	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/transition-delay-001-expected.txt	2022-01-06 10:46:20 UTC (rev 287678)
@@ -18,6 +18,6 @@
 PASS parse '1ms'
 PASS parse '0ms'
 PASS parse '-500ms'
-FAIL parse '1s, 0.1s, 10ms' assert_equals: Expected computed value expected "1s, 0.1s, 0.01s" but got "0.01s"
+PASS parse '1s, 0.1s, 10ms'
 PASS parse 'foobar'
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/transition-duration-001-expected.txt (287677 => 287678)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/transition-duration-001-expected.txt	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/transition-duration-001-expected.txt	2022-01-06 10:46:20 UTC (rev 287678)
@@ -18,6 +18,6 @@
 PASS parse '1ms'
 PASS parse '0ms'
 PASS parse '-500ms'
-FAIL parse '1s, 0.1s, 10ms' assert_equals: Expected computed value expected "1s, 0.1s, 0.01s" but got "0.01s"
+PASS parse '1s, 0.1s, 10ms'
 PASS parse 'foobar'
 

Modified: trunk/Source/WebCore/ChangeLog (287677 => 287678)


--- trunk/Source/WebCore/ChangeLog	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/Source/WebCore/ChangeLog	2022-01-06 10:46:20 UTC (rev 287678)
@@ -1,3 +1,57 @@
+2022-01-05  Antoine Quint  <[email protected]>
+
+        computed style for transition longhand properties is wrong
+        https://bugs.webkit.org/show_bug.cgi?id=234880
+
+        Reviewed by Antti Koivisto.
+
+        We had two issues in the way we treated animation lists.
+
+        First, we would always output the filled-in values in the computed style, which
+        meant that setting `animation-name: one, two; animation-duration: 1s` would yield
+        `1s, 1s` instead of just `1s` for animation-duration. So we now maintain a bit
+        on Animation to indicate whether a given value was set for filling and
+        ComputedStyleExtractor::addValueForAnimationPropertyToList() can now query it
+        before adding this value when returning the computed style.
+
+        Second, in RenderStyle::adjustTransitions(), we would mistakenly try to remove entries
+        if we found a transition-property repeated. However, this is valid so we remove the
+        code related to this entirely.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::addValueForAnimationPropertyToList):
+        * platform/animation/Animation.cpp:
+        (WebCore::Animation::Animation):
+        * platform/animation/Animation.h:
+        (WebCore::Animation::clearDelay):
+        (WebCore::Animation::clearDirection):
+        (WebCore::Animation::clearDuration):
+        (WebCore::Animation::clearFillMode):
+        (WebCore::Animation::clearIterationCount):
+        (WebCore::Animation::clearPlayState):
+        (WebCore::Animation::clearProperty):
+        (WebCore::Animation::clearTimingFunction):
+        (WebCore::Animation::fillDelay):
+        (WebCore::Animation::fillDirection):
+        (WebCore::Animation::fillDuration):
+        (WebCore::Animation::fillFillMode):
+        (WebCore::Animation::fillIterationCount):
+        (WebCore::Animation::fillPlayState):
+        (WebCore::Animation::fillProperty):
+        (WebCore::Animation::fillTimingFunction):
+        (WebCore::Animation::isDelayFilled const):
+        (WebCore::Animation::isDirectionFilled const):
+        (WebCore::Animation::isDurationFilled const):
+        (WebCore::Animation::isFillModeFilled const):
+        (WebCore::Animation::isIterationCountFilled const):
+        (WebCore::Animation::isPlayStateFilled const):
+        (WebCore::Animation::isPropertyFilled const):
+        (WebCore::Animation::isTimingFunctionFilled const):
+        * platform/animation/AnimationList.cpp:
+        (WebCore::AnimationList::fillUnsetProperties):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::adjustTransitions):
+
 2022-01-05  Nikolas Zimmermann  <[email protected]>
 
         [LBSE] Rename RenderSVGShape -> LegacyRenderSVGShape

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (287677 => 287678)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2022-01-06 10:46:20 UTC (rev 287678)
@@ -1434,29 +1434,37 @@
 
 void ComputedStyleExtractor::addValueForAnimationPropertyToList(CSSValueList& list, CSSPropertyID property, const Animation* animation)
 {
-    if (property == CSSPropertyAnimationDuration || property == CSSPropertyTransitionDuration)
-        list.append(valueForAnimationDuration(animation ? animation->duration() : Animation::initialDuration()));
-    else if (property == CSSPropertyAnimationDelay || property == CSSPropertyTransitionDelay)
-        list.append(valueForAnimationDelay(animation ? animation->delay() : Animation::initialDelay()));
-    else if (property == CSSPropertyAnimationIterationCount)
-        list.append(valueForAnimationIterationCount(animation ? animation->iterationCount() : Animation::initialIterationCount()));
-    else if (property == CSSPropertyAnimationDirection)
-        list.append(valueForAnimationDirection(animation ? animation->direction() : Animation::initialDirection()));
-    else if (property == CSSPropertyAnimationFillMode)
-        list.append(valueForAnimationFillMode(animation ? animation->fillMode() : Animation::initialFillMode()));
-    else if (property == CSSPropertyAnimationPlayState)
-        list.append(valueForAnimationPlayState(animation ? animation->playState() : Animation::initialPlayState()));
-    else if (property == CSSPropertyAnimationName)
+    if (property == CSSPropertyAnimationDuration || property == CSSPropertyTransitionDuration) {
+        if (!animation || !animation->isDurationFilled())
+            list.append(valueForAnimationDuration(animation ? animation->duration() : Animation::initialDuration()));
+    } else if (property == CSSPropertyAnimationDelay || property == CSSPropertyTransitionDelay) {
+        if (!animation || !animation->isDelayFilled())
+            list.append(valueForAnimationDelay(animation ? animation->delay() : Animation::initialDelay()));
+    } else if (property == CSSPropertyAnimationIterationCount) {
+        if (!animation || !animation->isIterationCountFilled())
+            list.append(valueForAnimationIterationCount(animation ? animation->iterationCount() : Animation::initialIterationCount()));
+    } else if (property == CSSPropertyAnimationDirection) {
+        if (!animation || !animation->isDirectionFilled())
+            list.append(valueForAnimationDirection(animation ? animation->direction() : Animation::initialDirection()));
+    } else if (property == CSSPropertyAnimationFillMode) {
+        if (!animation || !animation->isFillModeFilled())
+            list.append(valueForAnimationFillMode(animation ? animation->fillMode() : Animation::initialFillMode()));
+    } else if (property == CSSPropertyAnimationPlayState) {
+        if (!animation || !animation->isPlayStateFilled())
+            list.append(valueForAnimationPlayState(animation ? animation->playState() : Animation::initialPlayState()));
+    } else if (property == CSSPropertyAnimationName)
         list.append(valueForAnimationName(animation ? animation->name() : Animation::initialName()));
     else if (property == CSSPropertyTransitionProperty) {
-        if (animation)
-            list.append(createTransitionPropertyValue(*animation));
-        else
+        if (animation) {
+            if (!animation->isPropertyFilled())
+                list.append(createTransitionPropertyValue(*animation));
+        } else
             list.append(CSSValuePool::singleton().createIdentifierValue(CSSValueAll));
     } else if (property == CSSPropertyAnimationTimingFunction || property == CSSPropertyTransitionTimingFunction) {
-        if (animation)
-            list.append(valueForAnimationTimingFunction(*animation->timingFunction()));
-        else
+        if (animation) {
+            if (!animation->isTimingFunctionFilled())
+                list.append(valueForAnimationTimingFunction(*animation->timingFunction()));
+        } else
             list.append(valueForAnimationTimingFunction(CubicBezierTimingFunction::defaultTimingFunction()));
     } else
         ASSERT_NOT_REACHED();

Modified: trunk/Source/WebCore/platform/animation/Animation.cpp (287677 => 287678)


--- trunk/Source/WebCore/platform/animation/Animation.cpp	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/Source/WebCore/platform/animation/Animation.cpp	2022-01-06 10:46:20 UTC (rev 287678)
@@ -48,6 +48,14 @@
     , m_timingFunctionSet(false)
     , m_compositeOperationSet(false)
     , m_isNone(false)
+    , m_delayFilled(false)
+    , m_directionFilled(false)
+    , m_durationFilled(false)
+    , m_fillModeFilled(false)
+    , m_iterationCountFilled(false)
+    , m_playStateFilled(false)
+    , m_propertyFilled(false)
+    , m_timingFunctionFilled(false)
 {
 }
 
@@ -75,6 +83,14 @@
     , m_timingFunctionSet(o.m_timingFunctionSet)
     , m_compositeOperationSet(o.m_compositeOperationSet)
     , m_isNone(o.m_isNone)
+    , m_delayFilled(o.m_delayFilled)
+    , m_directionFilled(o.m_directionFilled)
+    , m_durationFilled(o.m_durationFilled)
+    , m_fillModeFilled(o.m_fillModeFilled)
+    , m_iterationCountFilled(o.m_iterationCountFilled)
+    , m_playStateFilled(o.m_playStateFilled)
+    , m_propertyFilled(o.m_propertyFilled)
+    , m_timingFunctionFilled(o.m_timingFunctionFilled)
 {
 }
 

Modified: trunk/Source/WebCore/platform/animation/Animation.h (287677 => 287678)


--- trunk/Source/WebCore/platform/animation/Animation.h	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/Source/WebCore/platform/animation/Animation.h	2022-01-06 10:46:20 UTC (rev 287678)
@@ -70,15 +70,15 @@
         return isEmpty() || (m_duration == 0 && m_delay <= 0);
     }
 
-    void clearDelay() { m_delaySet = false; }
-    void clearDirection() { m_directionSet = false; }
-    void clearDuration() { m_durationSet = false; }
-    void clearFillMode() { m_fillModeSet = false; }
-    void clearIterationCount() { m_iterationCountSet = false; }
+    void clearDelay() { m_delaySet = false; m_delayFilled = false; }
+    void clearDirection() { m_directionSet = false; m_directionFilled = false; }
+    void clearDuration() { m_durationSet = false; m_durationFilled = false; }
+    void clearFillMode() { m_fillModeSet = false; m_fillModeFilled = false; }
+    void clearIterationCount() { m_iterationCountSet = false; m_iterationCountFilled = false; }
     void clearName() { m_nameSet = false; }
-    void clearPlayState() { m_playStateSet = false; }
-    void clearProperty() { m_propertySet = false; }
-    void clearTimingFunction() { m_timingFunctionSet = false; }
+    void clearPlayState() { m_playStateSet = false; m_playStateFilled = false; }
+    void clearProperty() { m_propertySet = false; m_propertyFilled = false; }
+    void clearTimingFunction() { m_timingFunctionSet = false; m_timingFunctionFilled = false; }
     void clearCompositeOperation() { m_compositeOperationSet = false; }
 
     void clearAll()
@@ -159,6 +159,24 @@
 
     void setIsNoneAnimation(bool n) { m_isNone = n; }
 
+    void fillDelay(double delay) { setDelay(delay); m_delayFilled = true; }
+    void fillDirection(AnimationDirection direction) { setDirection(direction); m_directionFilled = true; }
+    void fillDuration(double duration) { setDuration(duration); m_durationFilled = true; }
+    void fillFillMode(AnimationFillMode fillMode) { setFillMode(fillMode); m_fillModeFilled = true; }
+    void fillIterationCount(double iterationCount) { setIterationCount(iterationCount); m_iterationCountFilled = true; }
+    void fillPlayState(AnimationPlayState playState) { setPlayState(playState); m_playStateFilled = true; }
+    void fillProperty(TransitionProperty property) { setProperty(property); m_propertyFilled = true; }
+    void fillTimingFunction(RefPtr<TimingFunction>&& timingFunction) { setTimingFunction(WTFMove(timingFunction)); m_timingFunctionFilled = true; }
+
+    bool isDelayFilled() const { return m_delayFilled; }
+    bool isDirectionFilled() const { return m_directionFilled; }
+    bool isDurationFilled() const { return m_durationFilled; }
+    bool isFillModeFilled() const { return m_fillModeFilled; }
+    bool isIterationCountFilled() const { return m_iterationCountFilled; }
+    bool isPlayStateFilled() const { return m_playStateFilled; }
+    bool isPropertyFilled() const { return m_propertyFilled; }
+    bool isTimingFunctionFilled() const { return m_timingFunctionFilled; }
+
     Animation& operator=(const Animation&);
 
     // return true if all members of this class match (excluding m_next)
@@ -210,6 +228,15 @@
 
     bool m_isNone : 1;
 
+    bool m_delayFilled : 1;
+    bool m_directionFilled : 1;
+    bool m_durationFilled : 1;
+    bool m_fillModeFilled : 1;
+    bool m_iterationCountFilled : 1;
+    bool m_playStateFilled : 1;
+    bool m_propertyFilled : 1;
+    bool m_timingFunctionFilled : 1;
+
 public:
     static double initialDelay() { return 0; }
     static AnimationDirection initialDirection() { return AnimationDirectionNormal; }

Modified: trunk/Source/WebCore/platform/animation/AnimationList.cpp (287677 => 287678)


--- trunk/Source/WebCore/platform/animation/AnimationList.cpp	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/Source/WebCore/platform/animation/AnimationList.cpp	2022-01-06 10:46:20 UTC (rev 287678)
@@ -50,14 +50,14 @@
 void AnimationList::fillUnsetProperties()
 {
     size_t i;
-    FILL_UNSET_PROPERTY(isDelaySet, delay, setDelay);
-    FILL_UNSET_PROPERTY(isDirectionSet, direction, setDirection);
-    FILL_UNSET_PROPERTY(isDurationSet, duration, setDuration);
-    FILL_UNSET_PROPERTY(isFillModeSet, fillMode, setFillMode);
-    FILL_UNSET_PROPERTY(isIterationCountSet, iterationCount, setIterationCount);
-    FILL_UNSET_PROPERTY(isPlayStateSet, playState, setPlayState);
-    FILL_UNSET_PROPERTY(isTimingFunctionSet, timingFunction, setTimingFunction);
-    FILL_UNSET_PROPERTY(isPropertySet, property, setProperty);
+    FILL_UNSET_PROPERTY(isDelaySet, delay, fillDelay);
+    FILL_UNSET_PROPERTY(isDirectionSet, direction, fillDirection);
+    FILL_UNSET_PROPERTY(isDurationSet, duration, fillDuration);
+    FILL_UNSET_PROPERTY(isFillModeSet, fillMode, fillFillMode);
+    FILL_UNSET_PROPERTY(isIterationCountSet, iterationCount, fillIterationCount);
+    FILL_UNSET_PROPERTY(isPlayStateSet, playState, fillPlayState);
+    FILL_UNSET_PROPERTY(isTimingFunctionSet, timingFunction, fillTimingFunction);
+    FILL_UNSET_PROPERTY(isPropertySet, property, fillProperty);
 }
 
 bool AnimationList::operator==(const AnimationList& other) const

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.cpp (287677 => 287678)


--- trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2022-01-06 10:29:36 UTC (rev 287677)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.cpp	2022-01-06 10:46:20 UTC (rev 287678)
@@ -1778,18 +1778,6 @@
 
     // Repeat patterns into layers that don't have some properties set.
     transitionList->fillUnsetProperties();
-
-    // Make sure there are no duplicate properties.
-    // This is an O(n^2) algorithm but the lists tend to be short, so it is probably OK.
-    for (size_t i = 0; i < transitionList->size(); ++i) {
-        for (size_t j = i + 1; j < transitionList->size(); ++j) {
-            if (transitionList->animation(i).property().id == transitionList->animation(j).property().id) {
-                // toss i
-                transitionList->remove(i);
-                j = i;
-            }
-        }
-    }
 }
 
 AnimationList& RenderStyle::ensureAnimations()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to