OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "core/editing/EditingStrategy.h" | 5 #include "core/editing/EditingStrategy.h" |
6 | 6 |
7 #include "core/editing/EditingUtilities.h" | 7 #include "core/editing/EditingUtilities.h" |
8 #include "core/layout/LayoutObject.h" | 8 #include "core/layout/LayoutObject.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 70 |
71 // editingIgnoresContent uses the same logic in | 71 // editingIgnoresContent uses the same logic in |
72 // isEmptyNonEditableNodeInEditable (EditingUtilities.cpp). We don't | 72 // isEmptyNonEditableNodeInEditable (EditingUtilities.cpp). We don't |
73 // understand why this function returns 1 even when the node doesn't have | 73 // understand why this function returns 1 even when the node doesn't have |
74 // children. | 74 // children. |
75 return 1; | 75 return 1; |
76 } | 76 } |
77 | 77 |
78 template <typename Strategy> | 78 template <typename Strategy> |
79 Node* EditingAlgorithm<Strategy>::RootUserSelectAllForNode(Node* node) { | 79 Node* EditingAlgorithm<Strategy>::RootUserSelectAllForNode(Node* node) { |
80 if (!node || UsedValueOfUserSelect(*node) != SELECT_ALL) | 80 if (!node || UsedValueOfUserSelect(*node) != EUserSelect::kAll) |
81 return nullptr; | 81 return nullptr; |
82 Node* parent = Strategy::Parent(*node); | 82 Node* parent = Strategy::Parent(*node); |
83 if (!parent) | 83 if (!parent) |
84 return node; | 84 return node; |
85 | 85 |
86 Node* candidate_root = node; | 86 Node* candidate_root = node; |
87 while (parent) { | 87 while (parent) { |
88 if (!parent->GetLayoutObject()) { | 88 if (!parent->GetLayoutObject()) { |
89 parent = Strategy::Parent(*parent); | 89 parent = Strategy::Parent(*parent); |
90 continue; | 90 continue; |
91 } | 91 } |
92 if (UsedValueOfUserSelect(*parent) != SELECT_ALL) | 92 if (UsedValueOfUserSelect(*parent) != EUserSelect::kAll) |
93 break; | 93 break; |
94 candidate_root = parent; | 94 candidate_root = parent; |
95 parent = Strategy::Parent(*candidate_root); | 95 parent = Strategy::Parent(*candidate_root); |
96 } | 96 } |
97 return candidate_root; | 97 return candidate_root; |
98 } | 98 } |
99 | 99 |
100 template class CORE_TEMPLATE_EXPORT EditingAlgorithm<NodeTraversal>; | 100 template class CORE_TEMPLATE_EXPORT EditingAlgorithm<NodeTraversal>; |
101 template class CORE_TEMPLATE_EXPORT EditingAlgorithm<FlatTreeTraversal>; | 101 template class CORE_TEMPLATE_EXPORT EditingAlgorithm<FlatTreeTraversal>; |
102 | 102 |
103 } // namespace blink | 103 } // namespace blink |
OLD | NEW |