Title: [287568] trunk
Revision
287568
Author
grao...@webkit.org
Date
2022-01-04 08:11:22 -0800 (Tue, 04 Jan 2022)

Log Message

[Web Animations] changing the timing of a transition such that it's finished should no longer have it marked as running
https://bugs.webkit.org/show_bug.cgi?id=234823

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark WPT progression.

* web-platform-tests/css/css-transitions/CSSTransition-effect.tentative-expected.txt:

Source/WebCore:

Many factors could contribute to an animation entering its finished state. In case it's a transition,
we must remove it from the list of running transitions immediately, so we add a new virtual method when
the finished state is entered such that CSSTransition can implement this method and do the necessary
cleanup.

* animation/CSSTransition.cpp:
(WebCore::CSSTransition::animationDidFinish):
* animation/CSSTransition.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::updateFinishedState):
* animation/WebAnimation.h:
(WebCore::WebAnimation::animationDidFinish):

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (287567 => 287568)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-04 15:52:54 UTC (rev 287567)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-04 16:11:22 UTC (rev 287568)
@@ -1,3 +1,14 @@
+2022-01-04  Antoine Quint  <grao...@webkit.org>
+
+        [Web Animations] changing the timing of a transition such that it's finished should no longer have it marked as running
+        https://bugs.webkit.org/show_bug.cgi?id=234823
+
+        Reviewed by Dean Jackson.
+
+        Mark WPT progression.
+
+        * web-platform-tests/css/css-transitions/CSSTransition-effect.tentative-expected.txt:
+
 2022-01-04  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, reverting r283546.

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/CSSTransition-effect.tentative-expected.txt (287567 => 287568)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/CSSTransition-effect.tentative-expected.txt	2022-01-04 15:52:54 UTC (rev 287567)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-transitions/CSSTransition-effect.tentative-expected.txt	2022-01-04 16:11:22 UTC (rev 287568)
@@ -2,7 +2,7 @@
 PASS After setting a transition's effect to null, it still reports the original transition property
 PASS After setting a transition's effect to null, it becomes finished
 PASS After setting a transition's effect to null, style is updated
-FAIL After setting a transition's effect to null, a new transition can be started assert_equals: expected "100px" but got "0px"
+PASS After setting a transition's effect to null, a new transition can be started
 PASS After setting a transition's effect to null, it should be possible to interrupt that transition
 PASS After setting a new keyframe effect with a shorter duration, the transition becomes finished
 PASS After setting a new keyframe effect targeting different properties, the transition continues to report the original transition property

Modified: trunk/Source/WebCore/ChangeLog (287567 => 287568)


--- trunk/Source/WebCore/ChangeLog	2022-01-04 15:52:54 UTC (rev 287567)
+++ trunk/Source/WebCore/ChangeLog	2022-01-04 16:11:22 UTC (rev 287568)
@@ -1,3 +1,23 @@
+2022-01-04  Antoine Quint  <grao...@webkit.org>
+
+        [Web Animations] changing the timing of a transition such that it's finished should no longer have it marked as running
+        https://bugs.webkit.org/show_bug.cgi?id=234823
+
+        Reviewed by Dean Jackson.
+
+        Many factors could contribute to an animation entering its finished state. In case it's a transition,
+        we must remove it from the list of running transitions immediately, so we add a new virtual method when
+        the finished state is entered such that CSSTransition can implement this method and do the necessary
+        cleanup.
+
+        * animation/CSSTransition.cpp:
+        (WebCore::CSSTransition::animationDidFinish):
+        * animation/CSSTransition.h:
+        * animation/WebAnimation.cpp:
+        (WebCore::WebAnimation::updateFinishedState):
+        * animation/WebAnimation.h:
+        (WebCore::WebAnimation::animationDidFinish):
+
 2022-01-04  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, reverting r283546.

Modified: trunk/Source/WebCore/animation/CSSTransition.cpp (287567 => 287568)


--- trunk/Source/WebCore/animation/CSSTransition.cpp	2022-01-04 15:52:54 UTC (rev 287567)
+++ trunk/Source/WebCore/animation/CSSTransition.cpp	2022-01-04 16:11:22 UTC (rev 287568)
@@ -68,6 +68,12 @@
     m_currentStyle = RenderStyle::clonePtr(targetStyle);
 }
 
+void CSSTransition::animationDidFinish()
+{
+    if (auto owningElement = this->owningElement())
+        owningElement->removeDeclarativeAnimationFromListsForOwningElement(*this);
+}
+
 void CSSTransition::setTimingProperties(Seconds delay, Seconds duration)
 {
     suspendEffectInvalidation();

Modified: trunk/Source/WebCore/animation/CSSTransition.h (287567 => 287568)


--- trunk/Source/WebCore/animation/CSSTransition.h	2022-01-04 15:52:54 UTC (rev 287567)
+++ trunk/Source/WebCore/animation/CSSTransition.h	2022-01-04 16:11:22 UTC (rev 287568)
@@ -59,6 +59,7 @@
     void setTimingProperties(Seconds delay, Seconds duration);
     Ref<AnimationEventBase> createEvent(const AtomString& eventType, double elapsedTime, const String& pseudoId, std::optional<Seconds> timelineTime) final;
     void resolve(RenderStyle& targetStyle, const Style::ResolutionContext&, std::optional<Seconds>) final;
+    void animationDidFinish() final;
 
     CSSPropertyID m_property;
     MonotonicTime m_generationTime;

Modified: trunk/Source/WebCore/animation/WebAnimation.cpp (287567 => 287568)


--- trunk/Source/WebCore/animation/WebAnimation.cpp	2022-01-04 15:52:54 UTC (rev 287567)
+++ trunk/Source/WebCore/animation/WebAnimation.cpp	2022-01-04 16:11:22 UTC (rev 287568)
@@ -909,6 +909,7 @@
 
     // 5. If current finished state is true and the current finished promise is not yet resolved, perform the following steps:
     if (currentFinishedState && !m_finishedPromise->isFulfilled()) {
+        animationDidFinish();
         if (synchronouslyNotify == SynchronouslyNotify::Yes) {
             // If synchronously notify is true, cancel any queued microtask to run the finish notification steps for this animation,
             // and run the finish notification steps immediately.

Modified: trunk/Source/WebCore/animation/WebAnimation.h (287567 => 287568)


--- trunk/Source/WebCore/animation/WebAnimation.h	2022-01-04 15:52:54 UTC (rev 287567)
+++ trunk/Source/WebCore/animation/WebAnimation.h	2022-01-04 16:11:22 UTC (rev 287568)
@@ -163,6 +163,7 @@
 
     void initialize();
     void enqueueAnimationEvent(Ref<AnimationEventBase>&&);
+    virtual void animationDidFinish() { };
 
 private:
     enum class DidSeek : uint8_t { Yes, No };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to