Title: [265098] trunk
Revision
265098
Author
grao...@webkit.org
Date
2020-07-30 14:51:39 -0700 (Thu, 30 Jul 2020)

Log Message

[ iOS ] webanimations/accelerated-animation-with-easing.html is still flaky
https://bugs.webkit.org/show_bug.cgi?id=214327
<rdar://problem/65569237>

Reviewed by Dean Jackson.

Source/WebKit:

When we fixed bug 213495 in r263506, we started calling PlatformCAAnimation::setTimingFunction()
to set the animation-wide timing function of CSS Animations and JS-originated animations alike.
However, we neglected to update PlatformCAAnimationRemote, used on iOS, to be able to handle
both animation-wide timing functions as well as keyframe-specific timing functions. This patch
adds a new "timingFunction" member to PlatformCAAnimationRemote::Properties to allow for this
and this new member is used in setTimingFunction() and copyTimingFunctionFrom(). Finally, after
the animation is decoded in the UI process, we call -[CAKeyframeAnimation setTimingFunction:]
inside addAnimationToLayer() to use this animation-wide timing function.

This fixes the test added originally in r263506 which would only work flakily, a symptom of this
missing implementation on iOS.

* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(WebKit::encodeTimingFunction):
(WebKit::decodeTimingFunction):
(WebKit::PlatformCAAnimationRemote::Properties::encode const):
(WebKit::PlatformCAAnimationRemote::Properties::decode):
(WebKit::PlatformCAAnimationRemote::setTimingFunction):
(WebKit::PlatformCAAnimationRemote::copyTimingFunctionFrom):
(WebKit::addAnimationToLayer):
(WebKit::operator<<):

LayoutTests:

Remove the flaky expectation and remove the extra tolerance added in r263761 when it was thought that
this test was merely flaky and not completely broken on iOS as it turned out to be.

* platform/ios-wk2/TestExpectations:
* webanimations/accelerated-animation-with-easing.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (265097 => 265098)


--- trunk/LayoutTests/ChangeLog	2020-07-30 21:44:45 UTC (rev 265097)
+++ trunk/LayoutTests/ChangeLog	2020-07-30 21:51:39 UTC (rev 265098)
@@ -1,3 +1,17 @@
+2020-07-30  Antoine Quint  <grao...@webkit.org>
+
+        [ iOS ] webanimations/accelerated-animation-with-easing.html is still flaky
+        https://bugs.webkit.org/show_bug.cgi?id=214327
+        <rdar://problem/65569237>
+
+        Reviewed by Dean Jackson.
+
+        Remove the flaky expectation and remove the extra tolerance added in r263761 when it was thought that
+        this test was merely flaky and not completely broken on iOS as it turned out to be.
+
+        * platform/ios-wk2/TestExpectations:
+        * webanimations/accelerated-animation-with-easing.html:
+
 2020-07-30  Kenneth Russell  <k...@chromium.org>
 
         [WebGL2] Enable conformance2/textures/{image,video} and related layout tests

Modified: trunk/LayoutTests/platform/ios-wk2/TestExpectations (265097 => 265098)


--- trunk/LayoutTests/platform/ios-wk2/TestExpectations	2020-07-30 21:44:45 UTC (rev 265097)
+++ trunk/LayoutTests/platform/ios-wk2/TestExpectations	2020-07-30 21:51:39 UTC (rev 265098)
@@ -1772,8 +1772,6 @@
 
 webkit.org/b/214322 [ Debug ] http/tests/workers/worker-importScripts-banned-mimetype.html [ Pass Crash ]
 
-webkit.org/b/214327 webanimations/accelerated-animation-with-easing.html [ Pass ImageOnlyFailure ]
-
 webkit.org/b/214363 [ Debug ] fast/text-indicator/text-indicator-empty-link.html [ Pass Crash ]
 
 webkit.org/b/214382 [ Release ] imported/w3c/web-platform-tests/websockets/remove-own-iframe-during-onerror.window.html [ Pass Failure ]

