RESOLVED FIXED 218371
REGRESSION (r256095): Adding a border-radius, border, or box-shadow breaks animations from scale(0)
https://bugs.webkit.org/show_bug.cgi?id=218371
Summary REGRESSION (r256095): Adding a border-radius, border, or box-shadow breaks an...
Mattan Ingram
Reported 2020-10-29 20:14:11 PDT
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.
Attachments
Test (776 bytes, text/html)
2020-11-02 06:22 PST, Antoine Quint
no flags
Test (Web Animations) (741 bytes, text/html)
2020-11-02 06:26 PST, Antoine Quint
no flags
Patch (5.46 KB, patch)
2021-06-08 07:23 PDT, Antoine Quint
simon.fraser: review+
ews-feeder: commit-queue-
Miles Ingram
Comment 1 2020-10-29 20:21:26 PDT
This bug also occurs with transforms using scaleX(0) or scaleY(0).
Smoley
Comment 2 2020-10-30 19:09:34 PDT
Thanks for filing, I can reproduce this on Safari 13.1.3, 14.0.1 and 14.1 with the supplied test case.
Radar WebKit Bug Importer
Comment 3 2020-10-30 19:09:48 PDT
Antoine Quint
Comment 4 2020-11-02 06:22:54 PST
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
Antoine Quint
Comment 5 2020-11-02 06:26:49 PST
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.
Antoine Quint
Comment 6 2020-11-02 06:50:15 PST
This regressed with macOS 10.15.4 / Safari 13.1, most likely when we switched over to the Web Animations engine.
Simon Fraser (smfr)
Comment 7 2020-11-02 08:04:20 PST
We're animating the layers but we haven't painted anything into them.
Antoine Quint
Comment 8 2021-05-27 11:49:22 PDT
This was not actually caused by the move to Web Animations but rather r256095, the fix for bug 207434.
Simon Fraser (smfr)
Comment 9 2021-06-01 10:07:47 PDT
The problem is we call setBackingStoreAttached() on the scale-0 layers at the start and never fix it later.
Simon Fraser (smfr)
Comment 10 2021-06-01 10:08:07 PDT
(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.
Simon Fraser (smfr)
Comment 11 2021-06-01 10:12:34 PDT
Adding a keyframe with non-zero scale fixes this.
Simon Fraser (smfr)
Comment 12 2021-06-01 10:15:11 PDT
One possible fix here would be to have KeyframeEffect::computeExtentOfTransformAnimation() include the implicit 0 and 100% keyframes.
Antoine Quint
Comment 13 2021-06-08 07:23:07 PDT
Antoine Quint
Comment 14 2021-06-08 09:28:02 PDT
Simon Fraser (smfr)
Comment 15 2021-07-06 21:14:12 PDT
This failed to fix some cases: bug 227733.
Note You need to log in before you can comment on or make changes to this bug.