Re: [w3c/webcomponents] Expose shadowRoot on element internals (#871)

Seems you all want to prevent the following. But how?

```js
class SomeEl extends HTMLElement {
 #internals = this.attachInternals()
}

customElements.define('some-el', SomeEl)

class ExposeInternalsextends extends SomeEl {
 attachInternals() {
  this.publicInternals = super.attachInternals()
  this.shadow = this.publicInternals.shadowRoot // open or closed root, doesn't matter.
  return this.publicInternals
 }
}

// monkey-patched define method waited to overwrite the some-el definition.
customElements.define('some-el', ExposeInternals)
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/871#issuecomment-684051945

Received on Monday, 31 August 2020 21:31:05 UTC