Re: [css-houdini-drafts] [css-paint-api] use-case: data/audio visualization (#872)

We have thought about supporting posting message for Animation Worklet. See #869 for details here.

Unlike paint, Animation Worklet does not use custom properties so it does not have that channel. However we are not sure if post message has the right approach. See details on two issues [here](https://github.com/w3c/css-houdini-drafts/issues/869#issuecomment-477234102).  In particular most of the time the information that needs to be communicated (e.g., viewport size changed) has relevance to a particular frame so being sync with that frame may be required.  Maybe these issues are solvable though!

For Paint Worklet, I am not even sure how you would implement postMessage. Paint Worklet working model is completely stateless so introducing a side channel in form of postMessage would go against that e.g., you can no longer assume your paint only depends on input arguments and cache/resuse previous paint output. Also how useful is receiving a message when you cannot keep that message around beyond the immediate paint. What if we switch the global scope right after receiving the message?

-- 
GitHub Notification of comment by majido
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/872#issuecomment-499593227 using your GitHub account

Received on Thursday, 6 June 2019 17:33:37 UTC