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

Unified Diff: third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp

Issue 2952983002: Make Position::FirstPositionInNode() to take const Node& instead of Node* (Closed)
Patch Set: 2017-06-23T10:37:43 Created 3 years, 6 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
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 19b8a96322398318c1b139edea9114fdd30e6ad2..8682b1f48c8cb8b2768572ebabbf15fbd4940d53 100644
--- a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
@@ -263,10 +263,10 @@ void ApplyStyleCommand::ApplyBlockStyle(EditingStyle* style,
Node& scope = NodeTraversal::HighestAncestorOrSelf(
*visible_start.DeepEquivalent().AnchorNode());
Range* start_range =
- Range::Create(GetDocument(), Position::FirstPositionInNode(&scope),
+ Range::Create(GetDocument(), Position::FirstPositionInNode(scope),
visible_start.DeepEquivalent().ParentAnchoredEquivalent());
Range* end_range =
- Range::Create(GetDocument(), Position::FirstPositionInNode(&scope),
+ Range::Create(GetDocument(), Position::FirstPositionInNode(scope),
visible_end.DeepEquivalent().ParentAnchoredEquivalent());
const TextIteratorBehavior behavior =
@@ -303,8 +303,8 @@ void ApplyStyleCommand::ApplyBlockStyle(EditingStyle* style,
block = new_block;
if (paragraph_start.IsOrphan()) {
GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets();
- paragraph_start =
- CreateVisiblePosition(Position::FirstPositionInNode(new_block));
+ paragraph_start = CreateVisiblePosition(
+ Position::FirstPositionInNode(*new_block));
}
}
DCHECK(!paragraph_start.IsOrphan()) << paragraph_start;
@@ -1552,7 +1552,7 @@ void ApplyStyleCommand::SplitTextAtStart(const Position& start,
Text* text = ToText(start.ComputeContainerNode());
SplitTextNode(text, start.OffsetInContainerNode());
- UpdateStartEnd(Position::FirstPositionInNode(text), new_end);
+ UpdateStartEnd(Position::FirstPositionInNode(*text), new_end);
}
void ApplyStyleCommand::SplitTextAtEnd(const Position& start,

Powered by Google App Engine
This is Rietveld 408576698