Rename document.defineCustomElement to document.defineElement and disallow a single class from defining multiple custom elements. Also remove the optional first argument from the HTMLElement constructor.
<rdar://problem/24970878>
Created attachment 272835 [details] Fixes the bug
Comment on attachment 272835 [details] Fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=272835&action=review r=me with questions > Source/WebCore/dom/CustomElementDefinitions.h:55 > + bool containsInterface(const JSC::JSObject*) const; Would naming this "containsConstructor" make more sense? > Source/WebCore/dom/Document.idl:298 > + void defineElement(DOMString tagName, CustomElementInterface elementInterface); The spec has: void defineElement(DOMString type, Function constructor, optional ElementRegistrationOptions options); Why the mismatch?
Comment on attachment 272835 [details] Fixes the bug View in context: https://bugs.webkit.org/attachment.cgi?id=272835&action=review Thanks for the review! >> Source/WebCore/dom/CustomElementDefinitions.h:55 >> + bool containsInterface(const JSC::JSObject*) const; > > Would naming this "containsConstructor" make more sense? Renamed. >> Source/WebCore/dom/Document.idl:298 >> + void defineElement(DOMString tagName, CustomElementInterface elementInterface); > > The spec has: > void defineElement(DOMString type, Function constructor, optional ElementRegistrationOptions options); > > Why the mismatch? Changed it to: void defineElement(DOMString localName, Function constructor); since we don't support the optional options argument which is used to subclass subclasses of HTMLElement; e.g. HTMLInputElement. I've also filed a Github issue to rename the first argument to localName: https://github.com/w3c/webcomponents/issues/416 since type is too generic name and doesn't match the argument name of createElement.
Committed r197602: <http://trac.webkit.org/changeset/197602>