summaryrefslogtreecommitdiffstats
path: root/ui/webui
diff options
context:
space:
mode:
authormtomasz@chromium.org <mtomasz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-07 19:46:00 +0000
committermtomasz@chromium.org <mtomasz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-07 19:46:00 +0000
commit52516b7e3e62b9a055bf3171c560adcd9bf313a3 (patch)
treec6d4458e7278b766b292daf897072affc1549960 /ui/webui
parenta6c8d02ee57308e7cfe67b77afb883001c0aa7a0 (diff)
downloadchromium_src-52516b7e3e62b9a055bf3171c560adcd9bf313a3.zip
chromium_src-52516b7e3e62b9a055bf3171c560adcd9bf313a3.tar.gz
chromium_src-52516b7e3e62b9a055bf3171c560adcd9bf313a3.tar.bz2
Make menu buttons accesible by enabling TTS on the menu.
Before, menu buttons were not read by ChromeVox. This patch makes ChromeVox read the menu items by adding an appriopriate aria attribute to the parent, and to the button. TEST=Go to Files.app, check if the Gear menu invokes TTS on the menu items. BUG=264897 Review URL: https://chromiumcodereview.appspot.com/21735003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216252 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/webui')
-rw-r--r--ui/webui/resources/js/cr/ui/menu.js4
-rw-r--r--ui/webui/resources/js/cr/ui/menu_item.js5
2 files changed, 7 insertions, 2 deletions
diff --git a/ui/webui/resources/js/cr/ui/menu.js b/ui/webui/resources/js/cr/ui/menu.js
index d46980f..4956b38 100644
--- a/ui/webui/resources/js/cr/ui/menu.js
+++ b/ui/webui/resources/js/cr/ui/menu.js
@@ -144,8 +144,10 @@ cr.define('cr.ui', function() {
this.selectedIndex = 0;
}
- if (this.selectedItem)
+ if (this.selectedItem) {
this.selectedItem.focus();
+ this.setAttribute('aria-activedescendant', this.selectedItem.id);
+ }
},
/**
diff --git a/ui/webui/resources/js/cr/ui/menu_item.js b/ui/webui/resources/js/cr/ui/menu_item.js
index d1ab2ea..89054e2 100644
--- a/ui/webui/resources/js/cr/ui/menu_item.js
+++ b/ui/webui/resources/js/cr/ui/menu_item.js
@@ -40,7 +40,10 @@ cr.define('cr.ui', function() {
// the appearance of this element.
this.classList.add('custom-appearance');
- this.setAttribute('role', 'menuitem');
+ // Enable Text to Speech on the menu. Additionaly, ID has to be set, since
+ // it is used in element's aria-activedescendant attribute.
+ if (!this.isSeparator())
+ this.setAttribute('role', 'menuitem');
var iconUrl;
if ((iconUrl = this.getAttribute('icon')))