Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | |
|
dgozman
2017/01/26 23:21:42
no (c)
einbinder
2017/01/27 00:19:27
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 UI.ARIAUtils = class { | |
|
dgozman
2017/01/26 23:21:42
Are we going to have any logic here? I'm usually n
einbinder
2017/01/27 00:19:27
It is mostly for type checking, and to have an org
| |
| 6 /** | |
| 7 * @param {!Element} element | |
| 8 */ | |
| 9 static makeTab(element) { | |
| 10 element.setAttribute('role', 'tab'); | |
| 11 } | |
| 12 | |
| 13 /** | |
| 14 * @param {!Element} element | |
| 15 * @param {boolean} value | |
| 16 */ | |
| 17 static setSelected(element, value) { | |
| 18 element.setAttribute('aria-selected', !!value); | |
|
dgozman
2017/01/26 23:21:42
Remove !!
einbinder
2017/01/27 00:19:27
We have a lot of bugs with closure where it thinks
| |
| 19 } | |
| 20 | |
| 21 /** | |
| 22 * @param {!Element} element | |
| 23 * @param {boolean} value | |
| 24 */ | |
| 25 static setPressed(element, value) { | |
| 26 element.setAttribute('aria-pressed', !!value); | |
|
aboxhall
2017/01/26 22:47:26
This may not work for all cases. Note that pressed
dgozman
2017/01/26 23:21:42
Remove !!
| |
| 27 } | |
| 28 | |
| 29 /** | |
| 30 * @param {!Element} element | |
| 31 * @param {string} name | |
| 32 */ | |
| 33 static setAccessibleName(element, name) { | |
| 34 element.setAttribute('aria-label', name); | |
| 35 } | |
| 36 }; | |
| OLD | NEW |