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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 newStart = newStart.move(unit, Movement.BOUND, Dir.BACKWARD); | 426 newStart = newStart.move(unit, Movement.BOUND, Dir.BACKWARD); |
427 newEnd = newStart.move(unit, Movement.BOUND, Dir.FORWARD); | 427 newEnd = newStart.move(unit, Movement.BOUND, Dir.FORWARD); |
428 break; | 428 break; |
429 case Unit.NODE: | 429 case Unit.NODE: |
430 case Unit.DOM_NODE: | 430 case Unit.DOM_NODE: |
431 newStart = newStart.move(unit, Movement.DIRECTIONAL, dir); | 431 newStart = newStart.move(unit, Movement.DIRECTIONAL, dir); |
432 newEnd = newStart; | 432 newEnd = newStart; |
433 break; | 433 break; |
434 } | 434 } |
435 return new cursors.Range(newStart, newEnd); | 435 return new cursors.Range(newStart, newEnd); |
| 436 }, |
| 437 |
| 438 /** |
| 439 * Returns true if this range has either cursor end on web content. |
| 440 * @return {boolean} |
| 441 */ |
| 442 isWebRange: function() { |
| 443 return this.start.node.root.role != Role.desktop || |
| 444 this.end.node.root.role != Role.desktop; |
436 } | 445 } |
437 }; | 446 }; |
438 | 447 |
439 }); // goog.scope | 448 }); // goog.scope |
OLD | NEW |