Re: [w3ctag/design-reviews] Declarative CSS Modules and Declarative Shadow DOM `adoptedstylesheets` attribute (Issue #1000)

domenic left a comment (w3ctag/design-reviews#1000)

I met with the Edge team this morning to give my perspective on various module-related things. The TAG may enjoy my longer comment, which I posted at https://github.com/whatwg/html/issues/10673#issuecomment-3222362601.

To specific questions asked of me here:

> Was it ever intentional that `<script type="importmap">` works inside a shadow root? It'd be good to check with that feature's designers (e.g. [@domenic](https://github.com/domenic)) to ensure that encouraging its use there won't break any assumptions or encourage any footguns.

Yes. In general, shadow DOM does not have any impact on JavaScript-related scoping or functionality. Just like you can include a `<script>` or `<script type=module>` in your shadow DOM which messes with the global object (including doing things like overriding `window.fetch`), you can include `<script type=importmap>` in your shadow DOM which messes with global import specifier resolution.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/1000#issuecomment-3222369235
You are receiving this because you are subscribed to this thread.

Message ID: <w3ctag/design-reviews/issues/1000/3222369235@github.com>

Received on Tuesday, 26 August 2025 02:42:00 UTC