Title: [256694] branches/safari-609-branch
Revision
256694
Author
repst...@apple.com
Date
2020-02-14 19:02:49 -0800 (Fri, 14 Feb 2020)

Log Message

Cherry-pick r256623. rdar://problem/59478938

    Ensure animations that lose their effect don't schedule an animation update
    https://bugs.webkit.org/show_bug.cgi?id=207713
    rdar://59174840

    Patch by Sunny He <sunny...@apple.com> on 2020-02-14
    Reviewed by Antoine Quint.

    Source/WebCore:
    An active animation for which the effect is removed may be considered for
    an upcoming animation resolution. However, WebAnimation::timeToNextTick()
    expects a valid effect to be available to be able to determine timing.
    We now check an animation is relevant before calling timeToNextTick() and
    add an ASSERT() in that function to catch cases where an animation effect
    might not be available.

    Source/WebCore:

    Test: webanimations/animation-null-effect.html

    * animation/DocumentTimeline.cpp:
    (WebCore::DocumentTimeline::scheduleNextTick):
    * animation/WebAnimation.cpp:
    (WebCore::WebAnimation::timeToNextTick const):

    LayoutTests:

    * webanimations/animation-null-effect-expected.txt: Added.
    * webanimations/animation-null-effect.html: Added.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256623 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-609-branch/LayoutTests/ChangeLog (256693 => 256694)


--- branches/safari-609-branch/LayoutTests/ChangeLog	2020-02-15 03:02:46 UTC (rev 256693)
+++ branches/safari-609-branch/LayoutTests/ChangeLog	2020-02-15 03:02:49 UTC (rev 256694)
@@ -1,5 +1,59 @@
 2020-02-14  Russell Epstein  <repst...@apple.com>
 
+        Cherry-pick r256623. rdar://problem/59478938
+
+    Ensure animations that lose their effect don't schedule an animation update
+    https://bugs.webkit.org/show_bug.cgi?id=207713
+    rdar://59174840
+    
+    Patch by Sunny He <sunny...@apple.com> on 2020-02-14
+    Reviewed by Antoine Quint.
+    
+    Source/WebCore:
+    An active animation for which the effect is removed may be considered for
+    an upcoming animation resolution. However, WebAnimation::timeToNextTick()
+    expects a valid effect to be available to be able to determine timing.
+    We now check an animation is relevant before calling timeToNextTick() and
+    add an ASSERT() in that function to catch cases where an animation effect
+    might not be available.
+    
+    Source/WebCore:
+    
+    Test: webanimations/animation-null-effect.html
+    
+    * animation/DocumentTimeline.cpp:
+    (WebCore::DocumentTimeline::scheduleNextTick):
+    * animation/WebAnimation.cpp:
+    (WebCore::WebAnimation::timeToNextTick const):
+    
+    LayoutTests:
+    
+    * webanimations/animation-null-effect-expected.txt: Added.
+    * webanimations/animation-null-effect.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-02-14  Sunny He  <sunny...@apple.com>
+
+            Ensure animations that lose their effect don't schedule an animation update
+            https://bugs.webkit.org/show_bug.cgi?id=207713
+            rdar://59174840
+
+            Reviewed by Antoine Quint.
+
+            Source/WebCore:
+            An active animation for which the effect is removed may be considered for
+            an upcoming animation resolution. However, WebAnimation::timeToNextTick()
+            expects a valid effect to be available to be able to determine timing.
+            We now check an animation is relevant before calling timeToNextTick() and
+            add an ASSERT() in that function to catch cases where an animation effect
+            might not be available.
+
+            * webanimations/animation-null-effect-expected.txt: Added.
+            * webanimations/animation-null-effect.html: Added.
+
+2020-02-14  Russell Epstein  <repst...@apple.com>
+
         Cherry-pick r255889. rdar://problem/59446995
 
     [WTF] Try using 75% load factor for HashTable

Added: branches/safari-609-branch/LayoutTests/webanimations/animation-null-effect-expected.txt (0 => 256694)


--- branches/safari-609-branch/LayoutTests/webanimations/animation-null-effect-expected.txt	                        (rev 0)
+++ branches/safari-609-branch/LayoutTests/webanimations/animation-null-effect-expected.txt	2020-02-15 03:02:49 UTC (rev 256694)
@@ -0,0 +1,3 @@
+Ensure removing the effect from an active animation is handled correctly.
+
+PASS if test does not crash.

Added: branches/safari-609-branch/LayoutTests/webanimations/animation-null-effect.html (0 => 256694)


