When effect values are applied via bindings, use fromAbove gambit to avoid unnecessary wheel spinning. (This is now possible since we have fast lookup for readOnly where we want to avoid doing the set at all).

This commit is contained in:
Steven Orvell 2015-11-04 20:57:30 -08:00
parent 24bcedbf41
commit c52090780a

View File

@ -289,10 +289,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
(node.localName == 'input' && property == 'value')) {
value = value == undefined ? '' : value;
}
// TODO(kschaaf): Ideally we'd use `fromAbove: true`, but this
// breaks read-only properties
// this.__setProperty(property, value, true, node);
return node[property] = value;
// setProperty using fromAbove to avoid spinning the wheel needlessly.
var pinfo;
if (!node._propertyInfo || !(pinfo = node._propertyInfo[property]) ||
!pinfo.readOnly) {
this.__setProperty(property, value, true, node);
}
}
},