Skip to content

Commit

Permalink
coalesce all desugaring and call it before user registerCallback exte…
Browse files Browse the repository at this point in the history
…nsion point
  • Loading branch information
sorvell committed Oct 1, 2013
1 parent a6a8675 commit 74086fb
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/declaration/prototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,7 @@
// TODO(sjmiles): replace `element` with `elementElement` or `declaration`
this.prototype.element = this;
// more declarative features
this.desugar();
// TODO(sorvell): install a helper method this.resolvePath to aid in
// setting resource paths. e.g.
// this.$.image.src = this.resolvePath('images/foo.png')
// Potentially remove when spec bug is addressed.
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=21407
this.addResolvePathApi();
// under ShadowDOMPolyfill, transforms to approximate missing CSS features
if (window.ShadowDOMPolyfill) {
Platform.ShadowCSS.shimStyling(this.templateContent(), name, extendee);
}
this.desugar(name, extendee);
// register our custom element with the platform
this.registerPrototype(name, extendee);
// reference constructor in a global named by 'constructor' attribute
Expand Down Expand Up @@ -71,7 +61,7 @@
this.inheritObject('eventDelegates', prototype, base);
},
// implement various declarative features
desugar: function(prototype) {
desugar: function(name, extendee) {
// compile list of attributes to copy to instances
this.accumulateInstanceAttributes();
// parse on-* delegates declared on `this` element
Expand All @@ -80,6 +70,16 @@
this.parseLocalEvents();
// install external stylesheets as if they are inline
this.installSheets();
// TODO(sorvell): install a helper method this.resolvePath to aid in
// setting resource paths. e.g.
// this.$.image.src = this.resolvePath('images/foo.png')
// Potentially remove when spec bug is addressed.
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=21407
this.addResolvePathApi();
// under ShadowDOMPolyfill, transforms to approximate missing CSS features
if (window.ShadowDOMPolyfill) {
Platform.ShadowCSS.shimStyling(this.templateContent(), name, extendee);
}
// allow custom element access to the declarative context
if (this.prototype.registerCallback) {
this.prototype.registerCallback(this);
Expand Down

0 comments on commit 74086fb

Please sign in to comment.