Open Bug 2087038 Opened 1 month ago Updated 1 month ago

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)

Firefox 161
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

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.

Component: Untriaged → Translations
Component: Translations → CSS Transitions and Animations
Product: Firefox → Core

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).

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.

Severity: -- → S3
Keywords: perf
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: transition not working when too many elements are involved → transition is delayed (potentially for the whole transition duration) due to restyle and PaintAndRequestComposite, when too many elements are involved
Summary: transition is delayed (potentially for the whole transition duration) due to restyle and PaintAndRequestComposite, when too many elements are involved → transition is delayed (potentially skipping the whole transition duration) due to restyle and PaintAndRequestComposite, when too many elements are involved
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: