This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17105 - [Custom]: Specify a way to define custom DOM element prototypes
Summary: [Custom]: Specify a way to define custom DOM element prototypes
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 17103
  Show dependency treegraph
 
Reported: 2012-05-18 17:20 UTC by Dimitri Glazkov
Modified: 2012-06-11 21:24 UTC (History)
1 user (show)

See Also:


Attachments

Description Dimitri Glazkov 2012-05-18 17:20:45 UTC
How do we associate a prototype with a custom DOM element definition?
Comment 1 Dominic Cooney 2012-05-22 06:40:30 UTC
At one point we thought constructor= could point to an existing function, and hence its prototype would be used (and checked that the base element’s prototype was on the prototype chain.)

It would be nice to design something that was compatible with user-defined constructor bodies in some future version.

The current situation is tenable; authors could just mix in behavior to the prototype object that is created by the constructor generation algorithm.

If authors can specify a prototype, there’s a semantic question – do they specify the object which is first link in the prototype chain, and a separate prototype object is still synthesized; or do they specify the generated constructor’s prototype directly?

The former case (prototype object is always synthesized) leaves open the possibility of requiring GeneratedConstructor.prototype.constructor === GeneratedConstructor and implies that there is at least one unique prototype object per custom element. These might be useful properties for implementers to exploit.
Comment 2 Dimitri Glazkov 2012-06-11 21:24:20 UTC
Defined in http://dvcs.w3.org/hg/webcomponents/rev/e6edb53aa5d9 and on.