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

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: Rebase Created 4 years, 6 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/background_test.extjs » ('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/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 229bb3862a1daf65f111da43cd8b04f96204c2ca..d1a67c5ec6c14e7fa21c44374866790dd0f0c154 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
@@ -769,22 +769,25 @@ Background.prototype = {
}
if (pred) {
- var node = AutomationUtil.findNextNode(
- current.getBound(dir).node, dir, pred, {skipInitialAncestry: true});
-
- if (node) {
- node = AutomationUtil.findNodePre(
- node, dir, AutomationPredicate.object) || 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.object) || 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;
}
}
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698