Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[web-animations-1] Require a style flush at the end of commitStyles #11085

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions web-animations-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -4877,6 +4877,22 @@ The {{Animation}} interface {#the-animation-interface}
calling this method <em>does</em> trigger a [=style change event=]
(see [[#model-liveness]]).

Furthermore,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this to work, do we not also have to require that both style flushes during commitStyles are part of the same style change event? Otherwise, transitions will be generated by the second flush?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not with the current setup. Either the animation is still applying in which case the changes to the inline style should be masked by the animation and no transition is generated, or the animation is not applied and commitStyles does nothing. Furthermore, the Gecko implementation of this PR passes all existing tests. Do you have any content in mind where a transition would be generated?

After #5394 is addressed we'd have to make sure that the first flush uses the non-endpoint exclusive timing but I think otherwise it works. (There may be some cases of layering animations where the result differs, however, I'm not sure.)

I think if we merge #6688 then this PR will not be needed but we'd need to do something else to address #5394.

after updating the style attribute of each effect target,
the user agent must ensure that the corresponding computed style
is updated.

<div class=note>

Without the requirement to update the computed style
at the end of the procedure,
calling `commitStyles` followed by immediately canceling an animation
could cause a transition to be generated since the changes to the
style attributes would not be reflected in the
[=before-change style=] during the next [=style change event=].

</div>

<div class=note>

Since the procedure to [=commit computed styles=]
Expand Down