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

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

Issue 2393353004: Prune deprecated functions from TypingCommand (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a7b5564a499ca9513b337cae01d945c7ae2aa2fb..4f16d7ec4bf90df7cfb8a98055a267ddc09287f1 100644
--- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
@@ -512,9 +512,10 @@ bool TypingCommand::makeEditableRootEmpty(EditingState* editingState) {
addBlockPlaceholderIfNeeded(root, editingState);
if (editingState->isAborted())
return false;
- setEndingSelection(createVisibleSelectionDeprecated(
- Position::firstPositionInNode(root), TextAffinity::Downstream,
- endingSelection().isDirectional()));
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
+ setEndingSelection(createVisibleSelection(Position::firstPositionInNode(root),
+ TextAffinity::Downstream,
+ endingSelection().isDirectional()));
return true;
}
@@ -557,7 +558,7 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity,
selectionModifier.modify(FrameSelection::AlterationExtend,
DirectionBackward, CharacterGranularity);
- VisiblePosition visibleStart(endingSelection().visibleStartDeprecated());
+ VisiblePosition visibleStart(endingSelection().visibleStart());
if (previousPositionOf(visibleStart, CannotCrossEditingBoundary)
.isNull()) {
// When the caret is at the start of the editable area in an empty list
@@ -593,7 +594,7 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity,
// If the caret is at the start of a paragraph after a table, move content
// into the last table cell.
- if (isStartOfParagraphDeprecated(visibleStart) &&
+ if (isStartOfParagraph(visibleStart) &&
tableElementJustBefore(
previousPositionOf(visibleStart, CannotCrossEditingBoundary))) {
// Unless the caret is just before a table. We don't want to move a
@@ -607,7 +608,7 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity,
// If the caret is just after a table, select the table and don't delete
// anything.
} else if (Element* table = tableElementJustBefore(visibleStart)) {
- setEndingSelection(createVisibleSelectionDeprecated(
+ setEndingSelection(createVisibleSelection(
Position::beforeNode(table), endingSelection().start(),
TextAffinity::Downstream, endingSelection().isDirectional()));
typingAddedToOpenCommand(DeleteKey);
@@ -707,7 +708,7 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity,
Position downstreamEnd =
mostForwardCaretPosition(endingSelection().end());
- VisiblePosition visibleEnd = endingSelection().visibleEndDeprecated();
+ VisiblePosition visibleEnd = endingSelection().visibleEnd();
Node* enclosingTableCell =
enclosingNodeOfType(visibleEnd.deepEquivalent(), &isTableCell);
if (enclosingTableCell &&
@@ -716,7 +717,7 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity,
.deepEquivalent())
return;
if (visibleEnd.deepEquivalent() ==
- endOfParagraphDeprecated(visibleEnd).deepEquivalent())
+ endOfParagraph(visibleEnd).deepEquivalent())
downstreamEnd = mostForwardCaretPosition(
nextPositionOf(visibleEnd, CannotCrossEditingBoundary)
.deepEquivalent());
@@ -724,7 +725,7 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity,
if (isDisplayInsideTable(downstreamEnd.computeContainerNode()) &&
downstreamEnd.computeOffsetInContainerNode() <=
caretMinOffset(downstreamEnd.computeContainerNode())) {
- setEndingSelection(createVisibleSelectionDeprecated(
+ setEndingSelection(createVisibleSelection(
endingSelection().end(),
Position::afterNode(downstreamEnd.computeContainerNode()),
TextAffinity::Downstream, endingSelection().isDirectional()));
@@ -736,8 +737,7 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity,
// the next paragraph (if any)
if (granularity == ParagraphBoundary &&
selectionModifier.selection().isCaret() &&
- isEndOfParagraphDeprecated(
- selectionModifier.selection().visibleEndDeprecated()))
+ isEndOfParagraph(selectionModifier.selection().visibleEnd()))
selectionModifier.modify(FrameSelection::AlterationExtend,
DirectionForward, CharacterGranularity);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698