Title: [233141] trunk
Revision
233141
Author
[email protected]
Date
2018-06-25 03:00:42 -0700 (Mon, 25 Jun 2018)

Log Message

[Web Animations] Make imported/mozilla/css-animations/test_animation-pausing.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183826
<rdar://problem/40997412>

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Mark progressions in the Mozilla CSS Animations tests.

* css-animations/test_animation-pausing-expected.txt:

Source/WebCore:

The CSS Animations Level 2 specification defines that calling pause() on a CSSAnimation object is "sticky"
until a call to play() is made, meaning that any changes to the running state via the CSS animation-play-state
property is overridden by the stickiness of the pause() call. In this patch we add an m_stickyPaused flag which
is set in API calls to pause() and play(). While this flag is true, changes to the animation-play-state property
to the "running" value are ignored.

* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
(WebCore::CSSAnimation::bindingsPlay):
(WebCore::CSSAnimation::bindingsPause):
* animation/CSSAnimation.h:

LayoutTests:

This test now passes reliably.

* TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (233140 => 233141)


--- trunk/LayoutTests/ChangeLog	2018-06-25 09:54:34 UTC (rev 233140)
+++ trunk/LayoutTests/ChangeLog	2018-06-25 10:00:42 UTC (rev 233141)
@@ -1,3 +1,15 @@
+2018-06-25  Antoine Quint  <[email protected]>
+
+        [Web Animations] Make imported/mozilla/css-animations/test_animation-pausing.html pass reliably
+        https://bugs.webkit.org/show_bug.cgi?id=183826
+        <rdar://problem/40997412>
+
+        Reviewed by Dean Jackson.
+
+        This test now passes reliably.
+
+        * TestExpectations:
+
 2018-06-25  Zan Dobersek  <[email protected]>
 
         [GCrypt] Zero-prefix (if necessary) RSA-OAEP encryption, RSA-PSS signing output

Modified: trunk/LayoutTests/TestExpectations (233140 => 233141)


--- trunk/LayoutTests/TestExpectations	2018-06-25 09:54:34 UTC (rev 233140)
+++ trunk/LayoutTests/TestExpectations	2018-06-25 10:00:42 UTC (rev 233141)
@@ -1930,7 +1930,6 @@
 webkit.org/b/181123 imported/w3c/web-platform-tests/web-animations/interfaces/Animation/finish.html [ Pass Failure ]
 webkit.org/b/181888 imported/w3c/web-platform-tests/web-animations/timing-model/animation-effects/current-iteration.html [ Pass Failure ]
 
-webkit.org/b/183826 imported/mozilla/css-animations/test_animation-pausing.html [ Pass Failure Timeout ]
 webkit.org/b/183834 imported/mozilla/css-animations/test_animation-starttime.html [ Pass Failure Timeout ]
 webkit.org/b/183836 imported/mozilla/css-animations/test_animations-dynamic-changes.html [ Pass Failure Timeout ]
 webkit.org/b/183837 imported/mozilla/css-transitions/test_document-get-animations.html [ Pass Failure Timeout ]

Modified: trunk/LayoutTests/imported/mozilla/ChangeLog (233140 => 233141)


--- trunk/LayoutTests/imported/mozilla/ChangeLog	2018-06-25 09:54:34 UTC (rev 233140)
+++ trunk/LayoutTests/imported/mozilla/ChangeLog	2018-06-25 10:00:42 UTC (rev 233141)
@@ -1,5 +1,17 @@
 2018-06-25  Antoine Quint  <[email protected]>
 
+        [Web Animations] Make imported/mozilla/css-animations/test_animation-pausing.html pass reliably
+        https://bugs.webkit.org/show_bug.cgi?id=183826
+        <rdar://problem/40997412>
+
+        Reviewed by Dean Jackson.
+
+        Mark progressions in the Mozilla CSS Animations tests.
+
+        * css-animations/test_animation-pausing-expected.txt:
+
+2018-06-25  Antoine Quint  <[email protected]>
+
         [Web Animations] Ensure animations are updated prior to requestAnimationFrame callbacks
         https://bugs.webkit.org/show_bug.cgi?id=186997
         <rdar://problem/41419414>

Modified: trunk/LayoutTests/imported/mozilla/css-animations/test_animation-pausing-expected.txt (233140 => 233141)


