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

Unified Diff: polymer_1.2.3/bower_components/iron-range-behavior/iron-range-behavior.html

Issue 1581713003: [third_party] add polymer 1.2.3 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: 1.2.3 Created 4 years, 11 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: polymer_1.2.3/bower_components/iron-range-behavior/iron-range-behavior.html
diff --git a/polymer_1.0.4/bower_components/iron-range-behavior/iron-range-behavior.html b/polymer_1.2.3/bower_components/iron-range-behavior/iron-range-behavior.html
similarity index 80%
copy from polymer_1.0.4/bower_components/iron-range-behavior/iron-range-behavior.html
copy to polymer_1.2.3/bower_components/iron-range-behavior/iron-range-behavior.html
index d89843d3613707bdd60e224e7f639c10c05417f4..28469e9eaeb15a06e3e363d8c27e415b14de9648 100644
--- a/polymer_1.0.4/bower_components/iron-range-behavior/iron-range-behavior.html
+++ b/polymer_1.2.3/bower_components/iron-range-behavior/iron-range-behavior.html
@@ -12,11 +12,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<script>
- /**
+ /**
* `iron-range-behavior` provides the behavior for something with a minimum to maximum range.
*
* @demo demo/index.html
- * @polymerBehavior
+ * @polymerBehavior
*/
Polymer.IronRangeBehavior = {
@@ -83,7 +83,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
_calcStep: function(value) {
- return this.step ? (Math.round(value / this.step) / (1 / this.step)) : value;
+ /**
+ * if we calculate the step using
+ * `Math.round(value / step) * step` we may hit a precision point issue
+ * eg. 0.1 * 0.2 = 0.020000000000000004
+ * http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
+ *
+ * as a work around we can divide by the reciprocal of `step`
+ */
+ // polymer/issues/2493
+ value = parseFloat(value);
+ return this.step ? (Math.round((value + this.min) / this.step) -
+ (this.min / this.step)) / (1 / this.step) : value;
},
_validateValue: function() {

Powered by Google App Engine
This is Rietveld 408576698