Re: [whatwg/dom] Proposal: DOM APIs in web workers? (Issue #1217)

> and all the things that your application wants like event listeners

Yeah, this is where things get messy. Let's say you did this in a worker:

```js
const div = workerDOM.createElement('div');
div.addEventListener('click', () => console.log('click'));

self.postMessage(div);
```

…would that event listener 'work'? Would `preventDefault` in that listener work?

You end up with the same question for every bit of state an element can have that sits outside of the serialisable tree. Pixels on a canvas, styles in a sheet etc etc.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1217#issuecomment-1660054839
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/1217/1660054839@github.com>

Received on Tuesday, 1 August 2023 10:45:12 UTC