Re: [whatwg/dom] Declarative Shadow DOM (#831)

You can still reach the div’s closed shadow root if the shadow root’s content includes a custom element (or even a builtin with onsomething) because it will be their `parentNode`. This may not be particularly useful in most cases but figured it was worth mentioning that it’s not the case that there’s _definitely_ no reference to it from script. The following logs the div’s closed shadow root:

```html
<div>
  <template shadowroot=closed>
    <x-x></x-x>
  </template>
</div>

<script>
  customElements.define("x-x", class extends HTMLElement {
    connectedCallback() {
      console.log(this.parentNode);
    }
  });
</script>
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/831#issuecomment-1550151331
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/831/1550151331@github.com>

Received on Tuesday, 16 May 2023 18:20:19 UTC