| Index: Source/core/editing/ApplyStyleCommand.cpp
|
| diff --git a/Source/core/editing/ApplyStyleCommand.cpp b/Source/core/editing/ApplyStyleCommand.cpp
|
| index d809696167311c30dd9454cb1e7c5325a58bf18d..966eea4a23de22c26d4cc6a017be3c59dd033627 100644
|
| --- a/Source/core/editing/ApplyStyleCommand.cpp
|
| +++ b/Source/core/editing/ApplyStyleCommand.cpp
|
| @@ -253,9 +253,9 @@ void ApplyStyleCommand::applyBlockStyle(EditingStyle *style)
|
| // Save and restore the selection endpoints using their indices in the document, since
|
| // addBlockStyleIfNeeded may moveParagraphs, which can remove these endpoints.
|
| // Calculate start and end indices from the start of the tree that they're in.
|
| - Node* scope = visibleStart.deepEquivalent().deprecatedNode()->highestAncestor();
|
| - RefPtr<Range> startRange = Range::create(document(), firstPositionInNode(scope), visibleStart.deepEquivalent().parentAnchoredEquivalent());
|
| - RefPtr<Range> endRange = Range::create(document(), firstPositionInNode(scope), visibleEnd.deepEquivalent().parentAnchoredEquivalent());
|
| + Node& scope = visibleStart.deepEquivalent().deprecatedNode()->highestAncestor();
|
| + RefPtr<Range> startRange = Range::create(document(), firstPositionInNode(&scope), visibleStart.deepEquivalent().parentAnchoredEquivalent());
|
| + RefPtr<Range> endRange = Range::create(document(), firstPositionInNode(&scope), visibleEnd.deepEquivalent().parentAnchoredEquivalent());
|
| int startIndex = TextIterator::rangeLength(startRange.get(), true);
|
| int endIndex = TextIterator::rangeLength(endRange.get(), true);
|
|
|
| @@ -286,8 +286,8 @@ void ApplyStyleCommand::applyBlockStyle(EditingStyle *style)
|
| nextParagraphStart = endOfParagraph(paragraphStart).next();
|
| }
|
|
|
| - startRange = PlainTextRange(startIndex).createRangeForSelection(*toContainerNode(scope));
|
| - endRange = PlainTextRange(endIndex).createRangeForSelection(*toContainerNode(scope));
|
| + startRange = PlainTextRange(startIndex).createRangeForSelection(toContainerNode(scope));
|
| + endRange = PlainTextRange(endIndex).createRangeForSelection(toContainerNode(scope));
|
| if (startRange && endRange)
|
| updateStartEnd(startRange->startPosition(), endRange->startPosition());
|
| }
|
|
|