[Bug 24087] [Custom]: Rename document.register to registerElement

https://www.w3.org/Bugs/Public/show_bug.cgi?id=24087

--- Comment #8 from Maciej Stachowiak <mjs@apple.com> ---
(In reply to Scott Miles from comment #5)
> I'm sorry there wasn't more clarity on the arguments. The rationale for
> 'register' goes something like this:
> 
> There was a first concept from the originators of Custom Elements, which was
> to make 'a way to attach a JS class to a element'. So, the vision has been
> toward:
> 
>   class MyElement extends HTMLElement {
>     ...
>   }
>   document.registerElement('my-element', MyElement);
> 
> From this point of view, the `class` statement is what I would consider the
> definition. From there, it seemed clear that the document method was
> registering a tag-name for that. I believe this is also fairly close to what
> I expect to happen in implementations, which is to say an entry is being
> added to a registry. That resonance helped me, for one, to argue for
> `registerElement`.
> 
> Appendix: this is close as we come today to the above `class` construction:
> 
> MyElement = function() {
> };
> MyElement.prototype = Object.create(HTMLElement.prototype, {
>   ...
> });
> MyElement.prototype.createdCallback = MyElement;
> MyElement = document.registerElement('my-element', MyElement);

First, I don't think this addresses my arguments for why defineElement is
better:
<http://lists.w3.org/Archives/Public/public-webapps/2013OctDec/1026.html>.
Specifically, it really sounds like registerElement would take a specific
element, not a prototype that defines a whole kind of element.

I agree with you that a class definition defines a class. However, associating
a tag name with a class is what defines the element (the element being a
particular tag name).

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 7 February 2014 04:25:26 UTC