Changeset 258730 in webkit
- Timestamp:
- Mar 19, 2020 2:41:33 PM (4 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r258729 r258730 1 2020-03-19 Nikita Vasilyev <nvasilyev@apple.com> 2 3 Web Inspector: AXI: disabled buttons shouldn't be focusable 4 https://bugs.webkit.org/show_bug.cgi?id=208283 5 <rdar://problem/59832150> 6 7 Reviewed by Devin Rousso. 8 9 Set tabIndex to "-1" when button becomes disabled. 10 11 * UserInterface/Views/ActivateButtonNavigationItem.js: 12 (WI.ActivateButtonNavigationItem): 13 * UserInterface/Views/ButtonNavigationItem.js: 14 `_role` is defined in the parent class now. 15 16 (WI.ButtonNavigationItem): 17 (WI.ButtonNavigationItem.prototype.set enabled): 18 (WI.ButtonNavigationItem.prototype.get tabbable): 19 (WI.ButtonNavigationItem.prototype._updateTabIndex): 20 * UserInterface/Views/RadioButtonNavigationItem.js: 21 (WI.RadioButtonNavigationItem.prototype.get tabbable): 22 (WI.RadioButtonNavigationItem): 23 1 24 2020-03-19 Nikita Vasilyev <nvasilyev@apple.com> 2 25 -
trunk/Source/WebInspectorUI/UserInterface/Views/ActivateButtonNavigationItem.js
r257411 r258730 32 32 this._defaultToolTip = defaultToolTip; 33 33 this._activatedToolTip = activatedToolTip || defaultToolTip; 34 this._role = role;35 34 } 36 35 -
trunk/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.js
r257759 r258730 41 41 this.element.addEventListener("mousedown", this._handleMouseDown.bind(this), true); 42 42 43 if (role === "button") {44 this.element.tabIndex = 0;43 this._role = role; 44 if (this._role === "button") 45 45 this.element.addEventListener("keydown", this._handleKeyDown.bind(this)); 46 }47 46 48 47 if (label) … … 56 55 this._label = toolTipOrLabel; 57 56 57 this._updateTabIndex(); 58 58 59 this.buttonStyle = this._image ? WI.ButtonNavigationItem.Style.Image : WI.ButtonNavigationItem.Style.Text; 59 60 … … 112 113 this._enabled = flag; 113 114 this.element.classList.toggle("disabled", !this._enabled); 115 this.element.ariaDisabled = !this._enabled; 116 117 this._updateTabIndex(); 114 118 } 115 119 … … 169 173 { 170 174 return ["button"]; 175 } 176 177 get tabbable() 178 { 179 return this._role === "button"; 171 180 } 172 181 … … 229 238 } 230 239 } 240 241 _updateTabIndex() 242 { 243 if (!this._enabled) { 244 this.element.tabIndex = -1; 245 return; 246 } 247 248 this.element.tabIndex = this.tabbable ? 0 : -1; 249 } 231 250 }; 232 251 -
trunk/Source/WebInspectorUI/UserInterface/Views/RadioButtonNavigationItem.js
r256652 r258730 67 67 return ["radio", "button"]; 68 68 } 69 70 get tabbable() 71 { 72 return this.selected ? 0 : -1; 73 } 69 74 }; 70 75
Note: See TracChangeset
for help on using the changeset viewer.