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

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

Issue 1299873002: ALL-IN-ONE Introduce enum class TextAffinity (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T18:08:52 Created 5 years, 4 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: Source/core/editing/commands/TypingCommand.cpp
diff --git a/Source/core/editing/commands/TypingCommand.cpp b/Source/core/editing/commands/TypingCommand.cpp
index 4c20d85a998c3dfdda938e88ea1c776232ae4947..f9b70e6c809f016e17fa59c793496772bbeecb14 100644
--- a/Source/core/editing/commands/TypingCommand.cpp
+++ b/Source/core/editing/commands/TypingCommand.cpp
@@ -402,7 +402,7 @@ bool TypingCommand::makeEditableRootEmpty()
removeNode(child);
addBlockPlaceholderIfNeeded(root);
- setEndingSelection(VisibleSelection(firstPositionInNode(root), DOWNSTREAM, endingSelection().isDirectional()));
+ setEndingSelection(VisibleSelection(firstPositionInNode(root), TextAffinity::Downstream, endingSelection().isDirectional()));
return true;
}
@@ -465,7 +465,7 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing)
selection->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 = isFirstPositionAfterTable(visibleStart)) {
- setEndingSelection(VisibleSelection(positionBeforeNode(table), endingSelection().start(), DOWNSTREAM, endingSelection().isDirectional()));
+ setEndingSelection(VisibleSelection(positionBeforeNode(table), endingSelection().start(), TextAffinity::Downstream, endingSelection().isDirectional()));
typingAddedToOpenCommand(DeleteKey);
return;
}
@@ -549,7 +549,7 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity, bool ki
downstreamEnd = visibleEnd.next(CannotCrossEditingBoundary).deepEquivalent().downstream();
// When deleting tables: Select the table first, then perform the deletion
if (isRenderedTableElement(downstreamEnd.computeContainerNode()) && downstreamEnd.computeOffsetInContainerNode() <= caretMinOffset(downstreamEnd.computeContainerNode())) {
- setEndingSelection(VisibleSelection(endingSelection().end(), positionAfterNode(downstreamEnd.computeContainerNode()), DOWNSTREAM, endingSelection().isDirectional()));
+ setEndingSelection(VisibleSelection(endingSelection().end(), positionAfterNode(downstreamEnd.computeContainerNode()), TextAffinity::Downstream, endingSelection().isDirectional()));
typingAddedToOpenCommand(ForwardDeleteKey);
return;
}
« no previous file with comments | « Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp ('k') | Source/core/editing/spellcheck/SpellChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698