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 18747 - [Custom]: Specify invoking "readyCallback"
Summary: [Custom]: Specify invoking "readyCallback"
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:
: 18731 21408 21409 (view as bug list)
Depends on:
Blocks: 18720
  Show dependency treegraph
 
Reported: 2012-08-30 21:28 UTC by Dimitri Glazkov
Modified: 2013-04-22 21:59 UTC (History)
3 users (show)

See Also:


Attachments

Description Dimitri Glazkov 2012-08-30 21:28:49 UTC
The "created" callback is invoked _after_ we traversed through CHAIN. This is the callback to use to do stuff your particular element instance.
Comment 1 Dimitri Glazkov 2012-08-30 21:32:25 UTC
*** Bug 18731 has been marked as a duplicate of this bug. ***
Comment 2 Dimitri Glazkov 2012-08-30 21:34:29 UTC
One concern raised: the "created" callback effectively acts as a constructor, and this mechanism alone does not provide a way to invoke the "created" callback of the super-class.
Comment 3 Dimitri Glazkov 2012-08-30 21:43:15 UTC
One idea: pass the prototype's super created method:

created: function(superCreated) {
}
Comment 4 Dimitri Glazkov 2012-10-30 21:58:19 UTC
http://dvcs.w3.org/hg/webcomponents/rev/cad29a7d9a11
Comment 5 Scott Miles 2012-12-12 23:10:42 UTC
For the work my team is doing, 'create' is a critical entry-point (initialization after all shadow roots are created), but it turns out we also could use an entry-point *before* the shadow roots are created.

A strawman API:

// called on the ultimate subclass 
// when the element in instantiated
// but BEFORE any shadowRootCreated. 
// inSuper argument provided to call inherited 'created'
// which is otherwise private
created: function(inSuper) 

// called on each extendor, from oldest to youngest,
// when it's respective shadow root is intantiated
// inRoot argument provides reference to the shadow root
// which MAY otherwise be private
shadowRootCreated: function(inRoot) 

// called on the ultimate subclass 
// when the element in instantiated
// and AFTER all shadowRootCreated. 
// inSuper argument provided to call inherited 'created'
// which is otherwise private
ready: function(inSuper) 

Unfortunately increases complexity, but I suggest we need to service these custom inheritance trees properly.
Comment 6 Scott Miles 2012-12-12 23:12:02 UTC
The comment above overlaps with this bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=18748. Maybe I should have made a new bug altogether?
Comment 7 Dimitri Glazkov 2013-04-10 20:13:48 UTC
*** Bug 21408 has been marked as a duplicate of this bug. ***
Comment 8 Dimitri Glazkov 2013-04-10 20:14:08 UTC
*** Bug 21409 has been marked as a duplicate of this bug. ***
Comment 9 Dimitri Glazkov 2013-04-10 22:28:15 UTC
https://dvcs.w3.org/hg/webcomponents/rev/50480689d0bf
Comment 10 Dimitri Glazkov 2013-04-22 21:59:01 UTC
https://dvcs.w3.org/hg/webcomponents/rev/d0d9310e750a
https://dvcs.w3.org/hg/webcomponents/rev/0854a1983551
https://dvcs.w3.org/hg/webcomponents/rev/b37a366e3682

I think this is done now. Please look over the spec and make sure I didn't booger it up too much.