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

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

Issue 1901343004: [Polymer] update third_party polymer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: new pull Created 4 years, 8 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-behavior-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-behavior-extracted.js
index 2073573050772899a0257e41865b3f0d32d44af1..cc448524a6380885128e25a0f8ed0403c8ef8fdd 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-behavior-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-behavior-extracted.js
@@ -1,4 +1,10 @@
-/**
+// Generate unique, monotonically increasing IDs for labels (needed by
+ // aria-labelledby) and add-ons.
+ Polymer.PaperInputHelper = {};
+ Polymer.PaperInputHelper.NextLabelID = 1;
+ Polymer.PaperInputHelper.NextAddonID = 1;
+
+ /**
* Use `Polymer.PaperInputBehavior` to implement inputs with `<paper-input-container>`. This
* behavior is implemented by `<paper-input>`. It exposes a number of properties from
* `<paper-input-container>` and `<input is="iron-input">` and they should be bound in your
@@ -9,6 +15,7 @@
* @polymerBehavior Polymer.PaperInputBehavior
*/
Polymer.PaperInputBehaviorImpl = {
+
properties: {
/**
* Fired when the input changes due to user interaction.
@@ -404,7 +411,7 @@
if (target.id) {
this._ariaDescribedBy = this._appendStringWithSpace(this._ariaDescribedBy, target.id);
} else {
- var id = 'paper-input-add-on-' + Math.floor((Math.random() * 100000));
+ var id = 'paper-input-add-on-' + Polymer.PaperInputHelper.NextAddonID++;
target.id = id;
this._ariaDescribedBy = this._appendStringWithSpace(this._ariaDescribedBy, id);
}
@@ -492,7 +499,7 @@
if (label.id) {
labelledBy = label.id;
} else {
- labelledBy = 'paper-input-label-' + new Date().getUTCMilliseconds();
+ labelledBy = 'paper-input-label-' + Polymer.PaperInputHelper.NextLabelID++;
label.id = labelledBy;
}
this._ariaLabelledBy = labelledBy;
@@ -510,7 +517,7 @@
});
}
}
- };
+ }
/** @polymerBehavior */
Polymer.PaperInputBehavior = [

Powered by Google App Engine
This is Rietveld 408576698