| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights |
| 3 * reserved. | 3 * reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 } | 679 } |
| 680 | 680 |
| 681 // Could not find a previous line. This means we must already be on the first | 681 // Could not find a previous line. This means we must already be on the first |
| 682 // line. Move to the start of the content in this block, which effectively | 682 // line. Move to the start of the content in this block, which effectively |
| 683 // moves us to the start of the line we're on. | 683 // moves us to the start of the line we're on. |
| 684 Element* root_element = HasEditableStyle(*node, editable_type) | 684 Element* root_element = HasEditableStyle(*node, editable_type) |
| 685 ? RootEditableElement(*node, editable_type) | 685 ? RootEditableElement(*node, editable_type) |
| 686 : node->GetDocument().documentElement(); | 686 : node->GetDocument().documentElement(); |
| 687 if (!root_element) | 687 if (!root_element) |
| 688 return VisiblePosition(); | 688 return VisiblePosition(); |
| 689 return VisiblePosition::FirstPositionInNode(root_element); | 689 return VisiblePosition::FirstPositionInNode(*root_element); |
| 690 } | 690 } |
| 691 | 691 |
| 692 VisiblePosition NextLinePosition(const VisiblePosition& visible_position, | 692 VisiblePosition NextLinePosition(const VisiblePosition& visible_position, |
| 693 LayoutUnit line_direction_point, | 693 LayoutUnit line_direction_point, |
| 694 EditableType editable_type) { | 694 EditableType editable_type) { |
| 695 DCHECK(visible_position.IsValid()) << visible_position; | 695 DCHECK(visible_position.IsValid()) << visible_position; |
| 696 | 696 |
| 697 Position p = visible_position.DeepEquivalent(); | 697 Position p = visible_position.DeepEquivalent(); |
| 698 Node* node = p.AnchorNode(); | 698 Node* node = p.AnchorNode(); |
| 699 | 699 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 // to the end of the line we're on. | 747 // to the end of the line we're on. |
| 748 Element* root_element = HasEditableStyle(*node, editable_type) | 748 Element* root_element = HasEditableStyle(*node, editable_type) |
| 749 ? RootEditableElement(*node, editable_type) | 749 ? RootEditableElement(*node, editable_type) |
| 750 : node->GetDocument().documentElement(); | 750 : node->GetDocument().documentElement(); |
| 751 if (!root_element) | 751 if (!root_element) |
| 752 return VisiblePosition(); | 752 return VisiblePosition(); |
| 753 return VisiblePosition::LastPositionInNode(root_element); | 753 return VisiblePosition::LastPositionInNode(root_element); |
| 754 } | 754 } |
| 755 | 755 |
| 756 } // namespace blink | 756 } // namespace blink |
| OLD | NEW |