window.alert blocks main-thread animations
Reported by
jiangyue...@gmail.com,
Sep 17
|
|||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36 Steps to reproduce the problem: 1. keyframes animation with fraction in transform 2. 3. I write a codepen , https://codepen.io/latpaw/pen/JaaqmJ What is the expected behavior? it should work What went wrong? the animation stopped Did this work before? N/A Does this work in other browsers? Yes Chrome version: 69.0.3497.92 Channel: stable OS Version: OS X 10.13.6 Flash Version:
,
Sep 17
The difference is that the first animation is composited and the second is not (due to the %). Adding 'background: red;' to the first animation will also cause it to block (as it will be forced onto the main thread). Testing other browsers (using http://output.jsbin.com/nekerop + browserstack): Firefox: Doesn't block the animation. Edge: Doesn't block the animation. Safari: Doesn't block the animation. So looks like this is a Chrome-only issue, we should address it. The implications may be rather large, however, depending on why we are't ticking animations (e.g. is the whole of blink blocked?)
,
Sep 17
Eugh, the above information is tainted by split-thread animations on Edge and Safari, and may be tainted if Firefox composites color animations. Please ignore #2, I'm going to redo the test.
,
Sep 17
Ok, so it turns out that all the browsers are consistent apart from Firefox. http://output.jsbin.com/nekerop is an updated test that now animates height (which is definitely absolutely main thread) Chrome: main pauses, split pauses (since we don't support split animations), composited keeps going Firefox: keeps running all three including main-thread! Edge: main pauses, split pauses color but keeps transform going, compositor keeps going Safari: main pauses, split pauses color but keeps transform going, compositor keeps going In terms of Chrome, we view this as a WontFix. The spec allows the user-agent to pause main-thread operators at will for alert (https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-alert), and our compositor behavior is aligned with all three other browsers. Firefox is really the odd-one-out as they continue to animate main. We are currently discussing implementing split-thread animations in Chrome, given all other browsers appear to support it. Thank you for the bug report though, I learnt a lot today about split-animation support and composited/main animations! |
|||
►
Sign in to add a comment |
|||
Comment 1 by xidac...@chromium.org
, Sep 17