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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 Node* PreviousLeafWithSameEditability(Node* node, EditableType editable_type) { | 88 Node* PreviousLeafWithSameEditability(Node* node, EditableType editable_type) { |
89 const bool editable = HasEditableStyle(*node, editable_type); | 89 const bool editable = HasEditableStyle(*node, editable_type); |
90 for (Node* runner = PreviousAtomicLeafNode(*node); runner; | 90 for (Node* runner = PreviousAtomicLeafNode(*node); runner; |
91 runner = PreviousAtomicLeafNode(*runner)) { | 91 runner = PreviousAtomicLeafNode(*runner)) { |
92 if (editable == HasEditableStyle(*runner, editable_type)) | 92 if (editable == HasEditableStyle(*runner, editable_type)) |
93 return runner; | 93 return runner; |
94 } | 94 } |
95 return nullptr; | 95 return nullptr; |
96 } | 96 } |
97 | 97 |
98 Node* NextLeafWithSameEditability( | 98 Node* NextLeafWithSameEditability(Node* node, EditableType editable_type) { |
99 Node* node, | |
100 EditableType editable_type = kContentIsEditable) { | |
101 if (!node) | 99 if (!node) |
102 return nullptr; | 100 return nullptr; |
103 | 101 |
104 const bool editable = HasEditableStyle(*node, editable_type); | 102 const bool editable = HasEditableStyle(*node, editable_type); |
105 for (Node* runner = NextAtomicLeafNode(*node); runner; | 103 for (Node* runner = NextAtomicLeafNode(*node); runner; |
106 runner = NextAtomicLeafNode(*runner)) { | 104 runner = NextAtomicLeafNode(*runner)) { |
107 if (editable == HasEditableStyle(*runner, editable_type)) | 105 if (editable == HasEditableStyle(*runner, editable_type)) |
108 return runner; | 106 return runner; |
109 } | 107 } |
110 return nullptr; | 108 return nullptr; |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 // to the end of the line we're on. | 682 // to the end of the line we're on. |
685 Element* root_element = HasEditableStyle(*node, editable_type) | 683 Element* root_element = HasEditableStyle(*node, editable_type) |
686 ? RootEditableElement(*node, editable_type) | 684 ? RootEditableElement(*node, editable_type) |
687 : node->GetDocument().documentElement(); | 685 : node->GetDocument().documentElement(); |
688 if (!root_element) | 686 if (!root_element) |
689 return VisiblePosition(); | 687 return VisiblePosition(); |
690 return VisiblePosition::LastPositionInNode(root_element); | 688 return VisiblePosition::LastPositionInNode(root_element); |
691 } | 689 } |
692 | 690 |
693 } // namespace blink | 691 } // namespace blink |
OLD | NEW |