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 cfea734f972bd5a49bbe213a28b67bd6f675a03e..b0fe4567d6e62e07c50b03ce00997d0314bf4df5 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js |
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js |
@@ -320,15 +320,12 @@ Output.ROLE_INFO_ = { |
Output.STATE_INFO_ = { |
checked: { |
on: { |
- earconId: 'CHECK_ON', |
msgId: 'checkbox_checked_state' |
}, |
off: { |
- earconId: 'CHECK_OFF', |
msgId: 'checkbox_unchecked_state' |
}, |
omitted: { |
- earconId: 'CHECK_OFF', |
msgId: 'checkbox_unchecked_state' |
} |
}, |
@@ -379,7 +376,8 @@ Output.RULES = { |
enter: '@column_granularity $tableCellColumnIndex' |
}, |
checkBox: { |
- speak: '$name $role $checked' |
+ speak: '$if($checked, $earcon(CHECK_ON), $earcon(CHECK_OFF)) ' + |
+ '$name $role $checked' |
}, |
dialog: { |
enter: '$name $role' |
@@ -426,7 +424,7 @@ Output.RULES = { |
speak: '$descendants' |
}, |
popUpButton: { |
- speak: '$value $name $role @aria_has_popup ' + |
+ speak: '$EARCON(POP_UP_BUTTON) $value $name $role @aria_has_popup ' + |
'$if($collapsed, @aria_expanded_false, @aria_expanded_true)' |
}, |
radioButton: { |
@@ -443,7 +441,7 @@ Output.RULES = { |
enter: '@row_granularity $tableRowIndex' |
}, |
slider: { |
- speak: '@describe_slider($value, $name) $help' |
+ speak: '$earcon(SLIDER) @describe_slider($value, $name) $help' |
}, |
staticText: { |
speak: '$value $name' |
@@ -661,27 +659,25 @@ Output.prototype = { |
// Speech. |
var queueMode = cvox.QueueMode.FLUSH; |
this.speechBuffer_.forEach(function(buff, i, a) { |
- if (buff.toString()) { |
- (function() { |
- var scopedBuff = buff; |
- this.speechProperties_['startCallback'] = function() { |
- var actions = scopedBuff.getSpansInstanceOf(Output.Action); |
- if (actions) { |
- actions.forEach(function(a) { |
- a.run(); |
- }); |
- } |
- }; |
- }.bind(this)()); |
- |
- if (this.speechEndCallback_ && i == a.length - 1) |
- this.speechProperties_['endCallback'] = this.speechEndCallback_; |
- else |
- this.speechProperties_['endCallback'] = null; |
- cvox.ChromeVox.tts.speak( |
- buff.toString(), queueMode, this.speechProperties_); |
- queueMode = cvox.QueueMode.QUEUE; |
- } |
+ (function() { |
+ var scopedBuff = buff; |
+ this.speechProperties_['startCallback'] = function() { |
+ var actions = scopedBuff.getSpansInstanceOf(Output.Action); |
+ if (actions) { |
+ actions.forEach(function(a) { |
+ a.run(); |
+ }); |
+ } |
+ }; |
+ }.bind(this)()); |
+ |
+ if (this.speechEndCallback_ && i == a.length - 1) |
+ this.speechProperties_['endCallback'] = this.speechEndCallback_; |
+ else |
+ this.speechProperties_['endCallback'] = null; |
+ cvox.ChromeVox.tts.speak( |
+ buff.toString(), queueMode, this.speechProperties_); |
+ queueMode = cvox.QueueMode.QUEUE; |
}.bind(this)); |
// Braille. |
@@ -928,13 +924,10 @@ Output.prototype = { |
// Ignore unless we're generating speech output. |
if (!this.formatOptions_.speech) |
return; |
- // Assumes there's existing output in our buffer. |
- var lastBuff = buff[buff.length - 1]; |
- if (!lastBuff) |
- return; |
- lastBuff.setSpan( |
+ options.annotation.push( |
new Output.EarconAction(tree.firstChild.value), 0, 0); |
+ this.append_(buff, '', options); |
} else if (token == 'countChildren') { |
var role = tree.firstChild.value; |
var count = node.children.filter(function(e) { |