NEW225871
Transition started from requestAnimationFrame differs from other browsers
https://bugs.webkit.org/show_bug.cgi?id=225871
Summary Transition started from requestAnimationFrame differs from other browsers
Simon Fraser (smfr)
Reported 2021-05-17 08:09:55 PDT
https://safari-raf-bug.glitch.me shows an issue where WebKit behavior differs from Chrome and Firefox. The testcase is: document.querySelector('button').addEventListener('click', () => { const test = document.querySelector('.test'); test.style.transform = 'translate(400px, 0)'; requestAnimationFrame(() => { test.style.transition = 'transform 3s linear'; test.style.transform = 'translate(200px, 0)'; }); }); Safari transitions from 400px to 200px. Other browsers transition from 0 to 200px;
Attachments
Test (1.27 KB, text/html)
2021-05-18 00:40 PDT, Antoine Quint
no flags
screen recording safari, firefox, chrome (1.39 MB, video/quicktime)
2024-08-12 03:29 PDT, Karl Dubost
no flags
Antoine Quint
Comment 1 2021-05-18 00:40:05 PDT
Created attachment 428917 [details] Test I rewrote the test to make it so the transition can be re-started and not using transform to remove accelerated animations from the equation. This may be a style resolution issue where we see the style as the value set on the inline style before the animation frame is triggered, where other browsers don't. Indeed, forcing a style recalc by calling getComputedStyle() after the animation frame shows the same behavior across browsers.
Simon Fraser (smfr)
Comment 2 2021-05-18 09:17:44 PDT
Does it reproduce with a software animation (e.g. on 'left')?
Antoine Quint
Comment 3 2021-05-18 12:59:42 PDT
(In reply to Simon Fraser (smfr) from comment #2) > Does it reproduce with a software animation (e.g. on 'left')? Yes, the test I've attached uses margin-left. This has been broken for a long time, I tried with r236648, the oldest I could find for my system, and it was already broken this way.
Radar WebKit Bug Importer
Comment 4 2021-05-24 08:10:20 PDT
Andrea
Comment 5 2024-08-08 03:01:42 PDT
Hey, this bug is opened for a long time and still seems to be there. Are there any updates?
Karl Dubost
Comment 6 2024-08-12 03:23:42 PDT
Apart of the interop bug that would be good to be fixed, are there any live websites currently broken because of this behavior? Or sites trying to work around?
Karl Dubost
Comment 7 2024-08-12 03:29:31 PDT
Created attachment 472120 [details] screen recording safari, firefox, chrome screen recording in Safari Technology Preview 199 20620.1.1 Firefox Nightly 130.0a1 13024.8.4 Google Chrome Canary 129.0.6641.0 6641.0 Notes: Safari and Chrome behave the same way Firefox is different
Note You need to log in before you can comment on or make changes to this bug.