- From: Keith Cirkel <notifications@github.com>
- Date: Wed, 12 Nov 2025 01:00:20 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 12 November 2025 09:00:24 UTC
keithamus left a comment (whatwg/dom#1287)
I was going to raise a new issue but perhaps we can pivot this issue slightly; observing open shadow trees might be a bold step forward - but perhaps a "minimum viable solution" would be to instead just be notified _when_ an element gets a shadowroot, so that you can then observe the shadowroot if it's open, e.g.
```js
const observer = new MutationObserver(records => {
for (record of records) {
if (record.type == 'attachShadow' && record.target.shadowRoot) {
observer.observe(record.target.shadowRoot, {
attachedShadowroots: true,
subtree: true,
childList: true
})
}
}
});
observer.observe({
attachedShadowroots: true,
subtree: true,
childList: true,
});
```
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1287#issuecomment-3520791509
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/dom/issues/1287/3520791509@github.com>
Received on Wednesday, 12 November 2025 09:00:24 UTC