Skip to content

Commit

Permalink
revert host attributes ordering change optimization as it was not wor…
Browse files Browse the repository at this point in the history
…th the trouble (barely measurable and more cumbersome impl).
  • Loading branch information
Steven Orvell committed Nov 5, 2015
1 parent 11606ba commit f9894a0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
10 changes: 8 additions & 2 deletions polymer.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,16 @@
this._marshalInstanceEffects();
// acquire instance behaviors
this._marshalBehaviors();
// acquire initial instance attribute values
this._marshalAttributes();
/*
TODO(sorvell): It's *slightly() more efficient to marshal attributes prior
to installing hostAttributes, but then hostAttributes must be separately
funneled to configure, which is cumbersome.
Since this delta seems hard to measure we will not bother atm.
*/
// install host attributes
this._marshalHostAttributes();
// acquire initial instance attribute values
this._marshalAttributes();
// top-down initial distribution, configuration, & ready callback
this._tryReady();
},
Expand Down
2 changes: 2 additions & 0 deletions src/lib/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@

// reserved for canonical behavior
attributeChangedCallback: function(name, oldValue, newValue) {
// TODO(sorvell): consider filtering out changes to host attributes
// note: this was barely measurable with 3 host attributes.
this._attributeChangedImpl(name); // abstract
this._doBehavior('attributeChanged', [name, oldValue, newValue]); // abstract
},
Expand Down
6 changes: 0 additions & 6 deletions src/micro/attributes.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@
if (!this.hasAttribute(n) && (n !== 'class')) {
var v = attr$[n];
this.serializeValueToAttribute(v, n, this);
// TODO(sorvell): this should not be in micro layer.
// if necessary, add this value to configuration...
if (!this._clientsReadied && this._propertyInfo[n] &&
(this._config[n] === undefined)) {
this._configValue(n, v);
}
}
}
},
Expand Down

0 comments on commit f9894a0

Please sign in to comment.