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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/ARIAUtils.js

Issue 2655393003: DevTools: Introduce ARIAUtils (Closed)
Patch Set: Use namespace instead of class Created 3 years, 10 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
(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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698