Title: [268754] branches/safari-611.1.4-branch
Revision
268754
Author
alanc...@apple.com
Date
2020-10-20 13:10:17 -0700 (Tue, 20 Oct 2020)

Log Message

Cherry-pick r268746. rdar://problem/70497736

    REGRESSION(r268615): some accelerated transform tests are failing
    https://bugs.webkit.org/show_bug.cgi?id=217851
    <rdar://problem/70394402>

    Reviewed by Dean Jackson.

    Source/WebCore:

    When we added support for accelerated individual transform properties animations, we added
    the notion of base transform animations which are used to set the base value of any
    transform-related property that is not animated.

    Those animations were defined to start as early as possible, assuming that a very small value
    after 0s was as early as possible. However, it's possible that other animations start with a
    negative time if they have a delay or are seeked, if the value returned by CACurrentMediaTime()
    is smaller than that delay. This means that if the machine had been booted for less time than
    an accelerated animation's delay, the base transform animation wouldn't overlap.

    We now ensure that those base transform animations start as early as the earliest animation
    that is being committed in a call to GraphicsLayerCA::updateAnimations().

    * platform/graphics/ca/GraphicsLayerCA.cpp:
    (WebCore::GraphicsLayerCA::updateAnimations):
    (WebCore::GraphicsLayerCA::setAnimationOnLayer):
    * platform/graphics/ca/GraphicsLayerCA.h:
    (WebCore::GraphicsLayerCA::LayerPropertyAnimation::computedBeginTime const):

    LayoutTests:

    Remove flaky epectations for affected tests and skip tests on Windows where failures remain.

    * TestExpectations:
    * platform/mac/TestExpectations:
    * platform/win/TestExpectations:

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

Modified Paths

Diff

Modified: branches/safari-611.1.4-branch/LayoutTests/ChangeLog (268753 => 268754)


--- branches/safari-611.1.4-branch/LayoutTests/ChangeLog	2020-10-20 20:10:13 UTC (rev 268753)
+++ branches/safari-611.1.4-branch/LayoutTests/ChangeLog	2020-10-20 20:10:17 UTC (rev 268754)
@@ -1,3 +1,58 @@
+2020-10-20  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r268746. rdar://problem/70497736
+
+    REGRESSION(r268615): some accelerated transform tests are failing
+    https://bugs.webkit.org/show_bug.cgi?id=217851
+    <rdar://problem/70394402>
+    
+    Reviewed by Dean Jackson.
+    
+    Source/WebCore:
+    
+    When we added support for accelerated individual transform properties animations, we added
+    the notion of base transform animations which are used to set the base value of any
+    transform-related property that is not animated.
+    
+    Those animations were defined to start as early as possible, assuming that a very small value
+    after 0s was as early as possible. However, it's possible that other animations start with a
+    negative time if they have a delay or are seeked, if the value returned by CACurrentMediaTime()
+    is smaller than that delay. This means that if the machine had been booted for less time than
+    an accelerated animation's delay, the base transform animation wouldn't overlap.
+    
+    We now ensure that those base transform animations start as early as the earliest animation
+    that is being committed in a call to GraphicsLayerCA::updateAnimations().
+    
+    * platform/graphics/ca/GraphicsLayerCA.cpp:
+    (WebCore::GraphicsLayerCA::updateAnimations):
+    (WebCore::GraphicsLayerCA::setAnimationOnLayer):
+    * platform/graphics/ca/GraphicsLayerCA.h:
+    (WebCore::GraphicsLayerCA::LayerPropertyAnimation::computedBeginTime const):
+    
+    LayoutTests:
+    
+    Remove flaky epectations for affected tests and skip tests on Windows where failures remain.
+    
+    * TestExpectations:
+    * platform/mac/TestExpectations:
+    * platform/win/TestExpectations:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-10-20  Antoine Quint  <grao...@webkit.org>
+
+            REGRESSION(r268615): some accelerated transform tests are failing
+            https://bugs.webkit.org/show_bug.cgi?id=217851
+            <rdar://problem/70394402>
+
+            Reviewed by Dean Jackson.
+
+            Remove flaky epectations for affected tests and skip tests on Windows where failures remain.
+
+            * TestExpectations:
+            * platform/mac/TestExpectations:
+            * platform/win/TestExpectations:
+
 2020-10-17  Ross Kirsling  <ross.kirsl...@sony.com>
 
         Ensure %TypedArray% essential internal methods adhere to spec

