-
Notifications
You must be signed in to change notification settings - Fork 6
Introduce a mirror event target #8
base: gh-pages
Are you sure you want to change the base?
Conversation
Tries to fix #6. |
@smaug---- This patch needs a lot more work to do. At the very least we need to first address the targeting issue in html spec so I can better defined what happens to a mirror target when created. But let's first agree in the overall approach and whether you are also okay with not queueing all the events similar to an EventPort. |
Why is it said that the Do we really want all the methods from EventTarget to be accessible on the "mirror"? |
@mustaqahmed FYI
EventTarget is too generic and doesn't necessary belong to the DOM nodes that have some visual representation. But Element is just a start I'd say.
One of the ideas was to let the worker to dispatchEvent as well (although stating that the listeners on the main thread might async and there is no guarantee on that). But we can have synchronous running of the listeners at least on the worker side. Although I agree this is not explicitly mentioned here in this PR. |
I'm only a web author, so I may very well miss a lot about how things work under the hood.
Once again with my simple web-author hat, I wonder if such behavior wouldn't lead to some undefined or at least some very complicated to guess behavior / race conditions. FWIW, here is a little playground I'm working on, loosely based on this PR. |
Introduce a mirror event target to have an EventPort property.