Title: [229829] trunk
Revision
229829
Author
grao...@webkit.org
Date
2018-03-21 14:49:02 -0700 (Wed, 21 Mar 2018)

Log Message

[Web Animations] Ensure animationcancel and transitioncancel events are dispatched
https://bugs.webkit.org/show_bug.cgi?id=183864

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Record progressions of Mozilla tests.

* css-animations/test_animation-cancel-expected.txt:
* css-animations/test_animation-currenttime-expected.txt:
* css-animations/test_animation-finished-expected.txt:
* css-animations/test_animation-reverse-expected.txt:
* css-transitions/test_animation-cancel-expected.txt:
* css-transitions/test_animation-pausing-expected.txt:
* css-transitions/test_animation-ready-expected.txt:

Source/WebCore:

In order to correctly dispatch animationcancel and transitioncancel events, we must call cancel() on CSSAnimation and CSSTransitions
objects that are removed while in a play or pause phase. Additionally, we cancel declarative animations that are moving from a valid
to a null timeline. Finally, when cancel() is called on a declarative animation, we record the timestamp and manually call
invalidateDOMEvents() passing that timestamp in to ensure that the right phase change is recorded and results in the queuing of
animationcancel and transitioncancel events.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSAnimationsForElement): Make sure we cancel all recorded CSS Animations when we newly get a
"display: none" style. We also call the new cancelOrRemoveDeclarativeAnimation() method, instead of removing animations outright,
for all animations that previously existed but are no longer listed in the current style.
(WebCore::AnimationTimeline::updateCSSTransitionsForElement): Like in updateCSSAnimationsForElement(), we cancel all recorded CSS
Transitions when we newly get a "display: none" style. We now use the refactored removeDeclarativeAnimation() method to remove an
a transition for a property that was already transitioned in the previous style but has a new backing Animation object. Finally,
like in updateCSSAnimationsForElement(), we call the new cancelOrRemoveDeclarativeAnimation() method, instead of removing transitions
outright, for all transitions that previously existed but are no longer listed in the current style.
(WebCore::AnimationTimeline::removeDeclarativeAnimation): Refactor code into this new method to remove a declarative animation.
(WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Cancels a DeclarativeAnimation if it's active or removes it right away.
* animation/AnimationTimeline.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::setTimeline): If we're moving from a valid timeline to a null timeline, call cancel() on this animation
such that an animationcancel or transitioncancel event can be dispatched.
(WebCore::DeclarativeAnimation::cancel): Cancelations require the computation of the time at which a declarative animation was canceled,
so we record the animation's active time as it's canceled and manually call invalidateDOMEvents() with that time after the general cancel()
code has run.
(WebCore::DeclarativeAnimation::invalidateDOMEvents): Accept an explicit timestamp for cancel events.
* animation/DeclarativeAnimation.h:
* animation/WebAnimation.h:

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/mozilla/ChangeLog (229828 => 229829)


--- trunk/LayoutTests/imported/mozilla/ChangeLog	2018-03-21 21:19:06 UTC (rev 229828)
+++ trunk/LayoutTests/imported/mozilla/ChangeLog	2018-03-21 21:49:02 UTC (rev 229829)
@@ -1,5 +1,22 @@
 2018-03-21  Antoine Quint  <grao...@apple.com>
 
+        [Web Animations] Ensure animationcancel and transitioncancel events are dispatched
+        https://bugs.webkit.org/show_bug.cgi?id=183864
+
+        Reviewed by Dean Jackson.
+
+        Record progressions of Mozilla tests.
+
+        * css-animations/test_animation-cancel-expected.txt:
+        * css-animations/test_animation-currenttime-expected.txt:
+        * css-animations/test_animation-finished-expected.txt:
+        * css-animations/test_animation-reverse-expected.txt:
+        * css-transitions/test_animation-cancel-expected.txt:
+        * css-transitions/test_animation-pausing-expected.txt:
+        * css-transitions/test_animation-ready-expected.txt:
+
+2018-03-21  Antoine Quint  <grao...@apple.com>
+
         [Web Animations] Dispatch DOM events for CSS Transitions and CSS Animations implemented as Web Animations
         https://bugs.webkit.org/show_bug.cgi?id=183781
 