Modified: branches/safari-611.1.4-branch/LayoutTests/TestExpectations (268753 => 268754)


--- branches/safari-611.1.4-branch/LayoutTests/TestExpectations	2020-10-20 20:10:13 UTC (rev 268753)
+++ branches/safari-611.1.4-branch/LayoutTests/TestExpectations	2020-10-20 20:10:17 UTC (rev 268754)
@@ -4518,10 +4518,3 @@
 
 fast/layoutformattingcontext/ [ ImageOnlyFailure ]
 webkit.org/b/217054 fast/layoutformattingcontext/horizontal-sizing-with-trailing-letter-spacing.html [ Skip ]
-
-webkit.org/b/217851 transitions/interrupted-transition-hardware.html [ Pass Failure ]
-webkit.org/b/217851 webanimations/accelerated-transform-related-animation-property-order.html [ Pass Failure ]
-webkit.org/b/217851 webanimations/accelerated-translate-animation-additional-animation-added-in-flight.html [ Pass Failure ]
-webkit.org/b/217851 webanimations/accelerated-translate-animation-underlying-transform-changed-in-flight.html [ Pass Failure ]
-webkit.org/b/217851 webanimations/accelerated-translate-animation-with-transform.html [ Pass Failure ]
-webkit.org/b/217851 webanimations/accelerated-translate-animation.html [ Pass Failure ]

Modified: branches/safari-611.1.4-branch/LayoutTests/platform/mac/TestExpectations (268753 => 268754)


--- branches/safari-611.1.4-branch/LayoutTests/platform/mac/TestExpectations	2020-10-20 20:10:13 UTC (rev 268753)
+++ branches/safari-611.1.4-branch/LayoutTests/platform/mac/TestExpectations	2020-10-20 20:10:17 UTC (rev 268754)
@@ -2246,12 +2246,3 @@
 
 webkit.org/b/217620 inspector/audit/basic-async.htm [ Pass Timeout ]
 
-
-# These are failing on Mojave due to an error in the way CA animations are applied.
-# https://bugs.webkit.org/show_bug.cgi?id=217842
-[ Mojave ] transitions/interrupted-transition-hardware.html [ Pass Failure ]
-[ Mojave ] webanimations/accelerated-transform-related-animation-property-order.html [ Pass Failure ]
-[ Mojave ] webanimations/accelerated-translate-animation-additional-animation-added-in-flight.html [ Pass Failure ]
-[ Mojave ] webanimations/accelerated-translate-animation-underlying-transform-changed-in-flight.html [ Pass Failure ]
-[ Mojave ] webanimations/accelerated-translate-animation-with-transform.html [ Pass Failure ]
-[ Mojave ] webanimations/accelerated-translate-animation.html [ Pass Failure ]

Modified: branches/safari-611.1.4-branch/LayoutTests/platform/win/TestExpectations (268753 => 268754)


--- branches/safari-611.1.4-branch/LayoutTests/platform/win/TestExpectations	2020-10-20 20:10:13 UTC (rev 268753)
+++ branches/safari-611.1.4-branch/LayoutTests/platform/win/TestExpectations	2020-10-20 20:10:17 UTC (rev 268754)
@@ -4586,3 +4586,8 @@
 webkit.org/b/217812 transforms/2d/rotate-change-composited.html [ Skip ]
 webkit.org/b/217812 transforms/2d/translate-change-composited.html [ Skip ]
 webkit.org/b/217812 transforms/2d/rotate-composited.html [ Skip ]
+webkit.org/b/217812 webanimations/accelerated-transform-related-animation-property-order.html [ Skip ]
+webkit.org/b/217812 webanimations/accelerated-translate-animation-additional-animation-added-in-flight.html [ Skip ]
+webkit.org/b/217812 webanimations/accelerated-translate-animation-underlying-transform-changed-in-flight.html [ Skip ]
+webkit.org/b/217812 webanimations/accelerated-translate-animation-with-transform.html [ Skip ]
+webkit.org/b/217812 webanimations/accelerated-translate-animation.html [ Skip ]

