| Index: third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
|
| index 12e74730e6ca4d3359d32f7cbd970b1aede12e1f..a2982225f5a44cdfe7bfe5dddffd14aa687f5f2c 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
|
| @@ -365,17 +365,12 @@ void ApplyStyleCommand::applyRelativeFontStyleChange(EditingStyle* style, Editin
|
| end = endPosition();
|
| }
|
|
|
| + DCHECK(start.anchorNode());
|
| + DCHECK(end.anchorNode());
|
| // Calculate loop end point.
|
| // If the end node is before the start node (can only happen if the end node is
|
| // an ancestor of the start node), we gather nodes up to the next sibling of the end node
|
| - Node* beyondEnd;
|
| - DCHECK(start.anchorNode());
|
| - DCHECK(end.anchorNode());
|
| - if (start.anchorNode()->isDescendantOf(end.anchorNode()))
|
| - beyondEnd = NodeTraversal::nextSkippingChildren(*end.anchorNode());
|
| - else
|
| - beyondEnd = NodeTraversal::next(*end.anchorNode());
|
| -
|
| + const Node* const beyondEnd = end.nodeAsRangePastLastNode();
|
| start = mostBackwardCaretPosition(start); // Move upstream to ensure we do not add redundant spans.
|
| Node* startNode = start.anchorNode();
|
| DCHECK(startNode);
|
|
|