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

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: 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 8181ad00425a4838c9402d74b2764ff873de1b9a..a4f90e6548384787fe8128e0d26cc8b287aaeb0e 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
@@ -1238,6 +1238,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);
@@ -1370,6 +1373,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