[css-animationworklet] Listening to events in Animation Worklet #834
On transferring data from main thread
I think this the need such a mechanism to make animation worklet useful. Since many useful effects running inside animation worklet may need to know about specific values from main thread, e.g., size of window or bounding client rects of various objects.
Since we already allow data to be sent when worklet animation (via
See more details on specific proposed change here
On listening to events in animation worklet
Again I think there is a lot of merit to this idea. In fact, one of our goals is to allow worklet animation inside animation worklet context to be able to react to user input (touch, gesture, etc.)
I think once we have the solution for sending data from main thread to worklet, one can build a simple event forwarding on top of it. But we need a better solution to have low-latency event forwarding which the other ideas are trying to address.
Drop multiple timelines and relevant concepts for Animation Worklet. This also drops the hide-bar example from spec. I may re-work this example (e.g., switching timeline via setting animation.timeline on main thread) and add it back this in future but for now dropping it is simpler. Multiple timeline was originally the solution that would allow seamless switching between between scroll timeline and regular timelines. Since then we have iterated over multiple different solutions. See #834 for a list of various design we have considered. It seems that allowing events to be handled in Animation Worklets will enable the relevant usecases. For now we drop multiple timelines fromAnimation Worklet Level-1 to ensure simplicity and better alignment with WebAnimations.
The proposal for allowing input events to worklets is now published under WICG: https://discourse.wicg.io/t/proposal-exposing-input-events-to-worker-threads/3479
Here is the explainer for it. I am working closely with other folks on this to make sure it addresses Animation Worklet usecases.