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

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

Issue 2671203002: DevTools: Added ARIA roles & states to treeoutline (Closed)
Patch Set: updated Layout tests with expected ARIA attributes 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 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
index 94472e37bcbfe74e244f9f5d47aaeb6a80c1866a..6998db4023f53058f26bc7808154ed93f01bc29d 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/ARIAUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/ARIAUtils.js
@@ -7,12 +7,55 @@ UI.ARIAUtils = {};
/**
* @param {!Element} element
*/
+UI.ARIAUtils.markAsGroup = function(element) {
+ element.setAttribute('role', 'group');
+};
+
+/**
+ * @param {!Element} element
+ */
UI.ARIAUtils.markAsTab = function(element) {
element.setAttribute('role', 'tab');
};
/**
* @param {!Element} element
+ */
+UI.ARIAUtils.markAsTree = function(element) {
+ element.setAttribute('role', 'tree');
+};
+
+/**
+ * @param {!Element} element
+ */
+UI.ARIAUtils.markAsTreeitem = function(element) {
+ element.setAttribute('role', 'treeitem');
+};
+
+/**
+ * @param {!Element} element
+ */
+UI.ARIAUtils.markAsPresentation = function(element) {
+ element.setAttribute('role', 'presentation');
+};
+
+/**
+ * @param {!Element} element
+ * @param {boolean} value
+ */
+UI.ARIAUtils.setExpanded = function(element, value) {
+ element.setAttribute('aria-expanded', !!value);
+};
+
+/**
+ * @param {!Element} element
+ */
+UI.ARIAUtils.unsetExpanded = function(element) {
+ element.removeAttribute('aria-expanded');
+};
+
+/**
+ * @param {!Element} element
* @param {boolean} value
*/
UI.ARIAUtils.setSelected = function(element, value) {

Powered by Google App Engine
This is Rietveld 408576698