[w3c/webcomponents] Move the check for HTMLElement and its subclass from customElements.define to construction timing (#541)

Right now, [`CustomElementsRegistry.define`](https://html.spec.whatwg.org/#dom-customelementsregistry-define) is spec'ed to check whether the interface object inherits from `HTMLElement` interface or not.

This check is hard to implement in WebKit as is because we don't have a mechanism to check the inheritance hierarchy of interface constructor objects (we can check the inheritance hierarchy of constructed objects via branding).

It's also weird to specifically filter out `HTMLElement` and their sub-interfaces when we throw the same error for things like `Range`, `Text`, and `Set`.

My preference would be moving this check to the construction time.  We can check that `new.target` is not `HTMLElement` or one of its subclasses instead.

-- 
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/541

Received on Thursday, 11 August 2016 02:59:30 UTC