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

Unified Diff: chrome/browser/resources/chromeos/chromevox/common/dom_util.js

Issue 1362223003: Improve braille related message descriptions and clean up message handling in Chromevox. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@inputtypeexception
Patch Set: Move another braille message to Msgs.Untranslated Created 5 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: chrome/browser/resources/chromeos/chromevox/common/dom_util.js
diff --git a/chrome/browser/resources/chromeos/chromevox/common/dom_util.js b/chrome/browser/resources/chromeos/chromevox/common/dom_util.js
index 474f42adacb86d26a46545299c44196874b31931..cea00b5f6129e6b480d5098633fd008606ab3b69 100644
--- a/chrome/browser/resources/chromeos/chromevox/common/dom_util.js
+++ b/chrome/browser/resources/chromeos/chromevox/common/dom_util.js
@@ -35,24 +35,24 @@ cvox.DomUtil = function() {
* @type {Object}
*/
cvox.DomUtil.INPUT_TYPE_TO_INFORMATION_TABLE_MSG = {
- 'button' : 'input_type_button',
- 'checkbox' : 'input_type_checkbox',
+ 'button' : 'role_button',
+ 'checkbox' : 'role_checkbox',
'color' : 'input_type_color',
'datetime' : 'input_type_datetime',
'datetime-local' : 'input_type_datetime_local',
'date' : 'input_type_date',
'email' : 'input_type_email',
'file' : 'input_type_file',
- 'image' : 'input_type_image',
+ 'image' : 'role_button',
'month' : 'input_type_month',
'number' : 'input_type_number',
'password' : 'input_type_password',
- 'radio' : 'input_type_radio',
- 'range' : 'input_type_range',
+ 'radio' : 'role_radio',
+ 'range' : 'role_slider',
'reset' : 'input_type_reset',
'search' : 'input_type_search',
- 'submit' : 'input_type_submit',
- 'tel' : 'input_type_tel',
+ 'submit' : 'role_button',
+ 'tel' : 'input_type_number',
'text' : 'input_type_text',
'url' : 'input_type_url',
'week' : 'input_type_week'
@@ -66,11 +66,11 @@ cvox.DomUtil.INPUT_TYPE_TO_INFORMATION_TABLE_MSG = {
* @type {Object}
*/
cvox.DomUtil.TAG_TO_INFORMATION_TABLE_VERBOSE_MSG = {
- 'A' : 'tag_link',
+ 'A' : 'role_link',
'ARTICLE' : 'tag_article',
'ASIDE' : 'tag_aside',
'AUDIO' : 'tag_audio',
- 'BUTTON' : 'tag_button',
+ 'BUTTON' : 'role_button',
'FOOTER' : 'tag_footer',
'H1' : 'tag_h1',
'H2' : 'tag_h2',
@@ -99,7 +99,7 @@ cvox.DomUtil.TAG_TO_INFORMATION_TABLE_VERBOSE_MSG = {
*/
cvox.DomUtil.TAG_TO_INFORMATION_TABLE_BRIEF_MSG = {
'AUDIO' : 'tag_audio',
- 'BUTTON' : 'tag_button',
+ 'BUTTON' : 'role_button',
'SELECT' : 'tag_select',
'TABLE' : 'tag_table',
'TEXTAREA' : 'tag_textarea',
@@ -872,7 +872,7 @@ cvox.DomUtil.getValue = function(node) {
// of the selection only since we don't know which was added or
// removed. Once we keep the previous selection, we can read the diff.
if (start && end && start != end) {
- value = cvox.ChromeVox.msgs.getMsg(
+ value = Msgs.getMsg(
'selected_options_value', [start.text, end.text]);
} else if (start) {
value = start.text + '';
@@ -1313,7 +1313,7 @@ cvox.DomUtil.getRoleMsg = function(targetNode, verbosity) {
cvox.DomUtil.getRole = function(targetNode, verbosity) {
var roleMsg = cvox.DomUtil.getRoleMsg(targetNode, verbosity) || '';
var role = roleMsg && roleMsg != ' ' ?
- cvox.ChromeVox.msgs.getMsg(roleMsg) : '';
+ Msgs.getMsg(roleMsg) : '';
return role ? role : roleMsg;
};
@@ -1381,17 +1381,17 @@ cvox.DomUtil.getStateMsgs = function(targetNode, primary) {
} else if (targetNode.tagName == 'SELECT') {
if (targetNode.selectedOptions && targetNode.selectedOptions.length <= 1) {
info.push(['list_position',
- cvox.ChromeVox.msgs.getNumber(targetNode.selectedIndex + 1),
- cvox.ChromeVox.msgs.getNumber(targetNode.options.length)]);
+ Msgs.getNumber(targetNode.selectedIndex + 1),
+ Msgs.getNumber(targetNode.options.length)]);
} else {
info.push(['selected_options_state',
- cvox.ChromeVox.msgs.getNumber(targetNode.selectedOptions.length)]);
+ Msgs.getNumber(targetNode.selectedOptions.length)]);
}
} else if (targetNode.tagName == 'UL' ||
targetNode.tagName == 'OL' ||
role == 'list') {
info.push(['list_with_items_not_pluralized',
- cvox.ChromeVox.msgs.getNumber(
+ Msgs.getNumber(
cvox.DomUtil.getListLength(targetNode))]);
}
@@ -1937,7 +1937,7 @@ cvox.DomUtil.getLinkURL = function(node) {
if (node.tagName == 'A') {
if (node.getAttribute('href')) {
if (cvox.DomUtil.isInternalLink(node)) {
- return cvox.ChromeVox.msgs.getMsg('internal_link');
+ return Msgs.getMsg('internal_link');
} else {
return node.getAttribute('href');
}
@@ -1945,8 +1945,8 @@ cvox.DomUtil.getLinkURL = function(node) {
return '';
}
} else if (cvox.AriaUtil.getRoleName(node) ==
- cvox.ChromeVox.msgs.getMsg('aria_role_link')) {
- return cvox.ChromeVox.msgs.getMsg('unknown_link');
+ Msgs.getMsg('role_link')) {
+ return Msgs.getMsg('unknown_link');
}
return '';

Powered by Google App Engine
This is Rietveld 408576698