Skip to content

[css-view-transitions-1] when to update the pseudo element styles #7812

Closed
@vmpstr

Description

@vmpstr

Shared Element Transition spec describes pseudo elements that are containers, and that they should animate, for example, from the outgoing element's transform to the new element's transform.

Since this is done with CSS animations, we would need to keep these animations up to date to reflect any changes to the represented element.

Consider the animation is started, and then the represented element is moved around in a setTimeout. Does the animation update any time the represented element changes? Or is there a particular time at which we "update" the pseudo element styles?

I propose that we only update the styles once per frame, around rAF timing. This is still likely to cause us to update the style & layout twice, since we need the first time to determine the represented element's properties, then apply those to the pseudo elements which will cause a style invalidation and run a second style & layout to produce the visual frame.

The only way I can think of to avoid the "double render" is to always lag one frame behind when updating these pseudo element styles, but that doesn't seem ideal

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions