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

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

Issue 2366743004: Clean up Panel menu text labels. (Closed)
Patch Set: Rebase Created 4 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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/panel_menu.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7c8c3d8380ae1e15b9ee3d42dad85ae6d0541ff5..30d36566f3c36b19afde6c3caf81f9beeec3c98f 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
@@ -449,9 +449,11 @@ Output.RULES = {
},
heading: {
enter: '!relativePitch(hierarchicalLevel) ' +
- '$nameFromNode= @tag_h+$hierarchicalLevel',
- speak: '!relativePitch(hierarchicalLevel)' +
- ' $nameOrDescendants= @tag_h+$hierarchicalLevel $state'
+ '$nameFromNode= ' +
+ '$if($hierarchicalLevel, @tag_h+$hierarchicalLevel, $role) $state',
+ speak: '!relativePitch(hierarchicalLevel) ' +
+ '$nameOrDescendants= ' +
+ '$if($hierarchicalLevel, @tag_h+$hierarchicalLevel, $role) $state'
},
inlineTextBox: {
speak: '$name='
@@ -694,28 +696,6 @@ Output.forceModeForNextSpeechUtterance = function(mode) {
Output.prototype = {
/**
- * Gets the spoken output with separator '|'.
- * @return {!Spannable}
- */
- get speechOutputForTest() {
- return this.speechBuffer_.reduce(function(prev, cur) {
- if (prev === null)
- return cur;
- prev.append('|');
- prev.append(cur);
- return prev;
- }, null);
- },
-
- /**
- * Gets the output buffer for braille.
- * @return {!Spannable}
- */
- get brailleOutputForTest() {
- return this.createBrailleOutput_();
- },
-
- /**
* @return {boolean} True if there's any speech that will be output.
*/
get hasSpeech() {
@@ -1696,6 +1676,41 @@ Output.prototype = {
}
}
return null;
+ },
+
+ /**
+ * Gets a human friendly string with the contents of output.
+ * @return {string}
+ */
+ toString: function() {
+ return this.speechBuffer_.reduce(function(prev, cur) {
+ if (prev === null)
+ return cur.toString();
+ prev += ' ' + cur.toString();
+ return prev;
+ }, null);
+ },
+
+ /**
+ * Gets the spoken output with separator '|'.
+ * @return {!Spannable}
+ */
+ get speechOutputForTest() {
+ return this.speechBuffer_.reduce(function(prev, cur) {
+ if (prev === null)
+ return cur;
+ prev.append('|');
+ prev.append(cur);
+ return prev;
+ }, null);
+ },
+
+ /**
+ * Gets the output buffer for braille.
+ * @return {!Spannable}
+ */
+ get brailleOutputForTest() {
+ return this.createBrailleOutput_();
}
};
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/panel_menu.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698