transition is delayed (potentially skipping the whole transition duration) due to restyle and PaintAndRequestComposite, when too many elements are involved
Categories
(Core :: CSS Transitions and Animations, defect)
Tracking
()
People
(Reporter: afif.temani, Unassigned)
Details
(Keywords: perf)
Attachments
(2 files)
Steps to reproduce
Consider the following demo: https://codepen.io/t_afif/pen/OPpByBP/4a7946bca637725c10fb60bf23d142d5
The idea is to place many elements around a circle (or any shape) using offset then on hover we randomly translate them.
Actual results
The code works but we have no transition.
Expected results
The issue seems to be related to the number of elements because If I reduce them, the transition works fine: https://codepen.io/t_afif/pen/emvPpQe/714d8418213a8daf1a3e952d5d7ee2d4
Comment 1•1 month ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::Translations' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
| Reporter | ||
Updated•1 month ago
|
Comment 2•1 month ago
|
||
Comment 3•1 month ago
|
||
Comment 4•1 month ago
•
|
||
Testcase 2 illustrates that we do in fact play the transition, but there's a delay while we get it ready (and the delay happens to be long enough that it eats up the whole transition time from testcase 1, on my machine).
Comment 5•1 month ago
•
|
||
Profile of me hovering/unhovering the circle in testcase 2: https://share.firefox.dev/4iprTPg
Looks like we spend 100ms doing a restyle, and then 200ms in mozilla::PresShell::PaintAndRequestComposite, and then everything is smooth from that point onward. And in testcase 1, that ~300ms of prep work is whole duration of the transition, unfortunately.
Updated•1 month ago
|
Updated•1 month ago
|
Description
•