Modified: trunk/LayoutTests/imported/mozilla/css-animations/test_animation-cancel-expected.txt (229828 => 229829)


--- trunk/LayoutTests/imported/mozilla/css-animations/test_animation-cancel-expected.txt	2018-03-21 21:19:06 UTC (rev 229828)
+++ trunk/LayoutTests/imported/mozilla/css-animations/test_animation-cancel-expected.txt	2018-03-21 21:49:02 UTC (rev 229829)
@@ -5,7 +5,7 @@
 PASS After cancelling an animation, it can still be re-used 
 PASS After cancelling an animation, updating animation properties doesn't make it live again 
 PASS After cancelling an animation, updating animation-play-state doesn't make it live again 
-FAIL Setting animation-name to 'none' cancels the animation assert_equals: expected "idle" but got "finished"
-FAIL Setting display:none on an element cancel its animations assert_equals: expected "idle" but got "running"
+PASS Setting animation-name to 'none' cancels the animation 
+PASS Setting display:none on an element cancel its animations 
 FAIL Setting display:none on an ancestor element cancels animations on descendants assert_equals: expected "idle" but got "running"
 

Modified: trunk/LayoutTests/imported/mozilla/css-animations/test_animation-currenttime-expected.txt (229828 => 229829)


--- trunk/LayoutTests/imported/mozilla/css-animations/test_animation-currenttime-expected.txt	2018-03-21 21:19:06 UTC (rev 229828)
+++ trunk/LayoutTests/imported/mozilla/css-animations/test_animation-currenttime-expected.txt	2018-03-21 21:49:02 UTC (rev 229829)
@@ -1,3 +1,18 @@
-#PID UNRESPONSIVE - com.apple.WebKit.WebContent.Development (pid 13518)
-FAIL: Timed out waiting for notifyDone to be called
 
+PASS Sanity test to check round-tripping assigning to new animation's currentTime 
+PASS Skipping forward through animation 
+PASS Skipping backwards through animation 
+PASS Redundant change, before -> active, then back 
+PASS Redundant change, before -> after, then back 
+PASS Redundant change, active -> before, then back 
+PASS Redundant change, active -> after, then back 
+PASS Redundant change, after -> before, then back 
+PASS Redundant change, after -> active, then back 
+PASS Seeking finished -> paused dispatches animationstart 
+PASS Setting currentTime to null 
+PASS Animation.currentTime after pausing 
+FAIL Animation.currentTime clamping assert_equals: Animation.currentTime should not continue to increase after the animation has finished expected 100000 but got 100026
+FAIL Animation.currentTime clamping for reversed animation assert_equals: Animation.currentTime should not continue to decrease after an animation running in reverse has finished and currentTime is zero expected 0 but got -22
+PASS Animation.currentTime after cancelling 
+PASS After aborting a pause when finished, the call to play() should rewind the current time 
+

Modified: trunk/LayoutTests/imported/mozilla/css-animations/test_animation-finished-expected.txt (229828 => 229829)


--- trunk/LayoutTests/imported/mozilla/css-animations/test_animation-finished-expected.txt	2018-03-21 21:19:06 UTC (rev 229828)
+++ trunk/LayoutTests/imported/mozilla/css-animations/test_animation-finished-expected.txt	2018-03-21 21:49:02 UTC (rev 229829)
@@ -1,3 +1,5 @@
-#PID UNRESPONSIVE - com.apple.WebKit.WebContent.Development (pid 13527)
-FAIL: Timed out waiting for notifyDone to be called
 
