| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Classes related to cursors that point to and select parts of | 6 * @fileoverview Classes related to cursors that point to and select parts of |
| 7 * the automation tree. | 7 * the automation tree. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 goog.provide('cursors.Cursor'); | 10 goog.provide('cursors.Cursor'); |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 focusOffset: this.end.selectionIndex_ } | 527 focusOffset: this.end.selectionIndex_ } |
| 528 ); | 528 ); |
| 529 } | 529 } |
| 530 }, | 530 }, |
| 531 | 531 |
| 532 /** | 532 /** |
| 533 * Returns true if this range has either cursor end on web content. | 533 * Returns true if this range has either cursor end on web content. |
| 534 * @return {boolean} | 534 * @return {boolean} |
| 535 */ | 535 */ |
| 536 isWebRange: function() { | 536 isWebRange: function() { |
| 537 return this.start.node.root.role != RoleType.desktop || | 537 return this.isValid() && |
| 538 this.end.node.root.role != RoleType.desktop; | 538 (this.start.node.root.role != RoleType.desktop || |
| 539 this.end.node.root.role != RoleType.desktop); |
| 539 }, | 540 }, |
| 540 | 541 |
| 541 /** | 542 /** |
| 542 * Returns whether this range has valid start and end cursors. | 543 * Returns whether this range has valid start and end cursors. |
| 543 * @return {boolean} | 544 * @return {boolean} |
| 544 */ | 545 */ |
| 545 isValid: function() { | 546 isValid: function() { |
| 546 return this.start.isValid() && this.end.isValid(); | 547 return this.start.isValid() && this.end.isValid(); |
| 547 } | 548 } |
| 548 }; | 549 }; |
| 549 | 550 |
| 550 }); // goog.scope | 551 }); // goog.scope |
| OLD | NEW |