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

Unified Diff: Source/core/editing/commands/InsertLineBreakCommand.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/InsertLineBreakCommand.cpp
diff --git a/Source/core/editing/commands/InsertLineBreakCommand.cpp b/Source/core/editing/commands/InsertLineBreakCommand.cpp
index 4539d2996449ce9a809c698429a543ce1665f563..1b0e53bb57e1729d33aa670ce9107404f45e6c30 100644
--- a/Source/core/editing/commands/InsertLineBreakCommand.cpp
+++ b/Source/core/editing/commands/InsertLineBreakCommand.cpp
@@ -108,12 +108,12 @@ void InsertLineBreakCommand::doApply()
if (!isStartOfParagraph(VisiblePosition(positionBeforeNode(nodeToInsert.get()))))
insertNodeBefore(nodeToInsert->cloneNode(false).get(), nodeToInsert.get());
- setEndingSelection(VisibleSelection(positionInParentAfterNode(*nodeToInsert), DOWNSTREAM, endingSelection().isDirectional()));
+ setEndingSelection(VisibleSelection(positionInParentAfterNode(*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.get(), pos);
- setEndingSelection(VisibleSelection(positionInParentAfterNode(*nodeToInsert), DOWNSTREAM, endingSelection().isDirectional()));
+ setEndingSelection(VisibleSelection(positionInParentAfterNode(*nodeToInsert), TextAffinity::Downstream, endingSelection().isDirectional()));
} else if (pos.anchorNode()->isTextNode()) {
// Split a text node
Text* textNode = toText(pos.anchorNode());
@@ -140,7 +140,7 @@ void InsertLineBreakCommand::doApply()
}
}
- setEndingSelection(VisibleSelection(endingPosition, DOWNSTREAM, endingSelection().isDirectional()));
+ setEndingSelection(VisibleSelection(endingPosition, TextAffinity::Downstream, endingSelection().isDirectional()));
}
// Handle the case where there is a typing style.

Powered by Google App Engine
This is Rietveld 408576698