Modified: branches/safari-611.1.4-branch/Source/WebCore/ChangeLog (268753 => 268754)


--- branches/safari-611.1.4-branch/Source/WebCore/ChangeLog	2020-10-20 20:10:13 UTC (rev 268753)
+++ branches/safari-611.1.4-branch/Source/WebCore/ChangeLog	2020-10-20 20:10:17 UTC (rev 268754)
@@ -1,5 +1,73 @@
 2020-10-20  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r268746. rdar://problem/70497736
+
+    REGRESSION(r268615): some accelerated transform tests are failing
+    https://bugs.webkit.org/show_bug.cgi?id=217851
+    <rdar://problem/70394402>
+    
+    Reviewed by Dean Jackson.
+    
+    Source/WebCore:
+    
+    When we added support for accelerated individual transform properties animations, we added
+    the notion of base transform animations which are used to set the base value of any
+    transform-related property that is not animated.
+    
+    Those animations were defined to start as early as possible, assuming that a very small value
+    after 0s was as early as possible. However, it's possible that other animations start with a
+    negative time if they have a delay or are seeked, if the value returned by CACurrentMediaTime()
+    is smaller than that delay. This means that if the machine had been booted for less time than
+    an accelerated animation's delay, the base transform animation wouldn't overlap.
+    
+    We now ensure that those base transform animations start as early as the earliest animation
+    that is being committed in a call to GraphicsLayerCA::updateAnimations().
+    
+    * platform/graphics/ca/GraphicsLayerCA.cpp:
+    (WebCore::GraphicsLayerCA::updateAnimations):
+    (WebCore::GraphicsLayerCA::setAnimationOnLayer):
+    * platform/graphics/ca/GraphicsLayerCA.h:
+    (WebCore::GraphicsLayerCA::LayerPropertyAnimation::computedBeginTime const):
+    
+    LayoutTests:
+    
+    Remove flaky epectations for affected tests and skip tests on Windows where failures remain.
+    
+    * TestExpectations:
+    * platform/mac/TestExpectations:
+    * platform/win/TestExpectations:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@268746 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-10-20  Antoine Quint  <grao...@webkit.org>
+
+            REGRESSION(r268615): some accelerated transform tests are failing
+            https://bugs.webkit.org/show_bug.cgi?id=217851
+            <rdar://problem/70394402>
+
+            Reviewed by Dean Jackson.
+
+            When we added support for accelerated individual transform properties animations, we added
+            the notion of base transform animations which are used to set the base value of any
+            transform-related property that is not animated.
+
+            Those animations were defined to start as early as possible, assuming that a very small value
+            after 0s was as early as possible. However, it's possible that other animations start with a
+            negative time if they have a delay or are seeked, if the value returned by CACurrentMediaTime()
+            is smaller than that delay. This means that if the machine had been booted for less time than
+            an accelerated animation's delay, the base transform animation wouldn't overlap.
+
+            We now ensure that those base transform animations start as early as the earliest animation
+            that is being committed in a call to GraphicsLayerCA::updateAnimations().
+
+            * platform/graphics/ca/GraphicsLayerCA.cpp:
+            (WebCore::GraphicsLayerCA::updateAnimations):
+            (WebCore::GraphicsLayerCA::setAnimationOnLayer):
+            * platform/graphics/ca/GraphicsLayerCA.h:
+            (WebCore::GraphicsLayerCA::LayerPropertyAnimation::computedBeginTime const):
+
+2020-10-20  Alan Coon  <alanc...@apple.com>
+
         Revert r268446. rdar://problem/70497386
 
 2020-10-17  Darin Adler  <da...@apple.com>

Modified: branches/safari-611.1.4-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (268753 => 268754)


