- From: Joe Pea <notifications@github.com>
- Date: Wed, 21 Feb 2018 20:46:34 -0800
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 22 February 2018 04:46:58 UTC
This is interesting, because, if the `ElementStates` were already created, then perhaps this would happen on the outside
```js
const el = document.createElement('gl-sphere')
const states = new ElementStates( el ) // DOMException, it was already created for that element (because gl-sphere created it in the constructor)
```
but
```js
const el = document.createElement('div')
const states = new ElementStates( el )
states.add('foo') // it works
```
Or, maybe the HTML engine can throw an error if `new ElementStates` is not called inside a custom element constructor, to force the feature as a from-the-inside feature only.
--
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/738#issuecomment-367566218
Received on Thursday, 22 February 2018 04:46:58 UTC