-
Notifications
You must be signed in to change notification settings - Fork 143
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
[css-animationworklet] Listening to events in Animation Worklet #834
Comments
On transferring data from main threadI 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 workletAgain 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.) We have been trying to come up with the right abstraction and API to allow this (see: 1, 2, 3), and our recent idea which I am very hopeful about is captured here. 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. |
I filed a separate issue for sending data from main to worklet since I believe the usecases and APIs differ. Lets keep this issue focused on receiving events inside worklet. |
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. |
Can I listen events in animation worklet or transfer data from main thread to running animation worklet?
The text was updated successfully, but these errors were encountered: