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

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js

Issue 2507063007: Use aria range values for sliders (Closed)
Patch Set: Rebase Created 3 years, 11 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/cvox2/background/output.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
index 1d12d9d05e93e447ea9745c8c5449f9a51b542ef..63f4ae557c62bed6977be5276fbc2c49921dfccb 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
@@ -254,6 +254,10 @@ Output.ROLE_INFO_ = {
menuListPopup: {
msgId: 'role_menu'
},
+ meter: {
+ msgId: 'role_meter',
+ inherits: 'abstractRange'
+ },
navigation: {
msgId: 'role_navigation',
inherits: 'abstractContainer'
@@ -262,6 +266,10 @@ Output.ROLE_INFO_ = {
msgId: 'role_note',
inherits: 'abstractContainer'
},
+ progressIndicator: {
+ msgId: 'role_progress_indicator',
+ inherits: 'abstractRange'
+ },
popUpButton: {
msgId: 'role_button',
earconId: 'POP_UP_BUTTON'
@@ -285,6 +293,7 @@ Output.ROLE_INFO_ = {
},
scrollBar: {
msgId: 'role_scrollbar',
+ inherits: 'abstractRange'
},
search: {
msgId: 'role_search',
@@ -294,8 +303,14 @@ Output.ROLE_INFO_ = {
msgId: 'role_separator',
inherits: 'abstractContainer'
},
+ slider: {
+ msgId: 'role_slider',
+ inherits: 'abstractRange',
+ earconId: 'SLIDER'
+ },
spinButton: {
msgId: 'role_spinbutton',
+ inherits: 'abstractRange',
earconId: 'LISTBOX'
},
status: {
@@ -396,6 +411,13 @@ Output.RULES = {
enter: '$nameFromNode $role $state $description',
leave: '@exited_container($role)'
},
+ abstractRange: {
+ speak:
+ '$if($valueForRange, $valueForRange, $value) ' +
+ '$if($minValueForRange, @aria_value_min($minValueForRange)) ' +
+ '$if($maxValueForRange, @aria_value_max($maxValueForRange)) ' +
+ '$name $role $description $state'
+ },
alert: {
enter: '$name $role $state',
speak: '$earcon(ALERT_NONMODAL) $role $nameOrTextContent $state'
@@ -527,10 +549,6 @@ Output.RULES = {
rowHeader: {
speak: '$nameOrTextContent $state'
},
- slider: {
- speak: '$earcon(SLIDER) @describe_slider($value, $name) $description ' +
- '$state'
- },
staticText: {
speak: '$name='
},
@@ -1078,7 +1096,13 @@ Output.prototype = {
var earcon = node ? this.findEarcon_(node, opt_prevNode) : null;
if (earcon)
options.annotation.push(earcon);
- this.append_(buff, node.name, options);
+ this.append_(buff, node.name || '', options);
+ } else if (token == 'description') {
+ if (node.name == node.description)
+ return;
+
+ options.annotation.push(token);
+ this.append_(buff, node.description || '', options);
} else if (token == 'urlFilename') {
options.annotation.push('name');
var url = node.url;
@@ -1273,7 +1297,7 @@ Output.prototype = {
if (token == 'if') {
var cond = tree.firstChild;
var attrib = cond.value.slice(1);
- if (node[attrib] || node.state[attrib])
+ if (node[attrib] !== undefined || node.state[attrib])
this.format_(node, cond.nextSibling, buff);
else
this.format_(node, cond.nextSibling.nextSibling, buff);

Powered by Google App Engine
This is Rietveld 408576698