Modified: trunk/LayoutTests/webanimations/accelerated-animation-with-easing.html (265097 => 265098)


--- trunk/LayoutTests/webanimations/accelerated-animation-with-easing.html	2020-07-30 21:44:45 UTC (rev 265097)
+++ trunk/LayoutTests/webanimations/accelerated-animation-with-easing.html	2020-07-30 21:51:39 UTC (rev 265098)
@@ -16,8 +16,8 @@
 
     /* Allow for a 1px error on either side */
     #easing-on-keyframe {
-        left: -2px;
-        width: 104px;
+        left: -1px;
+        width: 102px;
         background-color: green;
     }
 

Modified: trunk/Source/WebKit/ChangeLog (265097 => 265098)


--- trunk/Source/WebKit/ChangeLog	2020-07-30 21:44:45 UTC (rev 265097)
+++ trunk/Source/WebKit/ChangeLog	2020-07-30 21:51:39 UTC (rev 265098)
@@ -1,3 +1,34 @@
+2020-07-30  Antoine Quint  <grao...@webkit.org>
+
+        [ iOS ] webanimations/accelerated-animation-with-easing.html is still flaky
+        https://bugs.webkit.org/show_bug.cgi?id=214327
+        <rdar://problem/65569237>
+
+        Reviewed by Dean Jackson.
+
+        When we fixed bug 213495 in r263506, we started calling PlatformCAAnimation::setTimingFunction()
+        to set the animation-wide timing function of CSS Animations and JS-originated animations alike.
+        However, we neglected to update PlatformCAAnimationRemote, used on iOS, to be able to handle
+        both animation-wide timing functions as well as keyframe-specific timing functions. This patch
+        adds a new "timingFunction" member to PlatformCAAnimationRemote::Properties to allow for this
+        and this new member is used in setTimingFunction() and copyTimingFunctionFrom(). Finally, after
+        the animation is decoded in the UI process, we call -[CAKeyframeAnimation setTimingFunction:]
+        inside addAnimationToLayer() to use this animation-wide timing function.
+
+        This fixes the test added originally in r263506 which would only work flakily, a symptom of this
+        missing implementation on iOS.
+
+        * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
+        * WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
+        (WebKit::encodeTimingFunction):
+        (WebKit::decodeTimingFunction):
+        (WebKit::PlatformCAAnimationRemote::Properties::encode const):
+        (WebKit::PlatformCAAnimationRemote::Properties::decode):
+        (WebKit::PlatformCAAnimationRemote::setTimingFunction):
+        (WebKit::PlatformCAAnimationRemote::copyTimingFunctionFrom):
+        (WebKit::addAnimationToLayer):
+        (WebKit::operator<<):
+
 2020-07-30  Jer Noble  <jer.no...@apple.com>
 
         [Cocoa] Make DecoderTest run against .mp4 files; add rate-limiting.

Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h (265097 => 265098)


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h	2020-07-30 21:44:45 UTC (rev 265097)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h	2020-07-30 21:51:39 UTC (rev 265098)
@@ -276,6 +276,7 @@
 
         PlatformCAAnimation::FillModeType fillMode;
         PlatformCAAnimation::ValueFunctionType valueFunction;
+        RefPtr<WebCore::TimingFunction> timingFunction;
 
         bool autoReverses;
         bool removedOnCompletion;

Modified: trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm (265097 => 265098)


--- trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm	2020-07-30 21:44:45 UTC (rev 265097)
+++ trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm	2020-07-30 21:51:39 UTC (rev 265098)
@@ -153,6 +153,63 @@
     return WTFMove(value);
 }
 
