Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(405)

Unified Diff: third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js

Issue 1187823002: Update Polymer components and re-run reproduce.sh (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js
index 3b30b2cc5e100df0df99cdffda81ff67c431c592..d307fe68ba87cc6b0fc289b7e1588c38bd8ee1d6 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js
@@ -60,10 +60,10 @@
},
_addons: {
- type: Array,
- value: function() {
- return [];
- }
+ type: Array
+ // do not set a default value here intentionally - it will be initialized lazily when a
+ // distributed child is attached, which may occur before configuration for this element
+ // in polyfill.
},
_inputHasContent: {
@@ -93,7 +93,7 @@
_boundOnInput: {
type: Function,
value: function() {
- this._onInput.bind(this)
+ return this._onInput.bind(this);
}
},
@@ -124,6 +124,9 @@
},
ready: function() {
+ if (!this._addons) {
+ this._addons = [];
+ }
this.addEventListener('focus', this._boundOnFocus, true);
this.addEventListener('blur', this._boundOnBlur, true);
if (this.attrForValue) {
@@ -138,8 +141,16 @@
},
_onAddonAttached: function(event) {
- this._addons.push(event.target);
- this._handleValue(this._inputElement);
+ if (!this._addons) {
+ this._addons = [];
+ }
+ var target = event.target;
+ if (this._addons.indexOf(target) === -1) {
+ this._addons.push(target);
+ if (this.isAttached) {
+ this._handleValue(this._inputElement);
+ }
+ }
},
_onFocus: function() {

Powered by Google App Engine
This is Rietveld 408576698