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

Side by Side Diff: third_party/polymer/v1_0/components-chromium/iron-validatable-behavior/iron-validatable-behavior-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 unified diff | Download patch
OLDNEW
1 1
2 2
3 /** 3 /**
4 * Use `Polymer.IronValidatableBehavior` to implement an element that validate s user input. 4 * Use `Polymer.IronValidatableBehavior` to implement an element that validate s user input.
5 * 5 *
6 * ### Accessiblity 6 * ### Accessiblity
7 * 7 *
8 * Changing the `invalid` property, either manually or by calling `validate()` will update the 8 * Changing the `invalid` property, either manually or by calling `validate()` will update the
9 * `aria-invalid` attribute. 9 * `aria-invalid` attribute.
10 * 10 *
(...skipping 16 matching lines...) Expand all
27 * Name of the validator to use. 27 * Name of the validator to use.
28 */ 28 */
29 validator: { 29 validator: {
30 type: String 30 type: String
31 }, 31 },
32 32
33 /** 33 /**
34 * True if the last call to `validate` is invalid. 34 * True if the last call to `validate` is invalid.
35 */ 35 */
36 invalid: { 36 invalid: {
37 notify: true,
37 reflectToAttribute: true, 38 reflectToAttribute: true,
38 type: Boolean, 39 type: Boolean,
39 value: false 40 value: false
40 }, 41 },
41 42
42 _validatorMeta: { 43 _validatorMeta: {
43 type: Object 44 type: Object
44 } 45 }
45 46
46 }, 47 },
(...skipping 12 matching lines...) Expand all
59 60
60 _invalidChanged: function() { 61 _invalidChanged: function() {
61 if (this.invalid) { 62 if (this.invalid) {
62 this.setAttribute('aria-invalid', 'true'); 63 this.setAttribute('aria-invalid', 'true');
63 } else { 64 } else {
64 this.removeAttribute('aria-invalid'); 65 this.removeAttribute('aria-invalid');
65 } 66 }
66 }, 67 },
67 68
68 /** 69 /**
69 * @return {Boolean} True if the validator `validator` exists. 70 * @return {boolean} True if the validator `validator` exists.
70 */ 71 */
71 hasValidator: function() { 72 hasValidator: function() {
72 return this._validator != null; 73 return this._validator != null;
73 }, 74 },
74 75
75 /** 76 /**
76 * @param {Object} values Passed to the validator's `validate()` function. 77 * @param {Object} values Passed to the validator's `validate()` function.
77 * @return {Boolean} True if `values` is valid. 78 * @return {boolean} True if `values` is valid.
78 */ 79 */
79 validate: function(values) { 80 validate: function(values) {
80 var valid = this._validator && this._validator.validate(values); 81 var valid = this._validator && this._validator.validate(values);
81 this.invalid = !valid; 82 this.invalid = !valid;
82 return valid; 83 return valid;
83 } 84 }
84 85
85 }; 86 };
86 87
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698