| 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 template <typename Traversal> | 39 template <typename Traversal> |
| 40 bool EditingAlgorithm<Traversal>::editingIgnoresContent(const Node* node) | 40 bool EditingAlgorithm<Traversal>::editingIgnoresContent(const Node* node) |
| 41 { | 41 { |
| 42 return !node->canContainRangeEndPoint() || isEmptyNonEditableNodeInEditable(
node); | 42 return !node->canContainRangeEndPoint() || isEmptyNonEditableNodeInEditable(
node); |
| 43 } | 43 } |
| 44 | 44 |
| 45 template <typename Traversal> | 45 template <typename Traversal> |
| 46 int EditingAlgorithm<Traversal>::lastOffsetForEditing(const Node* node) | 46 int EditingAlgorithm<Traversal>::lastOffsetForEditing(const Node* node) |
| 47 { | 47 { |
| 48 ASSERT(node); | 48 DCHECK(node); |
| 49 if (!node) | 49 if (!node) |
| 50 return 0; | 50 return 0; |
| 51 if (node->offsetInCharacters()) | 51 if (node->offsetInCharacters()) |
| 52 return node->maxCharacterOffset(); | 52 return node->maxCharacterOffset(); |
| 53 | 53 |
| 54 if (Traversal::hasChildren(*node)) | 54 if (Traversal::hasChildren(*node)) |
| 55 return Traversal::countChildren(*node); | 55 return Traversal::countChildren(*node); |
| 56 | 56 |
| 57 // FIXME: Try return 0 here. | 57 // FIXME: Try return 0 here. |
| 58 | 58 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 86 candidateRoot = parent; | 86 candidateRoot = parent; |
| 87 parent = Strategy::parent(*candidateRoot); | 87 parent = Strategy::parent(*candidateRoot); |
| 88 } | 88 } |
| 89 return candidateRoot; | 89 return candidateRoot; |
| 90 } | 90 } |
| 91 | 91 |
| 92 template class CORE_TEMPLATE_EXPORT EditingAlgorithm<NodeTraversal>; | 92 template class CORE_TEMPLATE_EXPORT EditingAlgorithm<NodeTraversal>; |
| 93 template class CORE_TEMPLATE_EXPORT EditingAlgorithm<FlatTreeTraversal>; | 93 template class CORE_TEMPLATE_EXPORT EditingAlgorithm<FlatTreeTraversal>; |
| 94 | 94 |
| 95 } // namespace blink | 95 } // namespace blink |
| OLD | NEW |