amp-animation & friends use incorrect keyframe easings on Safari 13.1
Description: Drop-in ads story animation works slow in Safari browser
Steps:
- launch local server on version 2004071640410
- open link http://localhost:8000/examples/amp-story-auto-ads.amp.html
- swipe to left until Drop-in story ads
- observe result.
Actual result: drop-in story ads animation works slow.
Expected result: drop-in story ads animation works should works fast.
/invite @Ichigo3d
An invitation to join ampproject has been sent to @Ichigo3d. I will update this thread when the invitation is accepted.
This on Safari 13.1 onwards since the WebAnimation API is now native
The discrepancy with other platforms is that Safari won't interpret easing in individual keyframes when the keyframes include transform.
This test case should do a stepped jump and then ease to the initial position. In Safari, this is a linear animation instead.
<div class="animated"></div>
<script>
document.querySelector(".animated").animate(
[
{
transform: "translateY(0px)",
easing: "step-start",
},
{
transform: "translateY(200px)",
},
{
transform: "translateY(0px)",
},
],
{
iterations: Infinity,
duration: 2000,
}
);
</script>
| Correct | Incorrect (no easings) |
|---|---|
![]() |
![]() |
Same problem with the amp-story drop animation described in this issue, case reproduced and isolated here.
We can rewrite amp-story preset keyframes so they don't use individual easings, but this would still be a problem with any <amp-animation> that uses this feature.
I'm working on finding a web platform test to provide a bug to WebKit. From AMP's side, we either force using the polyfill or wait for this to be resolved.
Filed WebKit bug https://bugs.webkit.org/show_bug.cgi?id=210526 Force polyfill as workaround in #27773
The invitation to @Ichigo3d was accepted!

