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

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/output.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 | « chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js ('k') | no next file » | 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 6ccd3b36fa89b9c0b5fc57dc0c6287f71ab3ba10..ed676e49536b0a4ac1d5f4e9ace6d6661d30f78d 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
@@ -1254,6 +1254,9 @@ Output.prototype = {
* @private
*/
range_: function(range, prevRange, type, rangeBuff) {
+ if (!range.start.node || !range.end.node)
+ return;
+
if (!prevRange)
prevRange = cursors.Range.fromNode(range.start.node.root);
var cursor = cursors.Cursor.fromNode(range.start.node);
@@ -1386,6 +1389,9 @@ Output.prototype = {
var dir = cursors.Range.getDirection(prevRange, range);
var node = range.start.node;
var prevNode = prevRange.getBound(dir).node;
+ if (!node || !prevNode)
+ return;
+
var options = {annotation: ['name'], isUnique: true};
var startIndex = range.start.index;
var endIndex = range.end.index;
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698