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

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

Issue 2374183004: Make non-null VisibleSelections creatable only by createVisibleSelection[Deprecated] (Closed)
Patch Set: Fix mac compile error Created 4 years, 3 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/InsertLineBreakCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.cpp
index 24f4fb5d87abd4ecb0920d637bdf40399d5338b9..b4618336526c561fa61f8ee77682c03f2fad15f1 100644
--- a/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/InsertLineBreakCommand.cpp
@@ -120,7 +120,7 @@ void InsertLineBreakCommand::doApply(EditingState* editingState)
}
VisiblePosition endingPosition = VisiblePosition::beforeNode(nodeToInsert);
- setEndingSelection(VisibleSelection(endingPosition, endingSelection().isDirectional()));
+ setEndingSelection(createVisibleSelectionDeprecated(endingPosition, endingSelection().isDirectional()));
} else if (pos.computeEditingOffset() <= caretMinOffset(pos.anchorNode())) {
insertNodeAt(nodeToInsert, pos, editingState);
if (editingState->isAborted())
@@ -133,14 +133,14 @@ void InsertLineBreakCommand::doApply(EditingState* editingState)
return;
}
- setEndingSelection(VisibleSelection(Position::inParentAfterNode(*nodeToInsert), TextAffinity::Downstream, endingSelection().isDirectional()));
+ setEndingSelection(createVisibleSelectionDeprecated(Position::inParentAfterNode(*nodeToInsert), TextAffinity::Downstream, endingSelection().isDirectional()));
// If we're inserting after all of the rendered text in a text node, or into a non-text node,
// a simple insertion is sufficient.
} else if (!pos.anchorNode()->isTextNode() || pos.computeOffsetInContainerNode() >= caretMaxOffset(pos.anchorNode())) {
insertNodeAt(nodeToInsert, pos, editingState);
if (editingState->isAborted())
return;
- setEndingSelection(VisibleSelection(Position::inParentAfterNode(*nodeToInsert), TextAffinity::Downstream, endingSelection().isDirectional()));
+ setEndingSelection(createVisibleSelectionDeprecated(Position::inParentAfterNode(*nodeToInsert), TextAffinity::Downstream, endingSelection().isDirectional()));
} else if (pos.anchorNode()->isTextNode()) {
// Split a text node
Text* textNode = toText(pos.anchorNode());
@@ -171,7 +171,7 @@ void InsertLineBreakCommand::doApply(EditingState* editingState)
}
}
- setEndingSelection(VisibleSelection(endingPosition, TextAffinity::Downstream, endingSelection().isDirectional()));
+ setEndingSelection(createVisibleSelectionDeprecated(endingPosition, TextAffinity::Downstream, endingSelection().isDirectional()));
}
// Handle the case where there is a typing style.

Powered by Google App Engine
This is Rietveld 408576698