Skip to content

Commit

Permalink
Ensure disable-upgrade elements are not "configured". Fixes #4302
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Feb 13, 2017
1 parent 2d804a2 commit b36915f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
2 changes: 2 additions & 0 deletions src/lib/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
if (settings.disableUpgradeEnabled) {
if (this.hasAttribute('disable-upgrade')) {
this._propertySetter = disableUpgradePropertySetter;
this._configValue = null;
this.__data__ = {};
return;
} else {
Expand Down Expand Up @@ -314,6 +315,7 @@
if (!this.__hasInitialized && name === 'disable-upgrade') {
this.__hasInitialized = true;
this._propertySetter = Polymer.Bind._modelApi._propertySetter;
this._configValue = Polymer.Base._configValue;
this.__initialize();
}
origAttributeChangedCallback.call(this, name, oldValue, newValue);
Expand Down
37 changes: 20 additions & 17 deletions test/smoke/bind-smoke.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->
<link rel="import" href="../../polymer.html">
<script src="http://172.17.26.237:8080/target/target-script-min.js#anonymous"></script>

<x-trivial></x-trivial>
<link rel="import" href="../../polymer.html">

<style>

Expand All @@ -21,25 +21,28 @@

</style>

<template>
<input on-change="inputChange" value="{{value}}"></value>
</template>
<dom-bind id="x-trivial">
<template>
<input value="{{value::value}}"></value>
</template>
<script>

<script>
Polymer({

Polymer({
is: 'x-trivial',

is: 'x-trivial',
ready: function() {
this.value = 'spoo';
},

ready: function() {
this.value = 'spoo';
},
inputChange: function(e) {
this.value = e.target.value;
console.log(this.value);
}

inputChange: function(e) {
this.value = e.target.value;
}
});

});

</script>
</script>
</dom-bind>

<x-trivial></x-trivial>
7 changes: 7 additions & 0 deletions test/unit/element-disable-upgrade.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,17 @@

<dom-module id="x-complicated-not-lazy">
<template>
<!-- the <x-non-lazy> element here ensures there are other elements on -->
<!-- the host-stack to trigger "configuration", to ensure the disabled -->
<!-- element handles that code path correctly -->
<x-non-lazy></x-non-lazy>
<x-complicated-child id="child" a="{{a}}" disable-upgrade$="{{b}}" c="{{c}}"></x-complicated-child>
</template>
<script>
HTMLImports.whenReady(function() {
Polymer({
is: 'x-non-lazy'
});
Polymer({
is: 'x-complicated-not-lazy',
properties: {
Expand Down

0 comments on commit b36915f

Please sign in to comment.