| Index: third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
|
| index 508435f23434981504fc276acd3a0e2da0d978b6..7d076998f7c48dce565b47c5d1c17459d2607a61 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
|
| @@ -1076,8 +1076,11 @@ void CompositeEditCommand::cloneParagraphUnderNewElement(const Position& start,
|
| HeapVector<Member<Node>> ancestors;
|
|
|
| // Insert each node from innerNode to outerNode (excluded) in a list.
|
| - for (Node* n = start.anchorNode(); n && n != outerNode; n = n->parentNode())
|
| - ancestors.append(n);
|
| + for (Node& runner : NodeTraversal::inclusiveAncestorsOf(*start.anchorNode())) {
|
| + if (runner == outerNode)
|
| + break;
|
| + ancestors.append(runner);
|
| + }
|
|
|
| // Clone every node between start.anchorNode() and outerBlock.
|
|
|
|
|