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

Unified Diff: third_party/WebKit/Source/core/editing/commands/TypingCommand.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/TypingCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
index 59505bc8887f4fb89a063ac5308504a1dfc4d5e8..5a61670d9c07c0e3cae37d3097f8f77792576d91 100644
--- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
@@ -458,7 +458,7 @@ bool TypingCommand::makeEditableRootEmpty(EditingState* editingState)
addBlockPlaceholderIfNeeded(root, editingState);
if (editingState->isAborted())
return false;
- setEndingSelection(VisibleSelection(Position::firstPositionInNode(root), TextAffinity::Downstream, endingSelection().isDirectional()));
+ setEndingSelection(createVisibleSelectionDeprecated(Position::firstPositionInNode(root), TextAffinity::Downstream, endingSelection().isDirectional()));
return true;
}
@@ -528,7 +528,7 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing,
selectionModifier.modify(FrameSelection::AlterationExtend, DirectionBackward, granularity);
// If the caret is just after a table, select the table and don't delete anything.
} else if (Element* table = tableElementJustBefore(visibleStart)) {
- setEndingSelection(VisibleSelection(Position::beforeNode(table), endingSelection().start(), TextAffinity::Downstream, endingSelection().isDirectional()));
+ setEndingSelection(createVisibleSelectionDeprecated(Position::beforeNode(table), endingSelection().start(), TextAffinity::Downstream, endingSelection().isDirectional()));
typingAddedToOpenCommand(DeleteKey);
return;
}
@@ -613,7 +613,7 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity, bool ki
downstreamEnd = mostForwardCaretPosition(nextPositionOf(visibleEnd, CannotCrossEditingBoundary).deepEquivalent());
// When deleting tables: Select the table first, then perform the deletion
if (isDisplayInsideTable(downstreamEnd.computeContainerNode()) && downstreamEnd.computeOffsetInContainerNode() <= caretMinOffset(downstreamEnd.computeContainerNode())) {
- setEndingSelection(VisibleSelection(endingSelection().end(), Position::afterNode(downstreamEnd.computeContainerNode()), TextAffinity::Downstream, endingSelection().isDirectional()));
+ setEndingSelection(createVisibleSelectionDeprecated(endingSelection().end(), Position::afterNode(downstreamEnd.computeContainerNode()), TextAffinity::Downstream, endingSelection().isDirectional()));
typingAddedToOpenCommand(ForwardDeleteKey);
return;
}

Powered by Google App Engine
This is Rietveld 408576698