--- trunk/LayoutTests/imported/mozilla/css-animations/test_animation-pausing-expected.txt	2018-06-25 09:54:34 UTC (rev 233140)
+++ trunk/LayoutTests/imported/mozilla/css-animations/test_animation-pausing-expected.txt	2018-06-25 10:00:42 UTC (rev 233141)
@@ -1,6 +1,6 @@
 
 PASS play() overrides animation-play-state 
-FAIL pause() overrides animation-play-state assert_equals: Paused value of margin-left is zero expected 0 but got 0.03600386157631874
+PASS pause() overrides animation-play-state 
 PASS play() is overridden by later setting "animation-play-state: paused" 
 PASS play() flushes pending changes to animation-play-state first 
 PASS pause() applies pending changes to animation-play-state first 

Modified: trunk/Source/WebCore/ChangeLog (233140 => 233141)


--- trunk/Source/WebCore/ChangeLog	2018-06-25 09:54:34 UTC (rev 233140)
+++ trunk/Source/WebCore/ChangeLog	2018-06-25 10:00:42 UTC (rev 233141)
@@ -1,5 +1,25 @@
 2018-06-25  Antoine Quint  <[email protected]>
 
+        [Web Animations] Make imported/mozilla/css-animations/test_animation-pausing.html pass reliably
+        https://bugs.webkit.org/show_bug.cgi?id=183826
+        <rdar://problem/40997412>
+
+        Reviewed by Dean Jackson.
+
+        The CSS Animations Level 2 specification defines that calling pause() on a CSSAnimation object is "sticky"
+        until a call to play() is made, meaning that any changes to the running state via the CSS animation-play-state
+        property is overridden by the stickiness of the pause() call. In this patch we add an m_stickyPaused flag which
+        is set in API calls to pause() and play(). While this flag is true, changes to the animation-play-state property
+        to the "running" value are ignored.
+
+        * animation/CSSAnimation.cpp:
+        (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
+        (WebCore::CSSAnimation::bindingsPlay):
+        (WebCore::CSSAnimation::bindingsPause):
+        * animation/CSSAnimation.h:
+
+2018-06-25  Antoine Quint  <[email protected]>
+
         [Web Animations] Ensure animations are updated prior to requestAnimationFrame callbacks
         https://bugs.webkit.org/show_bug.cgi?id=186997
         <rdar://problem/41419414>

Modified: trunk/Source/WebCore/animation/CSSAnimation.cpp (233140 => 233141)


--- trunk/Source/WebCore/animation/CSSAnimation.cpp	2018-06-25 09:54:34 UTC (rev 233140)
+++ trunk/Source/WebCore/animation/CSSAnimation.cpp	2018-06-25 10:00:42 UTC (rev 233141)
@@ -91,9 +91,10 @@
     timing->setIterationDuration(Seconds(animation.duration()));
 
     // Synchronize the play state
-    if (animation.playState() == AnimationPlayState::Playing && playState() == WebAnimation::PlayState::Paused)
-        play();
-    else if (animation.playState() == AnimationPlayState::Paused && playState() == WebAnimation::PlayState::Running)
+    if (animation.playState() == AnimationPlayState::Playing && playState() == WebAnimation::PlayState::Paused) {
+        if (!m_stickyPaused)
+            play();
+    } else if (animation.playState() == AnimationPlayState::Paused && playState() == WebAnimation::PlayState::Running)
         pause();
 
     unsuspendEffectInvalidation();
@@ -153,6 +154,7 @@
 ExceptionOr<void> CSSAnimation::bindingsPlay()
 {
     flushPendingStyleChanges();
+    m_stickyPaused = false;
     return DeclarativeAnimation::bindingsPlay();
 }
 
@@ -159,6 +161,7 @@
 ExceptionOr<void> CSSAnimation::bindingsPause()
 {
     flushPendingStyleChanges();
+    m_stickyPaused = true;
     return DeclarativeAnimation::bindingsPause();
 }
 

Modified: trunk/Source/WebCore/animation/CSSAnimation.h (233140 => 233141)


--- trunk/Source/WebCore/animation/CSSAnimation.h	2018-06-25 09:54:34 UTC (rev 233140)
+++ trunk/Source/WebCore/animation/CSSAnimation.h	2018-06-25 10:00:42 UTC (rev 233141)
@@ -64,6 +64,7 @@
 
     String m_animationName;
     std::unique_ptr<RenderStyle> m_unanimatedStyle;
+    bool m_stickyPaused { false };
 };
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to