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

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

Issue 2757623003: Initial support for accessible text fields and focus tracking in ARC++ (Closed)
Patch Set: Address nits. Created 3 years, 9 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/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 480b444c698145795f5bd4540066957649fa0563..b19fb53548fa3932d691b4df9002be96e59215cc 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js
@@ -142,7 +142,7 @@ cursors.Cursor.prototype = {
for (var i = 0; i < this.ancestry_.length; i++) {
var firstValidNode = this.ancestry_[i];
if (firstValidNode != null && firstValidNode.role !== undefined &&
- firstValidNode.root !== undefined) {
+ firstValidNode.root != undefined) {
return firstValidNode;
}
// If we have to walk up to an ancestor, reset the index to NODE_INDEX.
@@ -176,9 +176,9 @@ cursors.Cursor.prototype = {
// Selections over line break nodes are broken.
var parent = adjustedNode.parent;
var grandparent = parent && parent.parent;
- if (parent.role == RoleType.LINE_BREAK) {
+ if (parent && parent.role == RoleType.LINE_BREAK) {
adjustedNode = grandparent;
- } else if (grandparent.role == RoleType.LINE_BREAK) {
+ } else if (grandparent && grandparent.role == RoleType.LINE_BREAK) {
adjustedNode = grandparent.parent;
} else if (this.index_ == cursors.NODE_INDEX ||
adjustedNode.role == RoleType.INLINE_TEXT_BOX ||

Powered by Google App Engine
This is Rietveld 408576698