-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Thanks for the work on this - I've just noticed it mentioned via the WebXR working group agenda. Sounds like a lot of work has gone into this already.
I'm just wondering why this is tied to a particular canvas - a createImageBitmap(HTMLDivElement) would seem the simplest integration with the Web API for me, and wouldn't require specific updates to the canvas rendering context implementations.
The automatic re-routing of events to the DOM elements wouldn't be possible via that route, but seems like if you want the DOM events you'd just position the DOM elements directly on top of the canvas rather than going through the hassle of drawing them manually into the canvas and relying on some automated event plumbing.
As I've seen mentioned in other issues, automated event plumbing is pretty complex anyway considering occlusions etc, and particularly with WebGL where you might have some shader based wobble effect or something that would need a per-pixel transformation from canvas to element coords. Why not separate the concerns of DOM -> bitmap and canvas interaction -> DOM interaction?