Chromium Code Reviews| Index: Source/core/editing/CompositeEditCommand.cpp |
| diff --git a/Source/core/editing/CompositeEditCommand.cpp b/Source/core/editing/CompositeEditCommand.cpp |
| index b208a812a939821643de0d856ac23f6fe6332393..cb15b9cf0eaac31c5f1c190197011428a63b9a03 100644 |
| --- a/Source/core/editing/CompositeEditCommand.cpp |
| +++ b/Source/core/editing/CompositeEditCommand.cpp |
| @@ -1453,14 +1453,14 @@ PassRefPtr<Node> CompositeEditCommand::splitTreeToNode(Node* start, Node* end, b |
| ASSERT(end); |
| ASSERT(start != end); |
| - RefPtr<Node> node; |
| if (shouldSplitAncestor && end->parentNode()) |
| end = end->parentNode(); |
| + if (!start->isDescendantOf(end)) |
| + return end; |
| RefPtr<Node> endNode = end; |
| - for (node = start; node && node->parentNode() != endNode; node = node->parentNode()) { |
| - if (!node->parentNode()->isElementNode()) |
| - break; |
|
Yuta Kitamura
2014/05/27 07:41:27
I think the removal of these lines would make Blin
yosin_UTC9
2014/05/27 09:30:06
Only nodes can have Document as parent are BODY an
Yuta Kitamura
2014/05/28 07:44:17
Well, actually |node| could be <HTML>. Or it could
|
| + RefPtr<Node> node; |
| + for (node = start; node->parentNode() != endNode; node = node->parentNode()) { |
| // Do not split a node when doing so introduces an empty node. |
| VisiblePosition positionInParent(firstPositionInNode(node->parentNode())); |
| VisiblePosition positionInNode(firstPositionInOrBeforeNode(node.get())); |