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

Side by Side Diff: third_party/polymer/v1_0/chromium.patch

Issue 2715763002: MD-Settings A11y: Disable radio list if all options are disabled. (Closed)
Patch Set: fix closure Created 3 years, 9 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 diff --git a/components-chromium/font-roboto/roboto.html b/components-chromium/f ont-roboto/roboto.html 1 diff --git a/components-chromium/font-roboto/roboto.html b/components-chromium/f ont-roboto/roboto.html
2 index 7a24999..4eefcba 100644 2 index 7a24999..4eefcba 100644
3 --- a/components-chromium/font-roboto/roboto.html 3 --- a/components-chromium/font-roboto/roboto.html
4 +++ b/components-chromium/font-roboto/roboto.html 4 +++ b/components-chromium/font-roboto/roboto.html
5 @@ -7,5 +7,4 @@ The complete set of contributors may be found at http://polymer. github.io/CONTRI 5 @@ -7,5 +7,4 @@ The complete set of contributors may be found at http://polymer. github.io/CONTRI
6 Code distributed by Google as part of the polymer project is also 6 Code distributed by Google as part of the polymer project is also
7 subject to an additional IP rights grant found at http://polymer.github.io/PATE NTS.txt 7 subject to an additional IP rights grant found at http://polymer.github.io/PATE NTS.txt
8 --> 8 -->
9 -<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400 ,300,300italic,400italic,500,500italic,700,700italic"> 9 -<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400 ,300,300italic,400italic,500,500italic,700,700italic">
10 -<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mon o:400,700"> 10 -<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mon o:400,700">
11 +<link rel="stylesheet" href="chrome://resources/css/roboto.css"> 11 +<link rel="stylesheet" href="chrome://resources/css/roboto.css">
12 diff --git a/components-chromium/paper-input/paper-textarea-extracted.js b/compo nents-chromium/paper-input/paper-textarea-extracted.js 12 diff --git a/components-chromium/paper-input/paper-textarea-extracted.js b/compo nents-chromium/paper-input/paper-textarea-extracted.js
13 index 78a2a9ec621c..8b776dd790ea 100644 13 index 78a2a9ec621c..8b776dd790ea 100644
14 --- a/components-chromium/paper-input/paper-textarea-extracted.js 14 --- a/components-chromium/paper-input/paper-textarea-extracted.js
15 +++ b/components-chromium/paper-input/paper-textarea-extracted.js 15 +++ b/components-chromium/paper-input/paper-textarea-extracted.js
16 @@ -43,8 +43,8 @@ Polymer({ 16 @@ -43,8 +43,8 @@ Polymer({
17 } 17 }
18 }, 18 },
19 19
20 - _ariaLabelledByChanged: function(ariaLabelledBy) { 20 - _ariaLabelledByChanged: function(ariaLabelledBy) {
21 - this.$.input.textarea.setAttribute('aria-labelledby', ariaLabelledBy); 21 - this.$.input.textarea.setAttribute('aria-labelledby', ariaLabelledBy);
22 + _ariaLabelledByChanged: function() { 22 + _ariaLabelledByChanged: function() {
23 + this.$.input.textarea.setAttribute('aria-label', this.label); 23 + this.$.input.textarea.setAttribute('aria-label', this.label);
24 }, 24 },
25 25
26 _ariaDescribedByChanged: function(ariaDescribedBy) { 26 _ariaDescribedByChanged: function(ariaDescribedBy) {
27 diff --git a/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iro n-menu-behavior-extracted.js b/third_party/polymer/v1_0/components-chromium/iron -menu-behavior/iron-menu-behavior-extracted.js
28 index bb0ed59e2e21..26605e1977ae 100644
29 --- 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.
30 +++ b/third_party/polymer/v1_0/components-chromium/iron-menu-behavior/iron-menu- behavior-extracted.js
31 @@ -25,12 +25,18 @@
32 */
33 attrForItemTitle: {
34 type: String
35 + },
36 +
37 + disabled: {
38 + type: Boolean,
39 + value: false,
40 + reflectToAttribute: true,
41 + observer: '_disableTabindex',
42 }
43 },
44
45 hostAttributes: {
46 'role': 'menu',
47 - 'tabindex': '0'
48 },
49
50 observers: [
51 @@ -83,7 +89,11 @@
52 var selectedItem = this.multi ? (this.selectedItems && this.selectedItems [0]) : this.selectedItem;
53
54 this.items.forEach(function(item) {
55 - item.setAttribute('tabindex', item === selectedItem ? '0' : '-1');
56 + // Don't enable tab index if an item is disabled, even if it's selected .
57 + if (item === selectedItem && !selectedItem.hasAttribute('disabled') && !this.disabled)
58 + item.setAttribute('tabindex', 0);
59 + else
60 + item.removeAttribute('tabindex');
61 }, this);
62 },
63
64 @@ -194,8 +204,8 @@
65 * applicable.
66 */
67 _focusedItemChanged: function(focusedItem, old) {
68 - old && old.setAttribute('tabindex', '-1');
69 - if (focusedItem) {
70 + old && old.removeAttribute('tabindex');
71 + if (focusedItem && !focusedItem.hasAttribute('disabled') && !this.disable d) {
72 focusedItem.setAttribute('tabindex', '0');
73 focusedItem.focus();
74 }
75 @@ -220,16 +230,16 @@
76 * @param {CustomEvent} event A key combination event.
77 */
78 _onShiftTabDown: function(event) {
79 - var oldTabIndex = this.getAttribute('tabindex');
80 + var couldTab = this.getAttribute('tabindex') == 0;
81
82 Polymer.IronMenuBehaviorImpl._shiftTabPressed = true;
83
84 this._setFocusedItem(null);
85
86 - this.setAttribute('tabindex', '-1');
87 + this._disableTabindex(true);
88
89 this.async(function() {
90 - this.setAttribute('tabindex', oldTabIndex);
91 + this._disableTabindex(!couldTab);
92 Polymer.IronMenuBehaviorImpl._shiftTabPressed = false;
93 // NOTE(cdata): polymer/polymer#1305
94 }, 1);
95 @@ -319,6 +329,17 @@
96 _activateHandler: function(event) {
97 Polymer.IronSelectableBehavior._activateHandler.call(this, event);
98 event.stopPropagation();
99 + },
100 +
101 + /**
102 + * Updates this element's tab index when it's enabled/disabled.
103 + * @param {boolean} disabled
104 + */
105 + _disableTabindex: function(disabled) {
106 + if (disabled)
107 + this.removeAttribute('tabindex'); // No tabindex means not tab-able or select-able.
108 + else
109 + this.setAttribute('tabindex', 0); // tabindex of 0 means tab-able.
110 }
111 };
112
113 @@ -329,4 +350,4 @@
114 Polymer.IronMultiSelectableBehavior,
115 Polymer.IronA11yKeysBehavior,
116 Polymer.IronMenuBehaviorImpl
117 - ];
118 \ No newline at end of file
119 + ];
120 diff --git a/third_party/polymer/v1_0/components-chromium/paper-radio-group/pape r-radio-group-extracted.js b/third_party/polymer/v1_0/components-chromium/paper- radio-group/paper-radio-group-extracted.js
121 index 642f8ec5a698..3456c15f231f 100644
122 --- a/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio -group-extracted.js
123 +++ b/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio -group-extracted.js
124 @@ -7,7 +7,6 @@ Polymer({
125
126 hostAttributes: {
127 role: 'radiogroup',
128 - tabindex: 0
129 },
130
131 properties: {
132 @@ -108,4 +107,4 @@ Polymer({
133 Polymer.IronMenubarBehaviorImpl._onRightKey.apply(this, arguments);
134 this._activateFocusedItem();
135 }
136 - });
137 \ No newline at end of file
138 + });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698