Exclude attribute bindings from configuration. Fixes #3288.

This commit is contained in:
Kevin Schaaf
2016-01-13 10:36:02 -08:00
parent 44232bdf03
commit 246ea725a1
3 changed files with 16 additions and 5 deletions

View File

@@ -136,7 +136,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
for (var i=0, l=fx.length, x; (i<l) && (x=fx[i]); i++) {
// TODO(kschaaf): compound bindings (as well as computed effects)
// are excluded from top-down configure for now; to be revisited
if (x.kind === 'annotation' && !x.isCompound) {
if (x.kind === 'annotation' &&
x.effect.kind !== 'attribute' &&
!x.isCompound) {
var node = this._nodes[x.effect.index];
// seeding configuration only
if (node._configValue) {

View File

@@ -128,7 +128,7 @@
<dom-module id="x-configure-host">
<template>
<x-configure-child id="child" content="{{content}}" object="{{object.goo}}"></x-configure-child>
<x-configure-child id="child" content="{{content}}" object="{{object.goo}}" attr$="{{attrValue}}"></x-configure-child>
</template>
<script>
Polymer({
@@ -156,6 +156,9 @@
},
stomp: {
value: 5
},
attrValue: {
value: 'attrValue'
}
}

View File

@@ -22,9 +22,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<x-configure-value content="attr" object='{"foo": "obj-attr"}'></x-configure-value>
<x-configure-host></x-configure-host>
<x-configure-host></x-configure-host>
<x-configure-host content="attr"></x-configure-host>
<x-configure-host content="attr"></x-configure-host>
<script>
@@ -53,7 +53,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
test('value set in properties initializes correctly', function() {
var e = document.querySelector('x-configure-value');
testConfigure(e, 'default', 'obj-default');
testConfigure(e, 'default', 'obj-default');
});
test('attribute overrides value set in properties', function() {
@@ -81,6 +81,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
assert.equal(e.readOnly, 'default');
});
test('properties for attribute bindings not configured', function() {
var e = document.querySelector('x-configure-host');
assert.equal(e.$.child.getAttribute('attr'), 'attrValue');
assert.equal(e.$.child.attr, undefined);
});
});
</script>