--- branches/safari-611.1.4-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2020-10-20 20:10:13 UTC (rev 268753)
+++ branches/safari-611.1.4-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2020-10-20 20:10:17 UTC (rev 268754)
@@ -2861,6 +2861,25 @@
 
 void GraphicsLayerCA::updateAnimations()
 {
+    auto baseTransformAnimationBeginTime = 1_s;
+    auto currentTime = Seconds(CACurrentMediaTime());
+    auto updateBeginTimes = [&](LayerPropertyAnimation& animation)
+    {
+        if (animation.m_pendingRemoval)
+            return;
+
+        // In case we have an offset, and we haven't set an explicit begin time previously,
+        // we need to record the beginTime now.
+        if (animation.m_timeOffset && !animation.m_beginTime)
+            animation.m_beginTime = currentTime;
+
+        // Now check if we have a resolved begin time and ensure the begin time we'll use for
+        // base transform animations matches the smallest known begin time to guarantee that
+        // such animations can combine with other explicit transform animations correctly.
+        if (auto computedBeginTime = animation.computedBeginTime())
+            baseTransformAnimationBeginTime = std::min(baseTransformAnimationBeginTime, *computedBeginTime);
+    };
+
     enum class Additive { Yes, No };
     auto addAnimation = [&](LayerPropertyAnimation& animation, Additive additive = Additive::Yes) {
         animation.m_animation->setAdditive(additive == Additive::Yes);
@@ -2890,7 +2909,7 @@
         auto animation = LayerPropertyAnimation(WTFMove(caAnimation), "base-transform-" + createCanonicalUUIDString(), property, 0, 0, 0_s);
         // To ensure the base value transform is applied along with all the interpolating animations, we set it to have started
         // as early as possible, which combined with the infinite duration ensures it's current for any given CA media time.
-        animation.m_beginTime = Seconds::fromNanoseconds(1);
+        animation.m_beginTime = baseTransformAnimationBeginTime;
 
         // Additivity will depend on the source of the matrix, if it was explicitly provided as an identity matrix, it
         // is the initial base value transform animation and must override the current transform value for this layer.
@@ -2900,8 +2919,10 @@
         m_baseValueTransformAnimations.append(WTFMove(animation));
     };
 
-    // Remove all running CA animations.
+    // Iterate through all animations to update each animation's begin time, if necessary,
+    // compute the base transform animation begin times and remove all running CA animations.
     for (auto& animation : m_animations) {
+        updateBeginTimes(animation);
         if (animation.m_playState == PlayState::Playing || animation.m_playState == PlayState::Paused)
             removeCAAnimationFromLayer(animation);
     }
@@ -3021,18 +3042,8 @@
 
     auto& caAnim = *animation.m_animation;
 
-    if (animation.m_timeOffset) {
-        // In case we have an offset, we need to record the beginTime now since we have to pass in an explicit
-        // value in the first place.
-        if (!animation.m_beginTime)
-            animation.m_beginTime = Seconds(CACurrentMediaTime());
-        caAnim.setBeginTime((animation.m_beginTime - animation.m_timeOffset).seconds());
-    } else if (animation.m_beginTime) {
-        // If we already have a begin time, then we already started in the past and must ensure we use that same
-        // begin time. Any other case will get use the CA transaction's time as its begin time and will be recorded
-        // in platformCALayerAnimationStarted().
-        caAnim.setBeginTime(animation.m_beginTime.seconds());
-    }
+    if (auto beginTime = animation.computedBeginTime())
+        caAnim.setBeginTime(beginTime->seconds());
 
     String animationID = animation.animationIdentifier();
 

Modified: branches/safari-611.1.4-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (268753 => 268754)


--- branches/safari-611.1.4-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2020-10-20 20:10:13 UTC (rev 268753)
+++ branches/safari-611.1.4-branch/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h	2020-10-20 20:10:17 UTC (rev 268754)
@@ -30,6 +30,7 @@
 #include "PlatformCALayer.h"
 #include "PlatformCALayerClient.h"
 #include <wtf/HashMap.h>
+#include <wtf/Optional.h>
 #include <wtf/RetainPtr.h>
 #include <wtf/text/StringHash.h>
 
@@ -462,6 +463,12 @@
         { }
 
         String animationIdentifier() const { return makeString(m_name, '_', static_cast<unsigned>(m_property), '_', m_index, '_', m_subIndex); }
+        Optional<Seconds> computedBeginTime() const
+        {
+            if (m_beginTime)
+                return m_beginTime - m_timeOffset;
+            return WTF::nullopt;
+        }
 
         RefPtr<PlatformCAAnimation> m_animation;
         String m_name;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to