+PASS finished promise is rejected when an animation is cancelled by resetting the animation property 
+PASS finished promise is rejected when an animation is cancelled by changing the animation property 
+PASS Test finished promise changes when animationPlayState set to running 
+

Modified: trunk/LayoutTests/imported/mozilla/css-animations/test_animation-reverse-expected.txt (229828 => 229829)


--- trunk/LayoutTests/imported/mozilla/css-animations/test_animation-reverse-expected.txt	2018-03-21 21:19:06 UTC (rev 229828)
+++ trunk/LayoutTests/imported/mozilla/css-animations/test_animation-reverse-expected.txt	2018-03-21 21:49:02 UTC (rev 229829)
@@ -1,3 +1,3 @@
 
-FAIL reverse() from idle state starts playing the animation assert_equals: expected (object) null but got (number) 0
+PASS reverse() from idle state starts playing the animation 
 

Modified: trunk/LayoutTests/imported/mozilla/css-transitions/test_animation-cancel-expected.txt (229828 => 229829)


--- trunk/LayoutTests/imported/mozilla/css-transitions/test_animation-cancel-expected.txt	2018-03-21 21:19:06 UTC (rev 229828)
+++ trunk/LayoutTests/imported/mozilla/css-transitions/test_animation-cancel-expected.txt	2018-03-21 21:49:02 UTC (rev 229829)
@@ -3,10 +3,10 @@
 FAIL After canceling a transition, it can still be re-used assert_equals: margin-left style is animated after re-starting transition expected "0px" but got "1000px"
 FAIL After cancelling a finished transition, it can still be re-used assert_equals: margin-left style is not animated after cancelling expected "1000px" but got "0.044057685881853104px"
 PASS After cancelling a transition, updating transition properties doesn't make it live again 
-FAIL Setting display:none on an element cancels its transitions assert_equals: expected "idle" but got "finished"
+PASS Setting display:none on an element cancels its transitions 
 FAIL Setting display:none cancels transitions on a child element assert_equals: expected "idle" but got "running"
-FAIL Removing a property from transition-property cancels transitions on that property assert_equals: expected "idle" but got "finished"
-FAIL Setting zero combined duration assert_equals: expected "idle" but got "finished"
+PASS Removing a property from transition-property cancels transitions on that property 
+PASS Setting zero combined duration 
 FAIL Changing style to another interpolable value cancels the original transition assert_equals: expected "idle" but got "finished"
 FAIL An after-change style value can't be interpolated assert_equals: expected "idle" but got "finished"
 FAIL Reversing a running transition cancels the original transition assert_equals: expected "idle" but got "finished"

Modified: trunk/LayoutTests/imported/mozilla/css-transitions/test_animation-pausing-expected.txt (229828 => 229829)


--- trunk/LayoutTests/imported/mozilla/css-transitions/test_animation-pausing-expected.txt	2018-03-21 21:19:06 UTC (rev 229828)
+++ trunk/LayoutTests/imported/mozilla/css-transitions/test_animation-pausing-expected.txt	2018-03-21 21:49:02 UTC (rev 229829)
@@ -1,4 +1,3 @@
-CONSOLE MESSAGE: Unhandled Promise Rejection: AbortError: The operation was aborted.
-#PID UNRESPONSIVE - com.apple.WebKit.WebContent.Development (pid 13519)
-FAIL: Timed out waiting for notifyDone to be called
 
+FAIL pause() and play() a transition null is not an object (evaluating 'animation.effect.getComputedTiming')
+

Modified: trunk/LayoutTests/imported/mozilla/css-transitions/test_animation-ready-expected.txt (229828 => 229829)


--- trunk/LayoutTests/imported/mozilla/css-transitions/test_animation-ready-expected.txt	2018-03-21 21:19:06 UTC (rev 229828)
+++ trunk/LayoutTests/imported/mozilla/css-transitions/test_animation-ready-expected.txt	2018-03-21 21:49:02 UTC (rev 229829)
@@ -1,5 +1,5 @@
 
 PASS A new ready promise is created each time play() is called the animation property 
