New issue
Advanced search Search tips

Issue 914918 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Feature

Blocking:
issue 430155


Participants' hotlists:
AnimationWorklet-MVP


Sign in to add a comment

Animation Worklet - Implement Statefull/Stateless Animators

Project Member Reported by majidvp@chromium.org, Dec 13

Issue description

Our implementation statefullness semantic differs from the specification. We should match the specification.

Current Behavior
----------------
- Animator class does not need to have a superclass
- Animators exist in a single global scope and are never removed. Making them effectively statefull. In another word this.property is always valid. 


Expected Behavior
-----------------
1. Introduce two new interfaces StatelessAnimator, StatefulAnimator. Update the registerAnimator to check for these super-classes (but probably not reject old plain class syntax).
2. StatelessAnimator instances should be required to be stateless [2]. To enforce this we can implement a global scope switching strategy similar to the one related to paint worklet that applies to these. [1]
3. StatefulAnimator instances should be required to serialize its state [3]. We have to come up with a way to enforce this. Perhaps periodically call animator.state() and recreate the instance using the serialized state.
(4). Once we implement above we should decide how to handle old syntax (classes with no super class). We can map these to be stateless, or reject them outright, or have them warn as deprecated and them after some time remove them.


The above list is ordered in what I hope is a reasonable way to tackle these tasks.


[1] https://cs.chromium.org/chromium/src/third_party/blink/renderer/modules/csspaint/paint_worklet.cc?type=cs&sq=package:chromium&g=0&l=58
[2] https://drafts.css-houdini.org/css-animationworklet/#stateless-animator-desc
[3] https://drafts.css-houdini.org/css-animationworklet/#stateful-animator-desc

 
Blocking: 430155
Labels: Pri-3
Labels: -Pri-3 Pri-2
Owner: majidvp@chromium.org
Status: Assigned (was: Available)
Blockedon: -430155

Comment 6 by flackr@chromium.org, Jan 16 (6 days ago)

Regarding point #3, StatefulAnimator instances should be required to serialize its state [3]:

This can be guaranteed in much the same way as 2, but by also calling .state() and creating a new instance on the other scope with that state. This would allow us to, similar to PaintWorklet be only using one scope, or the other but not mixing calls to both.

Sign in to add a comment