Re: [css-houdini-drafts] [worklets] There is no way to catch "throw" or "unhandledrejection" (#975)

Great. 
If Worklets as a shared Realm context are living in main thread, It shouldn't be that difficult to pass an off canvas reference to it. Especially when we already have `drawImage` which we can pass an `OffscreenCanvas` type to it.

I'm not sure but I think by adding `OffscreenCanvas` API with `transferControlToOffscreen` feature, using the `ctx.drawImage` we can have the followings benefits:
- As Worklets are living in main thread and have possibly internal access to the global scope, we don't need to implement a message system between [Window] and [Worklet], Worklet can use the [Window messaging APIs] to send the CSS variable data to the processing Worker.
- Having shared context will turn in to be a great feature for Worklets
- We can use the full Canvas API e.g., FontFace API, WebGL, WebGPU computation, Shaders, etc..
- Seeding up the process and more.

Currently, Chrome, Chromium Edge, FireFox and Webkit/Safari are all supporting `OffscreenCanvas`. but `transferControlToOffscreen` is available in Chrome only.

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

Received on Wednesday, 25 December 2019 07:30:14 UTC