[Bug 21886] [Custom]: Define or link to what it means for a local name to be associated with an interface

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

--- Comment #7 from Dominic Cooney <dominicc@chromium.org> ---
(In reply to comment #6)
> If we're going with A, should the base element name be:
> 
> 1) the second optional argument in document.register. The drawback here is
> that for some values of options.prototype, the argument is _not_ optional,
> which is somewhat confusing.

OK, what about this:

There are two overloads of document.register. The first is for custom tags:

register(DOMString tagName, ElementRegistrationOptions options)

The second is for type extensions:

register(DOMString tagName, DOMString type, ElementRegistrationOptions options)

So this would look like:

document.register('x-panel', Panel)
document.register('button', 'accessible-button', AccessibleButton)

If you hate overloads you could make the first argument selector-like, eg
'x-panel', 'button[is=accessible-button]'.

> 2) another option of ElementRegistrationOptions. The drawback here is that
> in ES6, this will be just a static class member, and then people will be
> asking, "why is that here?" And "why isn't name there as well?"

You could use localName on the prototype. That will shadow the built-in one,
though, which is a wart. And the author might expect that they can change it,
which they can't.

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

Received on Wednesday, 22 May 2013 02:56:20 UTC