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

Side by Side Diff: third_party/polymer/v1_0/components-chromium/iron-behaviors/iron-control-state-extracted.js

Issue 1336623003: [MD settings] updating polymer to 1.1.13 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed Polymer.IronCheckedElementBehavior name Created 5 years, 3 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 * @demo demo/index.html 2 * @demo demo/index.html
3 * @polymerBehavior 3 * @polymerBehavior
4 */ 4 */
5 Polymer.IronControlState = { 5 Polymer.IronControlState = {
6 6
7 properties: { 7 properties: {
8 8
9 /** 9 /**
10 * If true, the element currently has focus. 10 * If true, the element currently has focus.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 observers: [ 44 observers: [
45 '_changedControlState(focused, disabled)' 45 '_changedControlState(focused, disabled)'
46 ], 46 ],
47 47
48 ready: function() { 48 ready: function() {
49 this.addEventListener('focus', this._boundFocusBlurHandler, true); 49 this.addEventListener('focus', this._boundFocusBlurHandler, true);
50 this.addEventListener('blur', this._boundFocusBlurHandler, true); 50 this.addEventListener('blur', this._boundFocusBlurHandler, true);
51 }, 51 },
52 52
53 _focusBlurHandler: function(event) { 53 _focusBlurHandler: function(event) {
54 var target = event.path ? event.path[0] : event.target; 54 // NOTE(cdata): if we are in ShadowDOM land, `event.target` will
55 if (target === this) { 55 // eventually become `this` due to retargeting; if we are not in
56 // ShadowDOM land, `event.target` will eventually become `this` due
57 // to the second conditional which fires a synthetic event (that is also
58 // handled). In either case, we can disregard `event.path`.
59
60 if (event.target === this) {
56 var focused = event.type === 'focus'; 61 var focused = event.type === 'focus';
57 this._setFocused(focused); 62 this._setFocused(focused);
58 } else if (!this.shadowRoot) { 63 } else if (!this.shadowRoot) {
59 this.fire(event.type, {sourceEvent: event}, { 64 this.fire(event.type, {sourceEvent: event}, {
60 node: this, 65 node: this,
61 bubbles: event.bubbles, 66 bubbles: event.bubbles,
62 cancelable: event.cancelable 67 cancelable: event.cancelable
63 }); 68 });
64 } 69 }
65 }, 70 },
(...skipping 11 matching lines...) Expand all
77 }, 82 },
78 83
79 _changedControlState: function() { 84 _changedControlState: function() {
80 // _controlStateChanged is abstract, follow-on behaviors may implement it 85 // _controlStateChanged is abstract, follow-on behaviors may implement it
81 if (this._controlStateChanged) { 86 if (this._controlStateChanged) {
82 this._controlStateChanged(); 87 this._controlStateChanged();
83 } 88 }
84 } 89 }
85 90
86 }; 91 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698