From c52090780a94b3aa901e227f7634ad400027d860 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Wed, 4 Nov 2015 20:57:30 -0800 Subject: [PATCH] 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). --- src/standard/effectBuilder.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/standard/effectBuilder.html b/src/standard/effectBuilder.html index e2154c7929..81b40b1860 100644 --- a/src/standard/effectBuilder.html +++ b/src/standard/effectBuilder.html @@ -289,10 +289,12 @@ (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); + } } },