Title: [232960] trunk
Revision
232960
Author
grao...@webkit.org
Date
2018-06-19 08:33:22 -0700 (Tue, 19 Jun 2018)

Log Message

[Web Animations] Make imported/mozilla/css-transitions/test_animation-cancel.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183821
<rdar://problem/40997034>

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Mark a progression in the Mozilla CSS Transitions tests.

* css-transitions/test_animation-cancel-expected.txt:

Source/WebCore:

If an element gets a "display: none" style RenderTreeUpdater::tearDownRenderers() will be called with a RendererUpdateCancelingAnimations
teardown type on all of its children. We need to ensure all declarative animations, and only those since regular Web Animations should be
kept active regardless of their target's style, are canceled in this situation.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
* animation/AnimationTimeline.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):

LayoutTests:

This test now passes reliably.

* TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (232959 => 232960)


--- trunk/LayoutTests/ChangeLog	2018-06-19 14:02:27 UTC (rev 232959)
+++ trunk/LayoutTests/ChangeLog	2018-06-19 15:33:22 UTC (rev 232960)
@@ -1,3 +1,15 @@
+2018-06-19  Antoine Quint  <grao...@apple.com>
+
+        [Web Animations] Make imported/mozilla/css-transitions/test_animation-cancel.html pass reliably
+        https://bugs.webkit.org/show_bug.cgi?id=183821
+        <rdar://problem/40997034>
+
+        Reviewed by Dean Jackson.
+
+        This test now passes reliably.
+
+        * TestExpectations:
+
 2018-06-19  Youenn Fablet  <you...@apple.com>
 
         RTCRtpSender.replaceTrack(null) ends current track

Modified: trunk/LayoutTests/TestExpectations (232959 => 232960)


--- trunk/LayoutTests/TestExpectations	2018-06-19 14:02:27 UTC (rev 232959)
+++ trunk/LayoutTests/TestExpectations	2018-06-19 15:33:22 UTC (rev 232960)
@@ -1928,7 +1928,6 @@
 
 webkit.org/b/183818 imported/mozilla/css-animations/test_pseudoElement-get-animations.html [ Pass Failure Timeout ]
 webkit.org/b/184011 imported/mozilla/css-animations/test_animation-cancel.html [ Pass Failure ]
-webkit.org/b/183821 imported/mozilla/css-transitions/test_animation-cancel.html [ Pass Failure Timeout ]
 webkit.org/b/183826 imported/mozilla/css-animations/test_animation-pausing.html [ Pass Failure Timeout ]
 webkit.org/b/183828 imported/mozilla/css-animations/test_animation-playstate.html [ Pass Failure Timeout ]
 webkit.org/b/183830 imported/mozilla/css-animations/test_animation-ready.html [ Pass Failure Timeout ]

Modified: trunk/LayoutTests/imported/mozilla/ChangeLog (232959 => 232960)


--- trunk/LayoutTests/imported/mozilla/ChangeLog	2018-06-19 14:02:27 UTC (rev 232959)
+++ trunk/LayoutTests/imported/mozilla/ChangeLog	2018-06-19 15:33:22 UTC (rev 232960)
@@ -1,3 +1,15 @@
+2018-06-19  Antoine Quint  <grao...@apple.com>
+
+        [Web Animations] Make imported/mozilla/css-transitions/test_animation-cancel.html pass reliably
+        https://bugs.webkit.org/show_bug.cgi?id=183821
+        <rdar://problem/40997034>
+
+        Reviewed by Dean Jackson.
+
+        Mark a progression in the Mozilla CSS Transitions tests.
+
+        * css-transitions/test_animation-cancel-expected.txt:
+
 2018-06-18  Antoine Quint  <grao...@apple.com>
 
         [Web Animations] Implement "Starting of transitions" section from CSS Transitions

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


--- trunk/LayoutTests/imported/mozilla/css-transitions/test_animation-cancel-expected.txt	2018-06-19 14:02:27 UTC (rev 232959)
+++ trunk/LayoutTests/imported/mozilla/css-transitions/test_animation-cancel-expected.txt	2018-06-19 15:33:22 UTC (rev 232960)
@@ -4,7 +4,7 @@
 PASS After cancelling a finished transition, it can still be re-used 
 PASS After cancelling a transition, updating transition properties doesn't make it live again 
 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"
