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

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

Issue 2951073002: CANCELED: Make ComputeNodeBeforePosition() to return const Node* (Closed)
Patch Set: 2017-06-21T17:59:27 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/ReplaceSelectionCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
index 8f2fb52bf0fd11af80d6d974f40bde7d5c1c0429..c50460eeecbdd8e3d5e63491ab17179806615116 100644
--- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
@@ -1642,7 +1642,7 @@ void ReplaceSelectionCommand::AddSpacesForSmartReplace(
VisiblePosition end_of_inserted_content = PositionAtEndOfInsertedContent();
Position end_upstream =
MostBackwardCaretPosition(end_of_inserted_content.DeepEquivalent());
- Node* end_node = end_upstream.ComputeNodeBeforePosition();
+ Node* end_node = const_cast<Node*>(end_upstream.ComputeNodeBeforePosition());
int end_offset =
end_node && end_node->IsTextNode() ? ToText(end_node)->length() : 0;
if (end_upstream.IsOffsetInAnchor()) {
@@ -1785,7 +1785,7 @@ void ReplaceSelectionCommand::MergeTextNodesAroundPosition(
position.ComputeContainerNode()->IsTextNode()) {
text = ToText(position.ComputeContainerNode());
} else {
- Node* before = position.ComputeNodeBeforePosition();
+ Node* before = const_cast<Node*>(position.ComputeNodeBeforePosition());
if (before && before->IsTextNode()) {
text = ToText(before);
} else {
« no previous file with comments | « third_party/WebKit/Source/core/editing/Position.cpp ('k') | third_party/WebKit/Source/core/html/TextControlElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698