Commit a59b979e authored by Gavin Williams's avatar Gavin Williams Committed by Commit Bot

Improve ChromeVox experience for OS settings Language page

There are three main changes needed to improve the ChromeVox experience for the
settings OS language page:

-Apply aria-hidden to the language labels to remove them from ChromeVox
 navigation. Instead only navigate to the associated buttons

-When a user chooses a language to display the system text in, a Restart button
 is displayed on the screen. That Restart button needs a label to better
 describe/announce its purpose.

-Each item in the "Input method" keyboard list used two ChromeVox navigation
 stops instead of one. Applying aria-hidden to the inner div then aria-label to
 the outer div fixed this behavior

Screen captures:
Before: https://bugs.chromium.org/p/chromium/issues/detail?id=976452#c15
After: https://bugs.chromium.org/p/chromium/issues/detail?id=976452#c16

Bug: 976452
Change-Id: I90a70f3c4197a3b0f6eea3f8696d36766eba373d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1952091
Commit-Queue: Gavin Williams <gavinwill@chromium.org>
Reviewed-by: default avatarHector Carmona <hcarmona@chromium.org>
Reviewed-by: default avatarBailey Berro <baileyberro@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723548}
parent 5e849d3d
......@@ -2880,6 +2880,9 @@
<message name="IDS_SETTINGS_LANGUAGES_DISPLAY_IN_THIS_LANGUAGE" desc="The label used for a button that changes the UI language.">
Show system text in this language
</message>
<message name="IDS_SETTINGS_LANGUAGES_RESTART_TO_DISPLAY_LANGUAGE" desc="The aria label to be read aloud to describe a button for restarting the device to change the device's UI language.">
Restart device to show system text in <ph name="LANGUAGE">$1<ex>English</ex></ph>
</message>
</if>
<if expr="not chromeos">
<message name="IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_ORDERING_INSTRUCTIONS" desc="Explanatory message about ordering the list of languages.">
......
......@@ -155,7 +155,8 @@
<template is="dom-repeat" items="[[languages.enabled]]">
<div class$="list-item [[getLanguageItemClass_(
item.language.code, language.prospectiveUILanguage)]]">
<div class="start">
<div class="start" id="displayText-[[index]]"
aria-hidden="true">
<div title="[[item.language.nativeDisplayName]]">
[[item.language.displayName]]
</div>
......@@ -169,13 +170,17 @@
<template is="dom-if" if="[[isRestartRequired_(
item.language.code, languages.prospectiveUILanguage)]]"
restamp>
<cr-button id="restartButton" on-click="onRestartTap_">
<cr-button id="restartButton" on-click="onRestartTap_"
aria-label$="[[getRestartButtonDescription_(
item.language.displayName)]]">
$i18n{restart}
</cr-button>
</template>
<cr-icon-button class="icon-more-vert"
title="$i18n{moreActions}" id="more-[[item.language.code]]"
on-click="onDotsTap_"></cr-icon-button>
on-click="onDotsTap_"
aria-labelledby$="displayText-[[index]]">
</cr-icon-button>
</div>
</template>
<div class="list-item">
......@@ -197,8 +202,9 @@
actionable on-click="onInputMethodTap_"
on-keypress="onInputMethodTap_" on-mousedown="onMouseDown_"
tabindex$="[[getInputMethodTabIndex_(
item.id, languages.inputMethods.currentId)]]">
<div class="start">
item.id, languages.inputMethods.currentId)]]"
aria-labelledby$="language-[[index]]" role="button">
<div class="start" id="language-[[index]]" aria-hidden="true">
<div class="display-name">[[item.displayName]]</div>
<div class="explain-selected"
hidden="[[!isCurrentInputMethod_(
......
......@@ -495,5 +495,14 @@ Polymer({
// Preventing the mousedown event from propagating prevents focus being set.
e.preventDefault();
},
/**
* @param {string} language The language displayed in the row
* @return {string}
* @private
*/
getRestartButtonDescription_: function(language) {
return this.i18n('displayLanguageRestart', language);
},
});
})();
......@@ -1660,6 +1660,8 @@ void AddLanguagesStrings(content::WebUIDataSource* html_source) {
{"manageInputMethodsPageTitle",
IDS_SETTINGS_LANGUAGES_MANAGE_INPUT_METHODS_TITLE},
{"showImeMenu", IDS_SETTINGS_LANGUAGES_SHOW_IME_MENU},
{"displayLanguageRestart",
IDS_SETTINGS_LANGUAGES_RESTART_TO_DISPLAY_LANGUAGE},
#endif
{"addLanguagesDialogTitle", IDS_SETTINGS_LANGUAGES_MANAGE_LANGUAGES_TITLE},
{"allLanguages", IDS_SETTINGS_LANGUAGES_ALL_LANGUAGES},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment