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

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

Issue 2007183002: Make ChromeVox cursor robust to deleted nodes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/background.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
index f43000423454edc5b8f58db6d14475c716952c65..93cf4cc3954903e980b4a28b59a036836711da53 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
@@ -744,22 +744,24 @@ Background.prototype = {
}
if (pred) {
- var node = AutomationUtil.findNextNode(
- current.getBound(dir).node, dir, pred, {skipInitialAncestry: true});
-
- if (node) {
- node = AutomationUtil.findNodePre(
- node, dir, AutomationPredicate.element) || node;
- }
+ var bound = current.getBound(dir).node;
+ if (bound) {
+ var node = AutomationUtil.findNextNode(
+ bound, dir, pred, {skipInitialAncestry: true});
+ if (node) {
+ node = AutomationUtil.findNodePre(
+ node, dir, AutomationPredicate.element) || node;
+ }
- if (node) {
- current = cursors.Range.fromNode(node);
- } else {
- if (predErrorMsg) {
- cvox.ChromeVox.tts.speak(Msgs.getMsg(predErrorMsg),
- cvox.QueueMode.FLUSH);
+ if (node) {
+ current = cursors.Range.fromNode(node);
+ } else {
+ if (predErrorMsg) {
+ cvox.ChromeVox.tts.speak(Msgs.getMsg(predErrorMsg),
+ cvox.QueueMode.FLUSH);
+ }
+ return false;
}
- return false;
}
}

Powered by Google App Engine
This is Rietveld 408576698