--- branches/safari-609-branch/LayoutTests/webanimations/animation-null-effect.html	                        (rev 0)
+++ branches/safari-609-branch/LayoutTests/webanimations/animation-null-effect.html	2020-02-15 03:02:49 UTC (rev 256694)
@@ -0,0 +1,16 @@
+<script>
+    if (window.testRunner) {
+        window.testRunner.dumpAsText();
+    }
+    function eventhandler() {
+        var animation = element.animate({ "padding-left": [0, 1] }, 0.5);
+        animation.reverse();
+        animation.effect = null;
+    }
+    window.requestAnimationFrame(eventhandler);
+</script>
+<body>
+    <div id="element"></div>
+    <p>Ensure removing the effect from an active animation is handled correctly.</p>
+    <p>PASS if test does not crash.</p>
+</body>

Modified: branches/safari-609-branch/Source/WebCore/ChangeLog (256693 => 256694)


--- branches/safari-609-branch/Source/WebCore/ChangeLog	2020-02-15 03:02:46 UTC (rev 256693)
+++ branches/safari-609-branch/Source/WebCore/ChangeLog	2020-02-15 03:02:49 UTC (rev 256694)
@@ -1,5 +1,63 @@
 2020-02-14  Russell Epstein  <repst...@apple.com>
 
+        Cherry-pick r256623. rdar://problem/59478938
+
+    Ensure animations that lose their effect don't schedule an animation update
+    https://bugs.webkit.org/show_bug.cgi?id=207713
+    rdar://59174840
+    
+    Patch by Sunny He <sunny...@apple.com> on 2020-02-14
+    Reviewed by Antoine Quint.
+    
+    Source/WebCore:
+    An active animation for which the effect is removed may be considered for
+    an upcoming animation resolution. However, WebAnimation::timeToNextTick()
+    expects a valid effect to be available to be able to determine timing.
+    We now check an animation is relevant before calling timeToNextTick() and
+    add an ASSERT() in that function to catch cases where an animation effect
+    might not be available.
+    
+    Source/WebCore:
+    
+    Test: webanimations/animation-null-effect.html
+    
+    * animation/DocumentTimeline.cpp:
+    (WebCore::DocumentTimeline::scheduleNextTick):
+    * animation/WebAnimation.cpp:
+    (WebCore::WebAnimation::timeToNextTick const):
+    
+    LayoutTests:
+    
+    * webanimations/animation-null-effect-expected.txt: Added.
+    * webanimations/animation-null-effect.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-02-14  Sunny He  <sunny...@apple.com>
+
+            Ensure animations that lose their effect don't schedule an animation update
+            https://bugs.webkit.org/show_bug.cgi?id=207713
+            rdar://59174840
+
+            Reviewed by Antoine Quint.
+
+            Source/WebCore:
+            An active animation for which the effect is removed may be considered for
+            an upcoming animation resolution. However, WebAnimation::timeToNextTick()
+            expects a valid effect to be available to be able to determine timing.
+            We now check an animation is relevant before calling timeToNextTick() and
+            add an ASSERT() in that function to catch cases where an animation effect
+            might not be available.
+
+            Test: webanimations/animation-null-effect.html
+
+            * animation/DocumentTimeline.cpp:
+            (WebCore::DocumentTimeline::scheduleNextTick):
+            * animation/WebAnimation.cpp:
+            (WebCore::WebAnimation::timeToNextTick const):
+
+2020-02-14  Russell Epstein  <repst...@apple.com>
+
         Cherry-pick r256580. rdar://problem/59478981
 
     Dark Mode: In Notes, list item becomes invisible in dark mode after outdenting

Modified: branches/safari-609-branch/Source/WebCore/animation/DocumentTimeline.cpp (256693 => 256694)


--- branches/safari-609-branch/Source/WebCore/animation/DocumentTimeline.cpp	2020-02-15 03:02:46 UTC (rev 256693)
+++ branches/safari-609-branch/Source/WebCore/animation/DocumentTimeline.cpp	2020-02-15 03:02:49 UTC (rev 256694)
@@ -545,6 +545,8 @@
     Seconds scheduleDelay = Seconds::infinity();
 
     for (const auto& animation : m_animations) {
+        if (!animation->isRelevant())
+            continue;
         auto animationTimeToNextRequiredTick = animation->timeToNextTick();
         if (animationTimeToNextRequiredTick < animationInterval()) {
             scheduleAnimationResolution();

Modified: branches/safari-609-branch/Source/WebCore/animation/WebAnimation.cpp (256693 => 256694)


--- branches/safari-609-branch/Source/WebCore/animation/WebAnimation.cpp	2020-02-15 03:02:46 UTC (rev 256693)
+++ branches/safari-609-branch/Source/WebCore/animation/WebAnimation.cpp	2020-02-15 03:02:49 UTC (rev 256694)
@@ -1419,6 +1419,8 @@
 
 Seconds WebAnimation::timeToNextTick() const
 {
+    ASSERT(effect());
+
     if (pending())
         return 0_s;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to