+static void encodeTimingFunction(IPC::Encoder& encoder, TimingFunction* timingFunction)
+{
+    switch (timingFunction->type()) {
+    case TimingFunction::LinearFunction:
+        encoder << *static_cast<LinearTimingFunction*>(timingFunction);
+        break;
+
+    case TimingFunction::CubicBezierFunction:
+        encoder << *static_cast<CubicBezierTimingFunction*>(timingFunction);
+        break;
+
+    case TimingFunction::StepsFunction:
+        encoder << *static_cast<StepsTimingFunction*>(timingFunction);
+        break;
+
+    case TimingFunction::SpringFunction:
+        encoder << *static_cast<SpringTimingFunction*>(timingFunction);
+        break;
+    }
+}
+
+static Optional<RefPtr<TimingFunction>> decodeTimingFunction(IPC::Decoder& decoder)
+{
+    TimingFunction::TimingFunctionType type;
+    if (!decoder.decode(type))
+        return WTF::nullopt;
+
+    RefPtr<TimingFunction> timingFunction;
+    switch (type) {
+    case TimingFunction::LinearFunction:
+        timingFunction = LinearTimingFunction::create();
+        if (!decoder.decode(*static_cast<LinearTimingFunction*>(timingFunction.get())))
+            return WTF::nullopt;
+        break;
+
+    case TimingFunction::CubicBezierFunction:
+        timingFunction = CubicBezierTimingFunction::create();
+        if (!decoder.decode(*static_cast<CubicBezierTimingFunction*>(timingFunction.get())))
+            return WTF::nullopt;
+        break;
+
+    case TimingFunction::StepsFunction:
+        timingFunction = StepsTimingFunction::create();
+        if (!decoder.decode(*static_cast<StepsTimingFunction*>(timingFunction.get())))
+            return WTF::nullopt;
+        break;
+
+    case TimingFunction::SpringFunction:
+        timingFunction = SpringTimingFunction::create();
+        if (!decoder.decode(*static_cast<SpringTimingFunction*>(timingFunction.get())))
+            return WTF::nullopt;
+        break;
+    }
+
+    return timingFunction;
+}
+
 void PlatformCAAnimationRemote::Properties::encode(IPC::Encoder& encoder) const
 {
     encoder << keyPath;
@@ -166,6 +223,7 @@
 
     encoder << fillMode;
     encoder << valueFunction;
+    encodeTimingFunction(encoder, timingFunction.get());
 
     encoder << autoReverses;
     encoder << removedOnCompletion;
@@ -177,25 +235,8 @@
     encoder << keyTimes;
     
     encoder << static_cast<uint64_t>(timingFunctions.size());
-    for (const auto& timingFunction : timingFunctions) {
-        switch (timingFunction->type()) {
-        case TimingFunction::LinearFunction:
-            encoder << *static_cast<LinearTimingFunction*>(timingFunction.get());
-            break;
-            
-        case TimingFunction::CubicBezierFunction:
-            encoder << *static_cast<CubicBezierTimingFunction*>(timingFunction.get());
-            break;
-        
-        case TimingFunction::StepsFunction:
-            encoder << *static_cast<StepsTimingFunction*>(timingFunction.get());
-            break;
-
-        case TimingFunction::SpringFunction:
-            encoder << *static_cast<SpringTimingFunction*>(timingFunction.get());
-            break;
-        }
-    }
+    for (const auto& timingFunction : timingFunctions)
+        encodeTimingFunction(encoder, timingFunction.get());
 }
 
 Optional<PlatformCAAnimationRemote::Properties> PlatformCAAnimationRemote::Properties::decode(IPC::Decoder& decoder)
@@ -228,6 +269,11 @@
     if (!decoder.decode(properties.valueFunction))
         return WTF::nullopt;
 
+    if (auto timingFunction = decodeTimingFunction(decoder))
+        properties.timingFunction = WTFMove(*timingFunction);
+    else
+        return WTF::nullopt;
+
     if (!decoder.decode(properties.autoReverses))
         return WTF::nullopt;
 
