Title: [290598] trunk
Revision
290598
Author
grao...@webkit.org
Date
2022-02-28 09:10:30 -0800 (Mon, 28 Feb 2022)

Log Message

[web-animations] web-animations/interfaces/Animatable/getAnimations.html is a unique failure
https://bugs.webkit.org/show_bug.cgi?id=237271

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

* web-platform-tests/web-animations/interfaces/Animatable/getAnimations-expected.txt:

Source/WebCore:

Our computation for the relevant state did not account for the playback rate. We rewrite
the function to match the spec exactly.

* animation/WebAnimation.cpp:
(WebCore::WebAnimation::computeRelevance):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (290597 => 290598)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-28 16:32:36 UTC (rev 290597)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-28 17:10:30 UTC (rev 290598)
@@ -1,5 +1,14 @@
 2022-02-28  Antoine Quint  <grao...@webkit.org>
 
+        [web-animations] web-animations/interfaces/Animatable/getAnimations.html is a unique failure
+        https://bugs.webkit.org/show_bug.cgi?id=237271
+
+        Reviewed by Dean Jackson.
+
+        * web-platform-tests/web-animations/interfaces/Animatable/getAnimations-expected.txt:
+
+2022-02-28  Antoine Quint  <grao...@webkit.org>
+
         [web-animations] web-animations/interfaces/KeyframeEffect/processing-a-keyframes-argument-001.html is a unique failure
         https://bugs.webkit.org/show_bug.cgi?id=237259
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/getAnimations-expected.txt (290597 => 290598)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/getAnimations-expected.txt	2022-02-28 16:32:36 UTC (rev 290597)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/getAnimations-expected.txt	2022-02-28 17:10:30 UTC (rev 290598)
@@ -10,10 +10,10 @@
 PASS Does not return finished animations that do not fill forwards
 PASS Returns finished animations that fill forwards
 PASS Returns animations yet to reach their active phase
-FAIL Does not return reversed finished animations that do not fill backwards assert_array_equals: lengths differ, expected array [] length 0, got [object "[object Animation]"] length 1
+PASS Does not return reversed finished animations that do not fill backwards
 PASS Returns reversed finished animations that fill backwards
-FAIL Returns reversed animations yet to reach their active phase assert_array_equals: lengths differ, expected array [object "[object Animation]"] length 1, got [] length 0
-FAIL Does not return animations with zero playback rate in before phase assert_array_equals: lengths differ, expected array [] length 0, got [object "[object Animation]"] length 1
+PASS Returns reversed animations yet to reach their active phase
+PASS Does not return animations with zero playback rate in before phase
 PASS Does not return animations with zero playback rate in after phase
 PASS Does not return an animation that has recently been made not current by setting the playback rate
 PASS Returns animations based on dynamic changes to individual animations' duration

Modified: trunk/Source/WebCore/ChangeLog (290597 => 290598)


--- trunk/Source/WebCore/ChangeLog	2022-02-28 16:32:36 UTC (rev 290597)
+++ trunk/Source/WebCore/ChangeLog	2022-02-28 17:10:30 UTC (rev 290598)
@@ -1,3 +1,16 @@
+2022-02-28  Antoine Quint  <grao...@webkit.org>
+
+        [web-animations] web-animations/interfaces/Animatable/getAnimations.html is a unique failure
+        https://bugs.webkit.org/show_bug.cgi?id=237271
+
+        Reviewed by Dean Jackson.
+
+        Our computation for the relevant state did not account for the playback rate. We rewrite
+        the function to match the spec exactly.
+
+        * animation/WebAnimation.cpp:
+        (WebCore::WebAnimation::computeRelevance):
+
 2022-02-28  Pascal Abresch  <n...@packageloss.eu>
 
         FTP EPLF does not handle directory

Modified: trunk/Source/WebCore/animation/WebAnimation.cpp (290597 => 290598)


--- trunk/Source/WebCore/animation/WebAnimation.cpp	2022-02-28 16:32:36 UTC (rev 290597)
+++ trunk/Source/WebCore/animation/WebAnimation.cpp	2022-02-28 17:10:30 UTC (rev 290598)
@@ -1348,27 +1348,39 @@
 
 bool WebAnimation::computeRelevance()
 {
-    // To be listed in getAnimations() an animation needs a target effect which is current or in effect.
+    // An animation is relevant if:
+    // - its associated effect is current or in effect, and
     if (!m_effect)
         return false;
 
+    // - its replace state is not removed.
     if (m_replaceState == ReplaceState::Removed)
         return false;
 
     auto timing = m_effect->getBasicTiming();
 
-    // An animation effect is in effect if its active time is not unresolved.
+    // An animation effect is in play if all of the following conditions are met:
+    // - the animation effect is in the active phase, and
+    // - the animation effect is associated with an animation that is not finished.
+    if (timing.phase == AnimationEffectPhase::Active && playState() != PlayState::Finished)
+        return true;
+
+    // An animation effect is current if any of the following conditions are true:
+    // - the animation effect is in play, or
+    // - the animation effect is associated with an animation with a playback rate > 0 and the animation effect is in the before phase, or
+    if (m_playbackRate > 0 && timing.phase == AnimationEffectPhase::Before)
+        return true;
+
+    // - the animation effect is associated with an animation with a playback rate < 0 and the animation effect is in the after phase.
+    if (m_playbackRate < 0 && timing.phase == AnimationEffectPhase::After)
+        return true;
+
+    // An animation effect is in effect if its active time, as calculated according to the procedure in
+    // § 4.8.3.1 Calculating the active time, is not unresolved.
     if (timing.activeTime)
         return true;
 
-    // An animation effect is current if either of the following conditions is true:
-    // - the animation effect is in the before phase, or
-    // - the animation effect is in play.
-
-    // An animation effect is in play if all of the following conditions are met:
-    // - the animation effect is in the active phase, and
-    // - the animation effect is associated with an animation that is not finished.
-    return timing.phase == AnimationEffectPhase::Before || (timing.phase == AnimationEffectPhase::Active && playState() != PlayState::Finished);
+    return false;
 }
 
 bool WebAnimation::isReplaceable() const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to