An element with a border-radius, box-shadow, border, or even just plain text will not render when running a keyframe animation from scale(0). https://codepen.io/mattaningram/pen/zYBdjRq Oddly if they are within a position: fixed element the animations render fine. Considering an animation from scale(0) is common, this must be impacting a number of websites.
This bug also occurs with transforms using scaleX(0) or scaleY(0).
Thanks for filing, I can reproduce this on Safari 13.1.3, 14.0.1 and 14.1 with the supplied test case.
<rdar://problem/70906316>
Created attachment 412911 [details] Test I've simplified the test case a bit. Some cases where the animations work as expected: - using `scale(0.0001)` instead of `scale(0)` - setting an explicit to-keyframe set to `scale(1)` - changing the from-keyframe to a to-keyframe
Created attachment 412912 [details] Test (Web Animations) Attached a different testcase where we use the Web Animations API instead: for (let element of Array.from(document.body.querySelectorAll(".test"))) element.animate({ transform: "scale(0)" }, 1000); There is also no visible animation in this case.
This regressed with macOS 10.15.4 / Safari 13.1, most likely when we switched over to the Web Animations engine.
We're animating the layers but we haven't painted anything into them.
This was not actually caused by the move to Web Animations but rather r256095, the fix for bug 207434.
The problem is we call setBackingStoreAttached() on the scale-0 layers at the start and never fix it later.
(In reply to Simon Fraser (smfr) from comment #9) > The problem is we call setBackingStoreAttached() on the scale-0 layers at > the start and never fix it later. setBackingStoreAttached(false), that is.
Adding a keyframe with non-zero scale fixes this.
One possible fix here would be to have KeyframeEffect::computeExtentOfTransformAnimation() include the implicit 0 and 100% keyframes.
Created attachment 430836 [details] Patch
Committed r278610 (238599@main): <https://commits.webkit.org/238599@main>
This failed to fix some cases: bug 227733.