@@ -257,39 +303,10 @@
         properties.timingFunctions.reserveInitialCapacity(numTimingFunctions);
 
         for (size_t i = 0; i < numTimingFunctions; ++i) {
-        
-            TimingFunction::TimingFunctionType type;
-            if (!decoder.decode(type))
+            if (auto timingFunction = decodeTimingFunction(decoder))
+                properties.timingFunctions.uncheckedAppend(WTFMove(*timingFunction));
+            else
                 return WTF::nullopt;
-
-            RefPtr<TimingFunction> timingFunction;
-            switch (type) {
-            case TimingFunction::LinearFunction:
-                timingFunction = LinearTimingFunction::create();
-                if (!decoder.decode(*static_cast<LinearTimingFunction*>(timingFunction.get())))
-                    return WTF::nullopt;
-                break;
-                
-            case TimingFunction::CubicBezierFunction:
-                timingFunction = CubicBezierTimingFunction::create();
-                if (!decoder.decode(*static_cast<CubicBezierTimingFunction*>(timingFunction.get())))
-                    return WTF::nullopt;
-                break;
-            
-            case TimingFunction::StepsFunction:
-                timingFunction = StepsTimingFunction::create();
-                if (!decoder.decode(*static_cast<StepsTimingFunction*>(timingFunction.get())))
-                    return WTF::nullopt;
-                break;
-
-            case TimingFunction::SpringFunction:
-                timingFunction = SpringTimingFunction::create();
-                if (!decoder.decode(*static_cast<SpringTimingFunction*>(timingFunction.get())))
-                    return WTF::nullopt;
-                break;
-            }
-            
-            properties.timingFunctions.uncheckedAppend(WTFMove(timingFunction));
         }
     }
 
@@ -421,18 +438,16 @@
     m_properties.fillMode = value;
 }
 
-void PlatformCAAnimationRemote::setTimingFunction(const TimingFunction* value, bool reverse)
+void PlatformCAAnimationRemote::setTimingFunction(const TimingFunction* value, bool)
 {
-    Vector<RefPtr<TimingFunction>> timingFunctions;
-    timingFunctions.append(value->clone());
-
-    m_properties.timingFunctions = WTFMove(timingFunctions);
-    m_properties.reverseTimingFunctions = reverse;
+    RefPtr<TimingFunction> timingFunction = value->clone();
+    m_properties.timingFunction = WTFMove(timingFunction);
 }
 
 void PlatformCAAnimationRemote::copyTimingFunctionFrom(const PlatformCAAnimation& value)
 {
-    copyTimingFunctionsFrom(value);
+    const PlatformCAAnimationRemote& other = downcast<PlatformCAAnimationRemote>(value);
+    m_properties.timingFunction = other.m_properties.timingFunction;
 }
 
 bool PlatformCAAnimationRemote::isRemovedOnCompletion() const
@@ -720,10 +735,10 @@
             [basicAnimation setFromValue:animationValueFromKeyframeValue(properties.keyValues[0])];
             [basicAnimation setToValue:animationValueFromKeyframeValue(properties.keyValues[1])];
         }
-        
+
         if (properties.timingFunctions.size())
             [basicAnimation setTimingFunction:toCAMediaTimingFunction(properties.timingFunctions[0].get(), properties.reverseTimingFunctions)];
-        
+
         caAnimation = basicAnimation;
         break;
     }
@@ -742,6 +757,9 @@
             }).get()];
         }
 
+        if (properties.timingFunction)
+            [keyframeAnimation setTimingFunction:toCAMediaTimingFunction(properties.timingFunction.get(), false)]; // FIXME: handle reverse.
+
         if (properties.timingFunctions.size()) {
             [keyframeAnimation setTimingFunctions:createNSArray(properties.timingFunctions, [&] (auto& function) {
                 return toCAMediaTimingFunction(function.get(), properties.reverseTimingFunctions);
@@ -870,6 +888,7 @@
 
     ts.dumpProperty("fillMode", animation.fillMode);
     ts.dumpProperty("valueFunction", animation.valueFunction);
+    ts.dumpProperty<const TimingFunction&>("timing function", *animation.timingFunction);
 
     if (animation.autoReverses)
         ts.dumpProperty("autoReverses", animation.autoReverses);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to