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

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

Issue 1970153003: Completely detach removed nodes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test. 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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js » ('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/cursors.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js
index 84a6898bc5484cb177136aa76a061a54627753ab..35ebe6d51e6f4d4b780e740c7467e6789561f31a 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js
@@ -284,6 +284,14 @@ cursors.Cursor.prototype = {
newNode = newNode || this.node_;
newIndex = goog.isDef(newIndex) ? newIndex : this.index_;
return new cursors.Cursor(newNode, newIndex);
+ },
+
+ /**
+ * Returns whether this cursor points to a valid position.
+ * @return {boolean}
+ */
+ isValid: function() {
+ return this.node.role !== undefined;
}
};
@@ -528,6 +536,14 @@ cursors.Range.prototype = {
isWebRange: function() {
return this.start.node.root.role != RoleType.desktop ||
this.end.node.root.role != RoleType.desktop;
+ },
+
+ /**
+ * Returns whether this range has valid start and end cursors.
+ * @return {boolean}
+ */
+ isValid: function() {
+ return this.start.isValid() && this.end.isValid();
}
};
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698