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

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: Address feedback 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/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 d99be2ddd907ffa0f278cf051182c1b5d03dbbe5..290762b6a708473f631ec0d6cf876ff750965e77 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;

Powered by Google App Engine
This is Rietveld 408576698