W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2013

Re: [custom elements] Improving the name of document.register()

From: Ryosuke Niwa <rniwa@apple.com>
Date: Wed, 11 Dec 2013 20:23:28 -0800
Cc: "piranna@gmail.com" <piranna@gmail.com>, Edward O'Connor <eoconnor@apple.com>, WebApps WG <public-webapps@w3.org>
Message-id: <9B76C67A-828B-45DB-A2BE-058EEF82FCA7@apple.com>
To: Dominic Cooney <dominicc@google.com>

On Dec 11, 2013, at 6:46 PM, Dominic Cooney <dominicc@google.com> wrote:

> On Thu, Dec 12, 2013 at 5:17 AM, piranna@gmail.com <piranna@gmail.com> wrote:
> I have seen registerProtocolHandler() and it's being discused registerServiceWorker(). I believe registerElementDefinition() or registerCustomElement() could help to keep going on this path.
> 
> Send from my Samsung Galaxy Note II
> 
> El 11/12/2013 21:10, "Edward O'Connor" <eoconnor@apple.com> escribió:
> 
> Hi,
> 
> The name "register" is very generic and could mean practically anything.
> We need to adopt a name for document.register() that makes its purpose
> clear to authors looking to use custom elements or those reading someone
> else's code that makes use of custom elements.
> 
> I support this proposal.
>  
> Here are some ideas:
> 
> document.defineElement()
> document.declareElement()
> document.registerElementDefinition()
> document.defineCustomElement()
> document.declareCustomElement()
> document.registerCustomElementDefinition()
> 
> I like document.defineCustomElement() the most, but
> document.defineElement() also works for me if people think
> document.defineCustomElement() is too long.
> 
> 
> I think the method should be called registerElement, for these reasons:
> 
> - It's more descriptive about the purpose of the method than just "register."
> - It's not too verbose; it doesn't have any redundant part.
> - It's nicely parallel to registerProtocolHandler.

I'd still refer declareElement (or defineElement) since registerElement sounds as if we're registering an instance of element with something.  Define and declare also match SGML/XML terminologies.

- R. Niwa


Received on Thursday, 12 December 2013 04:46:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:20 UTC