Chromium Code Reviews| Index: third_party/polymer/v1_0/chromium.patch |
| diff --git a/third_party/polymer/v1_0/chromium.patch b/third_party/polymer/v1_0/chromium.patch |
| index 8b99b23f099dfaa63080fe6a058cbaf9e4286782..a210f0ccb2254538c63a466ae1bd437db792a42a 100644 |
| --- a/third_party/polymer/v1_0/chromium.patch |
| +++ b/third_party/polymer/v1_0/chromium.patch |
| @@ -24,3 +24,115 @@ index 78a2a9ec621c..8b776dd790ea 100644 |
| }, |
| _ariaDescribedByChanged: function(ariaDescribedBy) { |
| +diff --git a/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menu-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menu-behavior-extracted.js |
| +index bb0ed59e2e21..26605e1977ae 100644 |
| +--- a/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menu-behavior-extracted.js |
|
Dan Beam
2017/03/17 23:58:53
this is the wrong path. please check that your pa
hcarmona
2017/03/18 01:05:07
Done.
|
| ++++ b/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menu-behavior-extracted.js |
| +@@ -25,12 +25,18 @@ |
| + */ |
| + attrForItemTitle: { |
| + type: String |
| ++ }, |
| ++ |
| ++ disabled: { |
| ++ type: Boolean, |
| ++ value: false, |
| ++ reflectToAttribute: true, |
| ++ observer: '_disableTabindex', |
| + } |
| + }, |
| + |
| + hostAttributes: { |
| + 'role': 'menu', |
| +- 'tabindex': '0' |
| + }, |
| + |
| + observers: [ |
| +@@ -83,7 +89,11 @@ |
| + var selectedItem = this.multi ? (this.selectedItems && this.selectedItems[0]) : this.selectedItem; |
| + |
| + this.items.forEach(function(item) { |
| +- item.setAttribute('tabindex', item === selectedItem ? '0' : '-1'); |
| ++ // Don't enable tab index if an item is disabled, even if it's selected. |
| ++ if (item === selectedItem && !selectedItem.hasAttribute('disabled') && !this.disabled) |
| ++ item.setAttribute('tabindex', 0); |
| ++ else |
| ++ item.removeAttribute('tabindex'); |
| + }, this); |
| + }, |
| + |
| +@@ -194,8 +204,8 @@ |
| + * applicable. |
| + */ |
| + _focusedItemChanged: function(focusedItem, old) { |
| +- old && old.setAttribute('tabindex', '-1'); |
| +- if (focusedItem) { |
| ++ old && old.removeAttribute('tabindex'); |
| ++ if (focusedItem && !focusedItem.hasAttribute('disabled') && !this.disabled) { |
| + focusedItem.setAttribute('tabindex', '0'); |
| + focusedItem.focus(); |
| + } |
| +@@ -220,16 +230,16 @@ |
| + * @param {CustomEvent} event A key combination event. |
| + */ |
| + _onShiftTabDown: function(event) { |
| +- var oldTabIndex = this.getAttribute('tabindex'); |
| ++ var couldTab = this.getAttribute('tabindex') == 0; |
| + |
| + Polymer.IronMenuBehaviorImpl._shiftTabPressed = true; |
| + |
| + this._setFocusedItem(null); |
| + |
| +- this.setAttribute('tabindex', '-1'); |
| ++ this._disableTabindex(true); |
| + |
| + this.async(function() { |
| +- this.setAttribute('tabindex', oldTabIndex); |
| ++ this._disableTabindex(!couldTab); |
| + Polymer.IronMenuBehaviorImpl._shiftTabPressed = false; |
| + // NOTE(cdata): polymer/polymer#1305 |
| + }, 1); |
| +@@ -319,6 +329,17 @@ |
| + _activateHandler: function(event) { |
| + Polymer.IronSelectableBehavior._activateHandler.call(this, event); |
| + event.stopPropagation(); |
| ++ }, |
| ++ |
| ++ /** |
| ++ * Updates this element's tab index when it's enabled/disabled. |
| ++ * @param {boolean} disabled |
| ++ */ |
| ++ _disableTabindex: function(disabled) { |
| ++ if (disabled) |
| ++ this.removeAttribute('tabindex'); // No tabindex means not tab-able or select-able. |
| ++ else |
| ++ this.setAttribute('tabindex', 0); // tabindex of 0 means tab-able. |
| + } |
| + }; |
| + |
| +@@ -329,4 +350,4 @@ |
| + Polymer.IronMultiSelectableBehavior, |
| + Polymer.IronA11yKeysBehavior, |
| + Polymer.IronMenuBehaviorImpl |
| +- ]; |
| +\ No newline at end of file |
| ++ ]; |
| +diff --git a/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js |
| +index 642f8ec5a698..3456c15f231f 100644 |
| +--- a/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js |
| ++++ b/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js |
| +@@ -7,7 +7,6 @@ Polymer({ |
| + |
| + hostAttributes: { |
| + role: 'radiogroup', |
| +- tabindex: 0 |
| + }, |
| + |
| + properties: { |
| +@@ -108,4 +107,4 @@ Polymer({ |
| + Polymer.IronMenubarBehaviorImpl._onRightKey.apply(this, arguments); |
| + this._activateFocusedItem(); |
| + } |
| +- }); |
| +\ No newline at end of file |
| ++ }); |