[Bug 20913] [Custom]: Meaning of prototype in document.register is underspecified

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

--- Comment #1 from Dimitri Glazkov <dglazkov@chromium.org> ---
(In reply to comment #0)
> The spec for document.register allows a user to pass in a prototype that
> specifies the API of the new element and restricts it only in that it must
> inherit from HTMLElement. Allowing the prototype to inherit from e.g.
> HTMLButtonElement is useful in the <button is="x-foo"> case, but it isn't
> clear what should happen if the user simply calls
> document.createElement("x-foo"). Should that throw?

We settled on <button is="x-foo"> and <x-foo> being interchangeable, so for:

var foo = document.createElement("x-foo")

and:

div.innerHTML = '<button is="x-foo"></button>';
var foo = div.firstChild;

foo should be of the same type. There will be difference between these
instances: localNames, will be different ("x-foo" and "button", respectively),
<x-foo> won't match any of "button" styles.

> What should happen if one of the methods defined on HTMLButtonElement is called?

That is a really interesting question and you're right that spec is totally
skimpy on this.

Intuitively, the author would expect that an instance that inherits from
HTMLButtonElement behaves like an HTMLButtonElement.

>From the perspective of platform objects, this means that the instance will be
backed by the proper HTMLButtonElement implementation on the C++ side. I am
trying to figure how to spec that.

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

Received on Friday, 8 February 2013 18:26:54 UTC