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

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

Issue 2655393003: DevTools: Introduce ARIAUtils (Closed)
Patch Set: add the file Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/ui/ARIAUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/ARIAUtils.js b/third_party/WebKit/Source/devtools/front_end/ui/ARIAUtils.js
new file mode 100644
index 0000000000000000000000000000000000000000..210185ee26134604033e3113224b078d8862cb1f
--- /dev/null
+++ b/third_party/WebKit/Source/devtools/front_end/ui/ARIAUtils.js
@@ -0,0 +1,36 @@
+// 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.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+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
+ /**
+ * @param {!Element} element
+ */
+ static makeTab(element) {
+ element.setAttribute('role', 'tab');
+ }
+
+ /**
+ * @param {!Element} element
+ * @param {boolean} value
+ */
+ static setSelected(element, value) {
+ 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
+ }
+
+ /**
+ * @param {!Element} element
+ * @param {boolean} value
+ */
+ static setPressed(element, value) {
+ 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 !!
+ }
+
+ /**
+ * @param {!Element} element
+ * @param {string} name
+ */
+ static setAccessibleName(element, name) {
+ element.setAttribute('aria-label', name);
+ }
+};

Powered by Google App Engine
This is Rietveld 408576698