RESOLVED FIXED Bug 202489
Box-shadow spread radius does not transition or animate correctly with CSS Transitions & Animations
https://bugs.webkit.org/show_bug.cgi?id=202489
Summary Box-shadow spread radius does not transition or animate correctly with CSS Tr...
Kyle Bavender
Reported 2019-10-02 12:59:35 PDT
I am conducting browser tests on Safari and found that its behavior when rendering box-shadow spread-radius between two different values in a CSS (keyframes) animation does not match that of Chrome/Firefox/IE/Edge. It appears to also be an issue with CSS Transitions. I am not familiar with this detail of the box-shadow or animation specifications, but the (would one call this sub-pixel rendering, or tweening?) behaviors exhibited by other browsers make for markedly cleaner animations. My test case and examples can be found here: https://codepen.io/kbav/pen/eYOqKBQ?editors=0100#0 Tested in Safari Technology Preview, 13, 12, 11, & 10. Other browsers are using the latest public versions as of this writing. Let me know if I can provide any further detail or assistance.
Attachments
Patch (42.15 KB, patch)
2019-11-05 16:57 PST, Simon Fraser (smfr)
zalan: review+
Radar WebKit Bug Importer
Comment 1 2019-10-04 17:08:05 PDT
Ken Hawkins
Comment 2 2019-10-31 04:23:24 PDT
We've also noticed the issue with "sub-pixel stutter" on box-shadow animation in Safari. (So far confirmed in Mac OS 10.14 Safari Version 12.1.2 (14607.3.9) and Mac OS 10.15) Our demo of the issue: https://codepen.io/khawkins98/pen/ZEEaBME We've tried the usual `transformZ` and `will-change` techniques and none have helped.
Simon Fraser (smfr)
Comment 3 2019-10-31 10:58:30 PDT
Could you file that stutter as a new bug please.
Simon Fraser (smfr)
Comment 4 2019-11-04 18:08:47 PST
We store and animate the spread value as an int, and it should be floating point.
Simon Fraser (smfr)
Comment 5 2019-11-05 16:57:59 PST
zalan
Comment 6 2019-11-06 10:24:45 PST
Comment on attachment 382864 [details] Patch v.nice
Simon Fraser (smfr)
Comment 7 2019-11-06 16:41:49 PST
Truitt Savell
Comment 8 2019-11-07 10:00:18 PST
It looks like the changes in r252161 caused 3 tests to time out on Mac and iOS: transitions/multiple-shadow-transitions.html transitions/cubic-bezier-overflow-shadow.html legacy-animation-engine/transitions/cubic-bezier-overflow-shadow.html I was able to reproduce these timeouts using command: run-webkit-tests transitions/multiple-shadow-transitions.html transitions/cubic-bezier-overflow-shadow.html legacy-animation-engine/transitions/cubic-bezier-overflow-shadow.html --iterations 20 -f They reproduce on r252161 but not r252160. Tracking in: https://bugs.webkit.org/show_bug.cgi?id=203966
Simon Fraser (smfr)
Comment 9 2019-11-07 13:09:11 PST
Kyle Bavender
Comment 10 2019-11-08 06:44:29 PST
I re-tested the attached test case URL/CodePen with Webkit r252161; while the spread animation isn’t quite as smooth as Chrome or Firefox’s (it appears they do something akin to anti-aliasing / allowing subpixel values to spread with partial opacity), it’s definitely a smoother animation overall. Thank you Simon & the WebKit team for addressing this!
Antoine Quint
Comment 11 2019-11-19 03:33:28 PST
This caused a regression, see https://bugs.webkit.org/show_bug.cgi?id=204348.
Antoine Quint
Comment 12 2020-05-06 14:36:16 PDT
This caused another regression, see bug 211530.
Note You need to log in before you can comment on or make changes to this bug.