Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js |
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js |
index bf88d841f8170caff2ff5ec3c0eabdf023877e89..14fd563dece0c5043cc09f689b5bf856af962b46 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js |
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js |
@@ -129,11 +129,21 @@ DesktopAutomationHandler.prototype = { |
* @param {!AutomationEvent} evt |
*/ |
onEventIfInRange: function(evt) { |
- // TODO(dtseng): Consider the end of the current range as well. |
- if (AutomationUtil.isDescendantOf( |
- ChromeVoxState.instance.currentRange.start.node, evt.target) || |
- evt.target.state.focused) |
- this.onEventDefault(evt); |
+ if (evt.target.root.role != RoleType.desktop && |
+ ChromeVoxState.instance.mode === ChromeVoxMode.CLASSIC) |
+ return; |
+ |
+ var prev = ChromeVoxState.instance.currentRange; |
+ if (AutomationUtil.isDescendantOf(prev.start.node, evt.target) || |
+ AutomationUtil.isDescendantOf(evt.target, prev.start.node) || |
+ evt.target.state.focused) { |
+ // Intentionally skip setting range. |
+ new Output() |
+ .withRichSpeechAndBraille(cursors.Range.fromNode(evt.target), |
+ prev, |
+ Output.EventType.NAVIGATE) |
+ .go(); |
+ } |
}, |
/** |