| Index: third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.cpp b/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.cpp
|
| index 7dcce8f6114cb023d986163d4379988352b7a274..5c40b7b74eea57a569252b84fd6aa51cae17c37e 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/SimplifyMarkupCommand.cpp
|
| @@ -51,7 +51,7 @@ void SimplifyMarkupCommand::doApply(EditingState* editingState)
|
| if (node->hasChildren() || (node->isTextNode() && node->nextSibling()))
|
| continue;
|
|
|
| - ContainerNode* startingNode = node->parentNode();
|
| + ContainerNode* const startingNode = node->parentNode();
|
| if (!startingNode)
|
| continue;
|
| const ComputedStyle* startingStyle = startingNode->computedStyle();
|
| @@ -80,8 +80,11 @@ void SimplifyMarkupCommand::doApply(EditingState* editingState)
|
|
|
| }
|
| if (topNodeWithStartingStyle) {
|
| - for (ContainerNode* node = startingNode; node != topNodeWithStartingStyle; node = node->parentNode())
|
| - nodesToRemove.append(node);
|
| + for (Node& node : NodeTraversal::inclusiveAncestorsOf(*startingNode)) {
|
| + if (node == topNodeWithStartingStyle)
|
| + break;
|
| + nodesToRemove.append(static_cast<ContainerNode*>(&node));
|
| + }
|
| }
|
| }
|
|
|
|
|