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

Unified Diff: ui/webui/resources/js/cr/ui/list.js

Issue 2346393004: Give descendants of cr.ui.ListItem a unique ID to fix accessibility. (Closed)
Patch Set: Fix two test failures Created 4 years, 3 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: ui/webui/resources/js/cr/ui/list.js
diff --git a/ui/webui/resources/js/cr/ui/list.js b/ui/webui/resources/js/cr/ui/list.js
index c12088640464486827402a9ae117024c104c6e75..d85af804b4548770afa3c73273d64144fdfcf6d8 100644
--- a/ui/webui/resources/js/cr/ui/list.js
+++ b/ui/webui/resources/js/cr/ui/list.js
@@ -333,19 +333,6 @@ cr.define('cr.ui', function() {
// Make list focusable
if (!this.hasAttribute('tabindex'))
this.tabIndex = 0;
-
- // Try to get an unique id prefix from the id of this element or the
- // nearest ancestor with an id.
- var element = this;
- while (element && !element.id)
- element = element.parentElement;
- if (element && element.id)
- this.uniqueIdPrefix_ = element.id;
- else
- this.uniqueIdPrefix_ = 'list';
-
- // The next id suffix to use when giving each item an unique id.
- this.nextUniqueIdSuffix_ = 0;
},
/**
@@ -626,6 +613,8 @@ cr.define('cr.ui', function() {
self.scrollIndexIntoView(e.newValue);
}, 0);
}
+ } else {
+ this.removeAttribute('aria-activedescendant');
}
},
@@ -817,7 +806,6 @@ cr.define('cr.ui', function() {
createItem: function(value) {
var item = new this.itemConstructor_(value);
item.label = value;
- item.id = this.uniqueIdPrefix_ + '-' + this.nextUniqueIdSuffix_++;
if (typeof item.decorate == 'function')
item.decorate();
return item;
« no previous file with comments | « ui/file_manager/integration_tests/file_manager/create_new_folder.js ('k') | ui/webui/resources/js/cr/ui/list_item.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698