OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
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 = {}; | |
6 | |
7 /** | |
8 * @param {!Element} element | |
9 */ | |
10 UI.ARIAUtils.markAsTab = function(element) { | |
11 element.setAttribute('role', 'tab'); | |
12 }; | |
13 | |
14 /** | |
15 * @param {!Element} element | |
16 * @param {boolean} value | |
17 */ | |
18 UI.ARIAUtils.setSelected = function(element, value) { | |
19 element.setAttribute('aria-selected', !!value); | |
dgozman
2017/01/27 23:12:59
Let's add a comment about !!
einbinder
2017/02/02 22:53:32
Done.
| |
20 }; | |
21 | |
22 /** | |
23 * @param {!Element} element | |
24 * @param {boolean} value | |
25 */ | |
26 UI.ARIAUtils.setPressed = function(element, value) { | |
27 element.setAttribute('aria-pressed', !!value); | |
dgozman
2017/01/27 23:12:59
Let's add a comment about !!
einbinder
2017/02/02 22:53:32
Done.
| |
28 }; | |
29 | |
30 /** | |
31 * @param {!Element} element | |
32 * @param {string} name | |
33 */ | |
34 UI.ARIAUtils.setAccessibleName = function(element, name) { | |
35 element.setAttribute('aria-label', name); | |
36 }; | |
OLD | NEW |