- From: <bugzilla@jessica.w3.org>
- Date: Tue, 20 May 2014 17:31:48 +0000
- To: public-webapps-bugzilla@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=25830
--- Comment #4 from johnjbarton <johnjbarton@johnjbarton.com> ---
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'.
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.
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] }
--
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Tuesday, 20 May 2014 17:31:51 UTC