| Summary: | REGRESSION (r256095): Adding a border-radius, border, or box-shadow breaks animations from scale(0) | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Mattan Ingram <mattaningram> | ||||||||
| Component: | Animations | Assignee: | Antoine Quint <graouts> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | dino, graouts, graouts, koivisto, milesingrams, simon.fraser, smoley, webkit-bug-importer, zalan | ||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||
| Version: | Safari 14 | ||||||||||
| Hardware: | Mac | ||||||||||
| OS: | macOS 10.15 | ||||||||||
| URL: | https://codepen.io/mattaningram/pen/zYBdjRq | ||||||||||
| See Also: |
https://bugs.webkit.org/show_bug.cgi?id=207434 https://bugs.webkit.org/show_bug.cgi?id=227733 |
||||||||||
| Attachments: |
|
||||||||||
|
Description
Mattan Ingram
2020-10-29 20:14:11 PDT
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. 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. |