+PASS Setting display:none cancels transitions on a child element 
 PASS Removing a property from transition-property cancels transitions on that property 
 PASS Setting zero combined duration 
 PASS Changing style to another interpolable value cancels the original transition 

Modified: trunk/Source/WebCore/ChangeLog (232959 => 232960)


--- trunk/Source/WebCore/ChangeLog	2018-06-19 14:02:27 UTC (rev 232959)
+++ trunk/Source/WebCore/ChangeLog	2018-06-19 15:33:22 UTC (rev 232960)
@@ -1,3 +1,21 @@
+2018-06-19  Antoine Quint  <grao...@apple.com>
+
+        [Web Animations] Make imported/mozilla/css-transitions/test_animation-cancel.html pass reliably
+        https://bugs.webkit.org/show_bug.cgi?id=183821
+        <rdar://problem/40997034>
+
+        Reviewed by Dean Jackson.
+
+        If an element gets a "display: none" style RenderTreeUpdater::tearDownRenderers() will be called with a RendererUpdateCancelingAnimations
+        teardown type on all of its children. We need to ensure all declarative animations, and only those since regular Web Animations should be
+        kept active regardless of their target's style, are canceled in this situation.
+
+        * animation/AnimationTimeline.cpp:
+        (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
+        * animation/AnimationTimeline.h:
+        * rendering/updating/RenderTreeUpdater.cpp:
+        (WebCore::RenderTreeUpdater::tearDownRenderers):
+
 2018-06-19  David Kilzer  <ddkil...@apple.com>
 
         Add logging when splashboardd enables WebThread

Modified: trunk/Source/WebCore/animation/AnimationTimeline.cpp (232959 => 232960)


--- trunk/Source/WebCore/animation/AnimationTimeline.cpp	2018-06-19 14:02:27 UTC (rev 232959)
+++ trunk/Source/WebCore/animation/AnimationTimeline.cpp	2018-06-19 15:33:22 UTC (rev 232960)
@@ -168,6 +168,14 @@
     }
 }
 
+void AnimationTimeline::cancelDeclarativeAnimationsForElement(Element& element)
+{
+    for (auto& cssTransition : m_elementToCSSTransitionsMap.get(&element))
+        cssTransition->cancel();
+    for (auto& cssAnimation : m_elementToCSSAnimationsMap.get(&element))
+        cssAnimation->cancel();
+}
+
 void AnimationTimeline::updateCSSAnimationsForElement(Element& element, const RenderStyle* currentStyle, const RenderStyle& afterChangeStyle)
 {
     // In case this element is newly getting a "display: none" we need to cancel all of its animations and disregard new ones.

Modified: trunk/Source/WebCore/animation/AnimationTimeline.h (232959 => 232960)


--- trunk/Source/WebCore/animation/AnimationTimeline.h	2018-06-19 14:02:27 UTC (rev 232959)
+++ trunk/Source/WebCore/animation/AnimationTimeline.h	2018-06-19 15:33:22 UTC (rev 232960)
@@ -60,6 +60,7 @@
     const ListHashSet<RefPtr<WebAnimation>>& animations() const { return m_animations; }
     Vector<RefPtr<WebAnimation>> animationsForElement(Element&) const;
     void removeAnimationsForElement(Element&);
+    void cancelDeclarativeAnimationsForElement(Element&);
     void animationWasAddedToElement(WebAnimation&, Element&);
     void animationWasRemovedFromElement(WebAnimation&, Element&);
 

Modified: trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp (232959 => 232960)


--- trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp	2018-06-19 14:02:27 UTC (rev 232959)
+++ trunk/Source/WebCore/rendering/updating/RenderTreeUpdater.cpp	2018-06-19 15:33:22 UTC (rev 232960)
@@ -554,8 +554,12 @@
 
             if (teardownType == TeardownType::Full || teardownType == TeardownType::RendererUpdateCancelingAnimations) {
                 if (RuntimeEnabledFeatures::sharedFeatures().webAnimationsCSSIntegrationEnabled()) {
-                    if (timeline && document.renderTreeBeingDestroyed())
-                        timeline->removeAnimationsForElement(element);
+                    if (timeline) {
+                        if (document.renderTreeBeingDestroyed())
+                            timeline->removeAnimationsForElement(element);
+                        else if (teardownType == TeardownType::RendererUpdateCancelingAnimations)
+                            timeline->cancelDeclarativeAnimationsForElement(element);
+                    }
                 } else
                     animationController.cancelAnimations(element);
             }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to