[css-houdini-drafts] [css-animationworklet] Passing DocumentTimeline via options: "object could not be cloned." (#977)

InventingWithMonster has just created a new issue for https://github.com/w3c/css-houdini-drafts:

== [css-animationworklet] Passing DocumentTimeline via options: "object could not be cloned." ==
In the Spring Sticky demo, the Animation Worklet is [being passed `new DocumentTimeline()` as an option](https://github.com/GoogleChromeLabs/houdini-samples/blob/master/animation-worklet/spring-sticky/spring-sticky-animator.js#L20).

The [spec says](https://drafts.css-houdini.org/css-animationworklet/#animator-instance-section) animation options should be serialisable. The live demo only works because the polyfill doesn't adhere to specs. Trying to pass `new DocumentTimeline()` to an Animation Worklet throws the error `DOMException: Failed to construct 'WorkletAnimation': DocumentTimeline object could not be cloned.`.

Is this something that the API should support? If not, how could the Spring Sticky possibly be implemented with the API as specced?

As an aside the technique used within the Spring Sticky where the animator can detach from the main timeline would solve issues around animations (like a spring) not being able to stop themselves. 

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

Received on Wednesday, 29 January 2020 13:21:25 UTC