Commit f75683c7 authored by Akihiro Ota's avatar Akihiro Ota Committed by Commit Bot

ChromeVox: Clean up ChromeVox keymap and remove paragraph navigation.

This change moves away from the [Search + n/p + l] key combination
for list navigation, as I got some feedback from testers
that the combinations were awkward to invoke. Instead, list navigation
now uses [Search + j + l] for next list and [Search + Shift + j + l]
for previous list. This is more consistent with how existing jump
commands are structured.

This change also removes commands to navigate by paragraph, as
movement by paragraph is already covered by group navigation.

Lastly, this change renames next_keymap.json to default_keymap.json.

Change-Id: If42c94d44f319ef08318575982d8a297d4aa9da6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1925207Reviewed-by: default avatarDavid Tseng <dtseng@chromium.org>
Commit-Queue: Akihiro Ota <akihiroota@chromium.org>
Cr-Commit-Position: refs/heads/master@{#727171}
parent a3ed0a9a
...@@ -181,7 +181,7 @@ run_jsbundler("chromevox_copied_files") { ...@@ -181,7 +181,7 @@ run_jsbundler("chromevox_copied_files") {
"background/earcons/skim.wav", "background/earcons/skim.wav",
"background/earcons/small_room_2.wav", "background/earcons/small_room_2.wav",
"background/earcons/static.wav", "background/earcons/static.wav",
"background/keymaps/next_keymap.json", "background/keymaps/default_keymap.json",
"background/learn_mode/kbexplorer.html", "background/learn_mode/kbexplorer.html",
"background/logging/log.css", "background/logging/log.css",
"background/logging/log.html", "background/logging/log.html",
......
...@@ -108,8 +108,6 @@ AutomationPredicate.table = AutomationPredicate.roles([Role.GRID, Role.TABLE]); ...@@ -108,8 +108,6 @@ AutomationPredicate.table = AutomationPredicate.roles([Role.GRID, Role.TABLE]);
/** @type {AutomationPredicate.Unary} */ /** @type {AutomationPredicate.Unary} */
AutomationPredicate.listLike = AutomationPredicate.listLike =
AutomationPredicate.roles([Role.LIST, Role.DESCRIPTION_LIST]); AutomationPredicate.roles([Role.LIST, Role.DESCRIPTION_LIST]);
/** @type {AutomationPredicate.Unary} */
AutomationPredicate.paragraph = AutomationPredicate.roles([Role.PARAGRAPH]);
/** /**
* @param {!AutomationNode} node * @param {!AutomationNode} node
......
...@@ -2314,57 +2314,6 @@ TEST_F('ChromeVoxBackgroundTest', 'NoRepeatTitle', function() { ...@@ -2314,57 +2314,6 @@ TEST_F('ChromeVoxBackgroundTest', 'NoRepeatTitle', function() {
}); });
}); });
TEST_F('ChromeVoxBackgroundTest', 'NavigationByParagraphTest', function() {
var mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(
`
<button>Start at top</button>
<p>Visit text inside paragraph tags.</p>
Skip text not enclosed by paragraph tags.
<p>A multiline paragraph<br>with boring text<br></p>
<a href="#">We should skip links</a>
<p>Visit me too.<p>
<div>Skip elements not explicitly labeled as paragraphs.</div>
`,
function(root) {
mockFeedback.call(doCmd('jumpToTop'))
.call(doCmd('nextParagraph'))
.expectSpeech('Visit text inside paragraph tags.')
.call(doCmd('nextParagraph'))
.expectSpeech('A multiline paragraph')
.call(doCmd('nextParagraph'))
.expectSpeech('Visit me too.')
.call(doCmd('nextParagraph'))
.expectSpeech('Visit text inside paragraph tags.')
.call(doCmd('previousParagraph'))
.expectSpeech('Visit me too.')
.call(doCmd('previousParagraph'))
.expectSpeech('A multiline paragraph')
.call(doCmd('nextObject'))
.expectSpeech('with boring text')
// Ensure we go to the previous paragraph, not the top of the
// current one.
.call(doCmd('previousParagraph'))
.expectSpeech('Visit text inside paragraph tags.')
.replay();
});
});
TEST_F('ChromeVoxBackgroundTest', 'NoParagraphTest', function() {
var mockFeedback = this.createMockFeedback();
this.runWithLoadedTree(
`
<button>Click me</button>
`,
function(root) {
mockFeedback.call(doCmd('nextParagraph'))
.expectSpeech('No next paragraph.')
.call(doCmd('previousParagraph'))
.expectSpeech('No previous paragraph.');
mockFeedback.replay();
});
});
TEST_F('ChromeVoxBackgroundTest', 'PhoneticsAndCommands', function() { TEST_F('ChromeVoxBackgroundTest', 'PhoneticsAndCommands', function() {
var mockFeedback = this.createMockFeedback(); var mockFeedback = this.createMockFeedback();
this.runWithLoadedTree( this.runWithLoadedTree(
......
...@@ -522,15 +522,6 @@ CommandHandler.onCommand = function(command) { ...@@ -522,15 +522,6 @@ CommandHandler.onCommand = function(command) {
predErrorMsg = 'no_previous_list'; predErrorMsg = 'no_previous_list';
skipInitialAncestry = false; skipInitialAncestry = false;
break; break;
case 'nextParagraph':
pred = AutomationPredicate.paragraph;
predErrorMsg = 'no_next_paragraph';
break;
case 'previousParagraph':
dir = Dir.BACKWARD;
pred = AutomationPredicate.paragraph;
predErrorMsg = 'no_previous_paragraph';
break;
case 'jumpToTop': case 'jumpToTop':
var node = AutomationUtil.findNodePost( var node = AutomationUtil.findNodePost(
current.start.node.root, Dir.FORWARD, AutomationPredicate.object); current.start.node.root, Dir.FORWARD, AutomationPredicate.object);
......
...@@ -1044,7 +1044,7 @@ ...@@ -1044,7 +1044,7 @@
"sequence": { "sequence": {
"cvoxModifier": true, "cvoxModifier": true,
"keys": { "keys": {
"keyCode": [78, 76] "keyCode": [74, 76]
} }
} }
}, },
...@@ -1053,25 +1053,8 @@ ...@@ -1053,25 +1053,8 @@
"sequence": { "sequence": {
"cvoxModifier": true, "cvoxModifier": true,
"keys": { "keys": {
"keyCode": [80, 76] "keyCode": [74, 76],
} "shiftKey": [true]
}
},
{
"command": "nextParagraph",
"sequence": {
"cvoxModifier": true,
"keys": {
"keyCode": [78, 80]
}
}
},
{
"command": "previousParagraph",
"sequence": {
"cvoxModifier": true,
"keys": {
"keyCode": [80, 80]
} }
} }
}, },
......
...@@ -67,7 +67,7 @@ KeyMap.KEYMAP_PATH = 'background/keymaps/'; ...@@ -67,7 +67,7 @@ KeyMap.KEYMAP_PATH = 'background/keymaps/';
* @const * @const
*/ */
KeyMap.AVAILABLE_MAP_INFO = { KeyMap.AVAILABLE_MAP_INFO = {
'keymap_next': {'file': 'next_keymap.json'} 'keymap_next': {'file': 'default_keymap.json'}
}; };
......
...@@ -3787,12 +3787,6 @@ If you're done with the tutorial, use ChromeVox to navigate to the Close button ...@@ -3787,12 +3787,6 @@ If you're done with the tutorial, use ChromeVox to navigate to the Close button
<message desc="This is an abbreviated HTML description list detail element shown on a braille display. When translating, try to find a contracted form of the translation for 'description list detail' according to local conventions. If reasonable, use all lowercase and avoid punctuation to keep the number of characters as low as possible." name="IDS_CHROMEVOX_ROLE_DESCRIPTION_LIST_DETAIL_BRL"> <message desc="This is an abbreviated HTML description list detail element shown on a braille display. When translating, try to find a contracted form of the translation for 'description list detail' according to local conventions. If reasonable, use all lowercase and avoid punctuation to keep the number of characters as low as possible." name="IDS_CHROMEVOX_ROLE_DESCRIPTION_LIST_DETAIL_BRL">
dscrplst dtl dscrplst dtl
</message> </message>
<message desc="Spoken if the user attempts to jump to the next paragraph when none exists." name="IDS_CHROMEVOX_NO_NEXT_PARAGRAPH">
No next paragraph.
</message>
<message desc="Spoken if the user attempts to jump to the previous paragraph when none exists." name="IDS_CHROMEVOX_NO_PREVIOUS_PARAGRAPH">
No previous paragraph.
</message>
<message desc="Spoken when the user resets text to speech settings back to their default values" name="IDS_CHROMEVOX_ANNOUNCE_TTS_DEFAULT_SETTINGS"> <message desc="Spoken when the user resets text to speech settings back to their default values" name="IDS_CHROMEVOX_ANNOUNCE_TTS_DEFAULT_SETTINGS">
Reset text to speech settings to default values. Reset text to speech settings to default values.
</message> </message>
......
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