-FAIL ready promise is rejected when a transition is cancelled by updating transition-property assert_equals: Animation is idle after transition was cancelled expected "idle" but got "paused"
+PASS ready promise is rejected when a transition is cancelled by updating transition-property 
 FAIL ready promise is rejected when a transition is cancelled by changing the transition property to something not interpolable assert_equals: Animation is idle after transition was cancelled expected "idle" but got "paused"
 

Modified: trunk/Source/WebCore/ChangeLog (229828 => 229829)


--- trunk/Source/WebCore/ChangeLog	2018-03-21 21:19:06 UTC (rev 229828)
+++ trunk/Source/WebCore/ChangeLog	2018-03-21 21:49:02 UTC (rev 229829)
@@ -1,3 +1,38 @@
+2018-03-21  Antoine Quint  <grao...@apple.com>
+
+        [Web Animations] Ensure animationcancel and transitioncancel events are dispatched
+        https://bugs.webkit.org/show_bug.cgi?id=183864
+
+        Reviewed by Dean Jackson.
+
+        In order to correctly dispatch animationcancel and transitioncancel events, we must call cancel() on CSSAnimation and CSSTransitions
+        objects that are removed while in a play or pause phase. Additionally, we cancel declarative animations that are moving from a valid
+        to a null timeline. Finally, when cancel() is called on a declarative animation, we record the timestamp and manually call
+        invalidateDOMEvents() passing that timestamp in to ensure that the right phase change is recorded and results in the queuing of
+        animationcancel and transitioncancel events.
+
+        * animation/AnimationTimeline.cpp:
+        (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Make sure we cancel all recorded CSS Animations when we newly get a
+        "display: none" style. We also call the new cancelOrRemoveDeclarativeAnimation() method, instead of removing animations outright,
+        for all animations that previously existed but are no longer listed in the current style.
+        (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Like in updateCSSAnimationsForElement(), we cancel all recorded CSS
+        Transitions when we newly get a "display: none" style. We now use the refactored removeDeclarativeAnimation() method to remove an
+        a transition for a property that was already transitioned in the previous style but has a new backing Animation object. Finally,
+        like in updateCSSAnimationsForElement(), we call the new cancelOrRemoveDeclarativeAnimation() method, instead of removing transitions
+        outright, for all transitions that previously existed but are no longer listed in the current style.
+        (WebCore::AnimationTimeline::removeDeclarativeAnimation): Refactor code into this new method to remove a declarative animation.
+        (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Cancels a DeclarativeAnimation if it's active or removes it right away.
+        * animation/AnimationTimeline.h:
+        * animation/DeclarativeAnimation.cpp:
+        (WebCore::DeclarativeAnimation::setTimeline): If we're moving from a valid timeline to a null timeline, call cancel() on this animation
+        such that an animationcancel or transitioncancel event can be dispatched.
+        (WebCore::DeclarativeAnimation::cancel): Cancelations require the computation of the time at which a declarative animation was canceled,
+        so we record the animation's active time as it's canceled and manually call invalidateDOMEvents() with that time after the general cancel()
+        code has run.
+        (WebCore::DeclarativeAnimation::invalidateDOMEvents): Accept an explicit timestamp for cancel events.
+        * animation/DeclarativeAnimation.h:
+        * animation/WebAnimation.h:
+
 2018-03-21  Chris Dumez  <cdu...@apple.com>
 
         ScrollViewInsetTests.RestoreInitialContentOffsetAfterCrash API test is failing with async delegates

Modified: trunk/Source/WebCore/animation/AnimationTimeline.cpp (229828 => 229829)


--- trunk/Source/WebCore/animation/AnimationTimeline.cpp	2018-03-21 21:19:06 UTC (rev 229828)
+++ trunk/Source/WebCore/animation/AnimationTimeline.cpp	2018-03-21 21:49:02 UTC (rev 229829)
@@ -28,6 +28,7 @@
 #include "AnimationTimeline.h"
 
 #include "Animation.h"
+#include "AnimationEffectReadOnly.h"
 #include "AnimationList.h"
 #include "CSSAnimation.h"
 #include "CSSPropertyAnimation.h"
@@ -134,6 +135,15 @@
     if (element.document().renderView()->printing())
         return;
 
+    // In case this element is newly getting a "display: none" we need to cancel all of its animations and disregard new ones.
+    if (oldStyle && oldStyle->hasAnimations() && oldStyle->display() != NONE && newStyle.display() == NONE) {
+        if (m_elementToCSSAnimationByName.contains(&element)) {
+            for (const auto& cssAnimationsByNameMapItem : m_elementToCSSAnimationByName.take(&element))
+                cancelOrRemoveDeclarativeAnimation(cssAnimationsByNameMapItem.value);
+        }
+        return;
+    }
+
     // First, compile the list of animation names that were applied to this element up to this point.
     HashSet<String> namesOfPreviousAnimations;
     if (oldStyle && oldStyle->hasAnimations()) {
@@ -170,11 +180,8 @@
 
     // The animations names left in namesOfPreviousAnimations are now known to no longer apply so we need to
     // remove the CSSAnimation object created for them.
-    for (const auto& nameOfAnimationToRemove : namesOfPreviousAnimations) {
-        auto cssAnimationToRemove = cssAnimationsByName.take(nameOfAnimationToRemove);
-        cssAnimationToRemove->setEffect(nullptr);
-        removeAnimation(cssAnimationToRemove.releaseNonNull());
-    }
+    for (const auto& nameOfAnimationToRemove : namesOfPreviousAnimations)
+        cancelOrRemoveDeclarativeAnimation(cssAnimationsByName.take(nameOfAnimationToRemove));
 
     // Remove the map of CSSAnimations by animation name for this element if it's now empty.
     if (cssAnimationsByName.isEmpty())
@@ -189,6 +196,15 @@
     if (element.document().renderView()->printing())
         return;
 
+    // In case this element is newly getting a "display: none" we need to cancel all of its animations and disregard new ones.
+    if (oldStyle && oldStyle->hasTransitions() && oldStyle->display() != NONE && newStyle.display() == NONE) {
+        if (m_elementToCSSTransitionByCSSPropertyID.contains(&element)) {
+            for (const auto& cssTransitionsByCSSPropertyIDMapItem : m_elementToCSSTransitionByCSSPropertyID.take(&element))
+                cancelOrRemoveDeclarativeAnimation(cssTransitionsByCSSPropertyIDMapItem.value);
+        }
+        return;
+    }
+
     // FIXME: We do not handle "all" transitions yet.
 
     // First, compile the list of backing animations and properties that were applied to this element up to this point.
@@ -226,9 +242,7 @@
                 if (cssTransitionsByProperty.contains(property)) {
                     if (cssTransitionsByProperty.get(property)->matchesBackingAnimationAndStyles(backingAnimation, oldStyle, newStyle))
                         continue;
-                    auto cssTransitionToRemove = cssTransitionsByProperty.take(property);
-                    cssTransitionToRemove->setEffect(nullptr);
-                    removeAnimation(cssTransitionToRemove.releaseNonNull());
+                    removeDeclarativeAnimation(cssTransitionsByProperty.take(property));
                 }
                 // Now we can create a new CSSTransition with the new backing animation provided it has a valid
                 // duration and the from and to values are distinct.
@@ -240,11 +254,8 @@
 
     // Remaining properties are no longer current and must be removed.
     for (const auto transitionPropertyToRemove : previousProperties) {
-        if (!cssTransitionsByProperty.contains(transitionPropertyToRemove))
-            continue;
-        auto cssTransitionToRemove = cssTransitionsByProperty.take(transitionPropertyToRemove);
-        cssTransitionToRemove->setEffect(nullptr);
-        removeAnimation(cssTransitionToRemove.releaseNonNull());
+        if (cssTransitionsByProperty.contains(transitionPropertyToRemove))
+            cancelOrRemoveDeclarativeAnimation(cssTransitionsByProperty.take(transitionPropertyToRemove));
     }
 
     // Remove the map of CSSTransitions by property for this element if it's now empty.
@@ -252,6 +263,21 @@
         m_elementToCSSTransitionByCSSPropertyID.remove(&element);
 }
 
+void AnimationTimeline::removeDeclarativeAnimation(RefPtr<DeclarativeAnimation> animation)
+{
+    animation->setEffect(nullptr);
+    removeAnimation(animation.releaseNonNull());
+}
+
+void AnimationTimeline::cancelOrRemoveDeclarativeAnimation(RefPtr<DeclarativeAnimation> animation)
+{
+    auto phase = animation->effect()->phase();
+    if (phase != AnimationEffectReadOnly::Phase::Idle && phase != AnimationEffectReadOnly::Phase::After)
+        animation->cancel();
+    else
+        removeDeclarativeAnimation(animation);
+}
+
 String AnimationTimeline::description()
 {
     TextStream stream;

Modified: trunk/Source/WebCore/animation/AnimationTimeline.h (229828 => 229829)


--- trunk/Source/WebCore/animation/AnimationTimeline.h	2018-03-21 21:19:06 UTC (rev 229828)
+++ trunk/Source/WebCore/animation/AnimationTimeline.h	2018-03-21 21:49:02 UTC (rev 229829)
@@ -41,6 +41,7 @@
 
 class CSSAnimation;
 class CSSTransition;
+class DeclarativeAnimation;
 class Element;
 
 class AnimationTimeline : public RefCounted<AnimationTimeline> {
@@ -80,9 +81,11 @@
     const HashMap<Element*, Vector<RefPtr<WebAnimation>>>& elementToAnimationsMap() { return m_elementToAnimationsMap; }
     const HashMap<Element*, Vector<RefPtr<WebAnimation>>>& elementToCSSAnimationsMap() { return m_elementToCSSAnimationsMap; }
     const HashMap<Element*, Vector<RefPtr<WebAnimation>>>& elementToCSSTransitionsMap() { return m_elementToCSSTransitionsMap; }
+    void removeDeclarativeAnimation(RefPtr<DeclarativeAnimation>);
 
 private:
     HashMap<Element*, Vector<RefPtr<WebAnimation>>>& relevantMapForAnimation(WebAnimation&);
+    void cancelOrRemoveDeclarativeAnimation(RefPtr<DeclarativeAnimation>);
 
     ClassType m_classType;
     std::optional<Seconds> m_currentTime;

Modified: trunk/Source/WebCore/animation/DeclarativeAnimation.cpp (229828 => 229829)


--- trunk/Source/WebCore/animation/DeclarativeAnimation.cpp	2018-03-21 21:19:06 UTC (rev 229828)
+++ trunk/Source/WebCore/animation/DeclarativeAnimation.cpp	2018-03-21 21:49:02 UTC (rev 229829)
@@ -84,6 +84,25 @@
     unsuspendEffectInvalidation();
 }
 
+void DeclarativeAnimation::setTimeline(RefPtr<AnimationTimeline>&& newTimeline)
+{
+    if (timeline() && !newTimeline)
+        cancel();
+
+    WebAnimation::setTimeline(WTFMove(newTimeline));
+}
+
+void DeclarativeAnimation::cancel()
+{
+    auto cancelationTime = 0_s;
+    if (auto animationEffect = effect())
+        cancelationTime = animationEffect->activeTime().value_or(0_s);
+
+    WebAnimation::cancel();
+
+    invalidateDOMEvents(cancelationTime);
+}
+
 AnimationEffectReadOnly::Phase DeclarativeAnimation::phaseWithoutEffect() const
 {
     // This shouldn't be called if we actually have an effect.
@@ -97,7 +116,7 @@
     return animationCurrentTime.value() < 0_s ? AnimationEffectReadOnly::Phase::Before : AnimationEffectReadOnly::Phase::After;
 }
 
-void DeclarativeAnimation::invalidateDOMEvents()
+void DeclarativeAnimation::invalidateDOMEvents(Seconds elapsedTime)
 {
     auto* animationEffect = effect();
 
@@ -142,7 +161,7 @@
             enqueueDOMEvent(eventNames().animationstartEvent, intervalEnd);
             enqueueDOMEvent(eventNames().animationendEvent, intervalStart);
         } else if ((!wasIdle && !wasAfter) && isIdle)
-            enqueueDOMEvent(eventNames().animationcancelEvent, 0_s);
+            enqueueDOMEvent(eventNames().animationcancelEvent, elapsedTime);
     } else if (is<CSSTransition>(this)) {
         // https://drafts.csswg.org/css-transitions-2/#transition-events
         if (wasIdle && (isPending || isBefore))
@@ -169,7 +188,7 @@
             enqueueDOMEvent(eventNames().transitionstartEvent, intervalEnd);
             enqueueDOMEvent(eventNames().transitionendEvent, intervalStart);
         } else if ((!wasIdle && !wasAfter) && isIdle)
-            enqueueDOMEvent(eventNames().transitioncancelEvent, 0_s);
+            enqueueDOMEvent(eventNames().transitioncancelEvent, elapsedTime);
     }
 
     m_wasPending = isPending;

Modified: trunk/Source/WebCore/animation/DeclarativeAnimation.h (229828 => 229829)


--- trunk/Source/WebCore/animation/DeclarativeAnimation.h	2018-03-21 21:19:06 UTC (rev 229828)
+++ trunk/Source/WebCore/animation/DeclarativeAnimation.h	2018-03-21 21:49:02 UTC (rev 229829)
@@ -43,8 +43,11 @@
 
     const Animation& backingAnimation() const { return m_backingAnimation; }
     void setBackingAnimation(const Animation&);
-    void invalidateDOMEvents();
+    void invalidateDOMEvents(Seconds elapsedTime = 0_s);
 
+    void setTimeline(RefPtr<AnimationTimeline>&&) final;
+    void cancel() final;
+
 protected:
     DeclarativeAnimation(Element&, const Animation&);
 

Modified: trunk/Source/WebCore/animation/WebAnimation.h (229828 => 229829)


--- trunk/Source/WebCore/animation/WebAnimation.h	2018-03-21 21:19:06 UTC (rev 229828)
+++ trunk/Source/WebCore/animation/WebAnimation.h	2018-03-21 21:49:02 UTC (rev 229829)
@@ -64,7 +64,7 @@
     AnimationEffectReadOnly* effect() const { return m_effect.get(); }
     void setEffect(RefPtr<AnimationEffectReadOnly>&&);
     AnimationTimeline* timeline() const { return m_timeline.get(); }
-    void setTimeline(RefPtr<AnimationTimeline>&&);
+    virtual void setTimeline(RefPtr<AnimationTimeline>&&);
 
     std::optional<double> bindingsStartTime() const;
     void setBindingsStartTime(std::optional<double>);
@@ -91,7 +91,7 @@
     using FinishedPromise = DOMPromiseProxyWithResolveCallback<IDLInterface<WebAnimation>>;
     FinishedPromise& finished() { return m_finishedPromise.get(); }
 
-    void cancel();
+    virtual void cancel();
     ExceptionOr<void> finish();
     ExceptionOr<void> play();
     ExceptionOr<void> pause();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to