[csswg-drafts] [css-shared-element-transitions-1] when to update the pseudo element styles (#7812)

vmpstr has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-shared-element-transitions-1] when to update the pseudo element styles ==
[Shared Element Transition spec](https://drafts.csswg.org/css-shared-element-transitions-1/) 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

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7812 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 30 September 2022 03:40:40 UTC