Re: [w3c/webcomponents] A way to implement :hover, :active, etc, for custom elements. (#738)

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