[Bug 25830] [Custom]: Constructor function name is illegal by definition.

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

--- Comment #5 from Dimitri Glazkov <dglazkov@chromium.org> ---
(In reply to johnjbarton from comment #4)
> Yes, the type name is passed in to registerElement():
> ---
> partial interface Document {
>     Function registerElement(DOMString type, optional
> ElementRegistrationOptions options);
> };
> ---
> and a Function is returned. The 'name' property of the returned function
> object will be a string matching 'type'.

Well, no, that's not specified anywhere.

> 
> 
> The section on es6 
> http://w3c.github.io/webcomponents/spec/custom/#es6
> has a different API and here it seems even more problematic:
> ---
> The steps run when calling registerElement will change to:
> 
> Input
> DOCUMENT, method's context object, a document
> TYPE, the custom element type of the element being registered
> FUNCTION, the custom element constructor, optional
> ---
> The 'custom element constructor' is 
> http://w3c.github.io/webcomponents/spec/custom/#dfn-custom-element-
> constructor
> which says in part
> ---
> Let CONSTRUCTOR be the interface object whose interface prototype object is
> PROTOTYPE and when called as a constructor, executes these steps:
> Let ELEMENT be the context object
> Let TYPE be the custom element type in DEFINITION
> Let NAME be the local name in DEFINITION
> ---
> I don't see how one can supply the constructor function required by this API
> through ordinary JS code.

No, you're just not reading the rest of the monkey-patching of the spec down
below. The meaning of custom element constructor will change for ES6.

> 
> To be sure I am not able to see exactly where the standard connects the
> "local name" with the TYPE. Experimentally you can see the connection in
> Chrome by typing into devtools console:
> 
> document.registerElement('x-foo')
> gives
> function x-foo() { [native code] }

This just seems like a bug in Chrome. It's not anything that spec describes.

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

Received on Tuesday, 20 May 2014 17:37:21 UTC