Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(721)

Unified Diff: Source/core/editing/ApplyStyleCommand.cpp

Issue 182383012: Have positionInParentBeforeNode() / positionInParentAfterNode() take a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/PositionIterator.cpp ('k') | Source/core/editing/CompositeEditCommand.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/ApplyStyleCommand.cpp
diff --git a/Source/core/editing/ApplyStyleCommand.cpp b/Source/core/editing/ApplyStyleCommand.cpp
index f7dd21db1684af7e159669ba6a0879068b8d0450..99b65f53100d8f13c69d012b32243b6f83002b87 100644
--- a/Source/core/editing/ApplyStyleCommand.cpp
+++ b/Source/core/editing/ApplyStyleCommand.cpp
@@ -612,11 +612,11 @@ void ApplyStyleCommand::applyInlineStyle(EditingStyle* style)
// Avoid removing the dir attribute and the unicode-bidi and direction properties from the unsplit ancestors.
Position embeddingRemoveStart = removeStart;
if (startUnsplitAncestor && nodeFullySelected(startUnsplitAncestor, removeStart, end))
- embeddingRemoveStart = positionInParentAfterNode(startUnsplitAncestor);
+ embeddingRemoveStart = positionInParentAfterNode(*startUnsplitAncestor);
Position embeddingRemoveEnd = end;
if (endUnsplitAncestor && nodeFullySelected(endUnsplitAncestor, removeStart, end))
- embeddingRemoveEnd = positionInParentBeforeNode(endUnsplitAncestor).downstream();
+ embeddingRemoveEnd = positionInParentBeforeNode(*endUnsplitAncestor).downstream();
if (embeddingRemoveEnd != removeStart || embeddingRemoveEnd != end) {
styleWithoutEmbedding = style->copy();
@@ -656,8 +656,8 @@ void ApplyStyleCommand::applyInlineStyle(EditingStyle* style)
Node* embeddingEndNode = highestEmbeddingAncestor(end.deprecatedNode(), enclosingBlock(end.deprecatedNode()));
if (embeddingStartNode || embeddingEndNode) {
- Position embeddingApplyStart = embeddingStartNode ? positionInParentAfterNode(embeddingStartNode) : start;
- Position embeddingApplyEnd = embeddingEndNode ? positionInParentBeforeNode(embeddingEndNode) : end;
+ Position embeddingApplyStart = embeddingStartNode ? positionInParentAfterNode(*embeddingStartNode) : start;
+ Position embeddingApplyEnd = embeddingEndNode ? positionInParentBeforeNode(*embeddingEndNode) : end;
ASSERT(embeddingApplyStart.isNotNull() && embeddingApplyEnd.isNotNull());
if (!embeddingStyle) {
@@ -704,7 +704,7 @@ void ApplyStyleCommand::fixRangeAndApplyInlineStyle(EditingStyle* style, const P
RefPtr<Range> range = Range::create(startNode->document(), start, end);
Element* editableRoot = startNode->rootEditableElement();
if (startNode != editableRoot) {
- while (editableRoot && startNode->parentNode() != editableRoot && isNodeVisiblyContainedWithin(startNode->parentNode(), range.get()))
+ while (editableRoot && startNode->parentNode() != editableRoot && isNodeVisiblyContainedWithin(*startNode->parentNode(), *range))
startNode = startNode->parentNode();
}
« no previous file with comments | « Source/core/dom/PositionIterator.cpp ('k') | Source/core/editing/CompositeEditCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698