[Bug 20487] [Custom]: Creation of custom elements via createElement is underdefined

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

--- Comment #11 from Dimitri Glazkov <dglazkov@chromium.org> ---
(In reply to comment #10)
> > When a custom element is instantiated with the createElement method,
> 
> The concept of "custom element" is not defined in a way that I can tell, as
> a createElement implementor, whethere I'm creating a "custom element".
> 
> Perhaps this should simply say "When an element is instantiated..."?

Sounds good: https://dvcs.w3.org/hg/webcomponents/rev/709e43cb4699

> 
> The custom element instantiation algorithm might need to say something about
> what happens if the namespace is neither HTML nor SVG.  Or can that
> situation not arise?

As spec'd now, you can build a non-HTML/SVG Element and get away with
instantiating it in any namespace. Which seems fine.

> 
> I don't think anything defines how to tell whether a custom interface
> inherits from HTMLElement.  I certainly can't find anything that defines it.

This is true. I need to think about this. I think the solution is to just use
the Web IDL's concept of inheritance
(http://www.w3.org/TR/WebIDL/#dfn-inherit), but then specify how custom
element's interface is defined.

> 
> The custom element instantiation algorithm creates HTML-namespaced elements
> even if we're extending SVG elements.  That seems ... odd.

No, as spec'd now, it will throw a NamespaceError. Which actually might be bad.
For:

var s = document.createElement('svg')

WebKit simply creates an HTMLUnknownElement. Should I do that instead? It seems
more error-prone.

> 
> > Let CHAIN be ELEMENT's prototype chain, in reverse order (starting with at the
> > top of the prototype chain)
> 
> Is the "top" Object.prototype or the other end?  Better to say which end
> you're starting with (e.g. the prototype closest to the object or furthest
> away) instead of assuming your mental geometry matches other people's.

Will fix.

> 
> Apart from those, this is starting to look much better, yes.  I think at
> this point the createElement bits are fine and the remaining vagueness has
> been pushed to elsewhere.  ;)

Yay! Now to push it out all the way :)

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

Received on Wednesday, 30 January 2013 00:04:26 UTC