ampproject / worker-dom

The same DOM API and Frameworks you know, but in a Web Worker.
Apache License 2.0
3.18k stars 152 forks source link

Shadow DOM #859

Open trusktr opened 4 years ago

trusktr commented 4 years ago

I see attachShadow is listed as a feature that will not be supported in the table.

It would be awesome though! But I can see how complex it would be.

If it existed in the future, I would love to try it with OffscreenCanvas in http://lume.io. The Lume elements use Shadow DOM.

nicholasrice commented 3 years ago

I work on a Web Component project and I would also be interested in seeing Shadow DOM (and related Custom Element APIs) support! I'm curious, what is the reason(s) Custom Element APIs are intentionally not supported?

trusktr commented 3 years ago

The reason is probably that ShadowDOM is complex to implement. I wonder if sticking a polyfill into the worker might work. I wonder, because the polyfill relies on the existing DOM APIs and patching their prototypes or similar. So in theory, if the same APIs exist in worker-dom and the polyfill can patch them, then it might work, or at least might require smaller modifications to worker-dom than trying to make a new ShadowDOM implementation in worker-dom...