Title: [287517] trunk
Revision
287517
Author
[email protected]
Date
2022-01-02 08:12:37 -0800 (Sun, 02 Jan 2022)

Log Message

[Web Animations] getKeyframes() should return an empty object when there are no animatable properties in @keyframes rule
https://bugs.webkit.org/show_bug.cgi?id=234793

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark a new WPT progression.

* web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt:

Source/WebCore:

If the keyframes for an animation result from a declarative source, let's not output any data if none of the properties
are animatable.

* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::getKeyframes):
* rendering/style/KeyframeList.cpp:
(WebCore::KeyframeList::containsAnimatableProperty const):
* rendering/style/KeyframeList.h:

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (287516 => 287517)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-02 15:38:03 UTC (rev 287516)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-02 16:12:37 UTC (rev 287517)
@@ -1,3 +1,14 @@
+2022-01-02  Antoine Quint  <[email protected]>
+
+        [Web Animations] getKeyframes() should return an empty object when there are no animatable properties in @keyframes rule
+        https://bugs.webkit.org/show_bug.cgi?id=234793
+
+        Reviewed by Dean Jackson.
+
+        Mark a new WPT progression.
+
+        * web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt:
+
 2022-01-01  Antoine Quint  <[email protected]>
 
         "animation" shorthand does not parse values in the right order

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt (287516 => 287517)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt	2022-01-02 15:38:03 UTC (rev 287516)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-animations/KeyframeEffect-getKeyframes.tentative-expected.txt	2022-01-02 16:12:37 UTC (rev 287517)
@@ -1,5 +1,5 @@
 
-FAIL KeyframeEffect.getKeyframes() returns no frames for various kinds of empty enimations assert_equals: number of frames when @keyframes has empty keyframes expected 0 but got 2
+PASS KeyframeEffect.getKeyframes() returns no frames for various kinds of empty enimations
 PASS KeyframeEffect.getKeyframes() returns expected frames for a simple animation
 PASS KeyframeEffect.getKeyframes() returns frames with expected easing values, when the easing comes from animation-timing-function on the element
 PASS KeyframeEffect.getKeyframes() returns frames with expected easing values, when the easing is specified on each keyframe

Modified: trunk/Source/WebCore/ChangeLog (287516 => 287517)


--- trunk/Source/WebCore/ChangeLog	2022-01-02 15:38:03 UTC (rev 287516)
+++ trunk/Source/WebCore/ChangeLog	2022-01-02 16:12:37 UTC (rev 287517)
@@ -1,3 +1,19 @@
+2022-01-02  Antoine Quint  <[email protected]>
+
+        [Web Animations] getKeyframes() should return an empty object when there are no animatable properties in @keyframes rule
+        https://bugs.webkit.org/show_bug.cgi?id=234793
+
+        Reviewed by Dean Jackson.
+
+        If the keyframes for an animation result from a declarative source, let's not output any data if none of the properties
+        are animatable.
+
+        * animation/KeyframeEffect.cpp:
+        (WebCore::KeyframeEffect::getKeyframes):
+        * rendering/style/KeyframeList.cpp:
+        (WebCore::KeyframeList::containsAnimatableProperty const):
+        * rendering/style/KeyframeList.h:
+
 2022-01-02  Alan Bujtas  <[email protected]>
 
         InlineTextItems should never split inside surrogate pairs

Modified: trunk/Source/WebCore/animation/KeyframeEffect.cpp (287516 => 287517)


--- trunk/Source/WebCore/animation/KeyframeEffect.cpp	2022-01-02 15:38:03 UTC (rev 287516)
+++ trunk/Source/WebCore/animation/KeyframeEffect.cpp	2022-01-02 16:12:37 UTC (rev 287517)
@@ -632,7 +632,7 @@
     // 2. Let keyframes be the result of applying the procedure to compute missing keyframe offsets to the keyframes for this keyframe effect.
 
     // 3. For each keyframe in keyframes perform the following steps:
-    if (m_parsedKeyframes.isEmpty() && m_blendingKeyframesSource != BlendingKeyframesSource::WebAnimation) {
+    if (m_parsedKeyframes.isEmpty() && m_blendingKeyframesSource != BlendingKeyframesSource::WebAnimation && m_blendingKeyframes.containsAnimatableProperty()) {
         auto* target = m_target.get();
         auto* renderer = this->renderer();
 

Modified: trunk/Source/WebCore/rendering/style/KeyframeList.cpp (287516 => 287517)


--- trunk/Source/WebCore/rendering/style/KeyframeList.cpp	2022-01-02 15:38:03 UTC (rev 287516)
+++ trunk/Source/WebCore/rendering/style/KeyframeList.cpp	2022-01-02 16:12:37 UTC (rev 287517)
@@ -24,6 +24,7 @@
 
 #include "Animation.h"
 #include "CSSKeyframeRule.h"
+#include "CSSPropertyAnimation.h"
 #include "RenderObject.h"
 #include "StyleResolver.h"
 
@@ -131,4 +132,13 @@
     }
 }
 
+bool KeyframeList::containsAnimatableProperty() const
+{
+    for (auto cssPropertyId : m_properties) {
+        if (CSSPropertyAnimation::isPropertyAnimatable(cssPropertyId))
+            return true;
+    }
+    return false;
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/rendering/style/KeyframeList.h (287516 => 287517)


--- trunk/Source/WebCore/rendering/style/KeyframeList.h	2022-01-02 15:38:03 UTC (rev 287516)
+++ trunk/Source/WebCore/rendering/style/KeyframeList.h	2022-01-02 16:12:37 UTC (rev 287517)
@@ -91,7 +91,8 @@
     void addProperty(CSSPropertyID prop) { m_properties.add(prop); }
     bool containsProperty(CSSPropertyID prop) const { return m_properties.contains(prop); }
     const HashSet<CSSPropertyID>& properties() const { return m_properties; }
-    
+    bool containsAnimatableProperty() const;
+
     void clear();
     bool isEmpty() const { return m_keyframes.isEmpty(); }
     size_t size() const { return m_keyframes.size(); }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to