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

Unified Diff: third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp

Issue 2950053002: Make Position::BeforeNode() to take const Node& instead of Node* (Closed)
Patch Set: 2017-06-21T17:56:36 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/SelectionAdjuster.cpp
diff --git a/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp b/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp
index 2ed10f7090cccc9eb40b19e40d567ce0a42a792d..565a6bc650129f3840530c8acc0dd99e7b4fe21a 100644
--- a/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionAdjuster.cpp
@@ -84,7 +84,7 @@ PositionInFlatTree AdjustPositionInFlatTreeForStart(
Node* shadow_host) {
if (IsEnclosedBy(position, *shadow_host)) {
if (position.IsBeforeChildren())
- return PositionInFlatTree::BeforeNode(shadow_host);
+ return PositionInFlatTree::BeforeNode(*shadow_host);
return PositionInFlatTree::AfterNode(shadow_host);
}
@@ -92,7 +92,7 @@ PositionInFlatTree AdjustPositionInFlatTreeForStart(
// compatibility. The positions are same but the anchors would be different,
// and selection painting uses anchor nodes.
if (Node* first_child = FlatTreeTraversal::FirstChild(*shadow_host))
- return PositionInFlatTree::BeforeNode(first_child);
+ return PositionInFlatTree::BeforeNode(*first_child);
return PositionInFlatTree();
}
@@ -106,7 +106,7 @@ Position AdjustPositionForEnd(const Position& current_position,
current_position.ComputeContainerNode())) {
if (ancestor->contains(start_container_node))
return Position::AfterNode(ancestor);
- return Position::BeforeNode(ancestor);
+ return Position::BeforeNode(*ancestor);
}
if (Node* last_child = tree_scope.RootNode().lastChild())
@@ -121,7 +121,7 @@ PositionInFlatTree AdjustPositionInFlatTreeForEnd(
if (IsEnclosedBy(position, *shadow_host)) {
if (position.IsAfterChildren())
return PositionInFlatTree::AfterNode(shadow_host);
- return PositionInFlatTree::BeforeNode(shadow_host);
+ return PositionInFlatTree::BeforeNode(*shadow_host);
}
// We use |lastChild|'s after instead of afterAllChildren for backward
@@ -141,12 +141,12 @@ Position AdjustPositionForStart(const Position& current_position,
if (Node* ancestor = tree_scope.AncestorInThisScope(
current_position.ComputeContainerNode())) {
if (ancestor->contains(end_container_node))
- return Position::BeforeNode(ancestor);
+ return Position::BeforeNode(*ancestor);
return Position::AfterNode(ancestor);
}
if (Node* first_child = tree_scope.RootNode().firstChild())
- return Position::BeforeNode(first_child);
+ return Position::BeforeNode(*first_child);
return Position();
}

Powered by Google App Engine
This is Rietveld 408576698