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

Unified Diff: Source/core/editing/Editor.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
« no previous file with comments | « Source/core/editing/EditingUtilities.cpp ('k') | Source/core/editing/FrameSelection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/Editor.cpp
diff --git a/Source/core/editing/Editor.cpp b/Source/core/editing/Editor.cpp
index aee1ba1286300c0ee1a697c4f3912b16379e9105..cbfebe7732840b7a0a9d26fbbef22a278e246483 100644
--- a/Source/core/editing/Editor.cpp
+++ b/Source/core/editing/Editor.cpp
@@ -119,7 +119,7 @@ VisibleSelection Editor::selectionForCommand(Event* event)
HTMLTextFormControlElement* textFromControlOfTarget = isHTMLTextFormControlElement(*event->target()->toNode()) ? toHTMLTextFormControlElement(event->target()->toNode()) : 0;
if (textFromControlOfTarget && (selection.start().isNull() || textFromControlOfTarget != textFormControlOfSelectionStart)) {
if (RefPtrWillBeRawPtr<Range> range = textFromControlOfTarget->selection())
- return VisibleSelection(range.get(), DOWNSTREAM, selection.isDirectional());
+ return VisibleSelection(range.get(), TextAffinity::Downstream, selection.isDirectional());
}
return selection;
}
@@ -1033,7 +1033,7 @@ void Editor::transpose()
const EphemeralRange range = makeRange(previous, next);
if (range.isNull())
return;
- VisibleSelection newSelection(range, DOWNSTREAM);
+ VisibleSelection newSelection(range);
// Transpose the two characters.
String text = plainText(range);
@@ -1085,11 +1085,11 @@ IntRect Editor::firstRectForRange(const EphemeralRange& range) const
LayoutUnit extraWidthToEndOfLine = 0;
ASSERT(range.isNotNull());
- IntRect startCaretRect = RenderedPosition(VisiblePosition(range.startPosition()).deepEquivalent(), DOWNSTREAM).absoluteRect(&extraWidthToEndOfLine);
+ IntRect startCaretRect = RenderedPosition(VisiblePosition(range.startPosition()).deepEquivalent(), TextAffinity::Downstream).absoluteRect(&extraWidthToEndOfLine);
if (startCaretRect == LayoutRect())
return IntRect();
- IntRect endCaretRect = RenderedPosition(VisiblePosition(range.endPosition()).deepEquivalent(), UPSTREAM).absoluteRect();
+ IntRect endCaretRect = RenderedPosition(VisiblePosition(range.endPosition()).deepEquivalent(), TextAffinity::Upstream).absoluteRect();
if (endCaretRect == LayoutRect())
return IntRect();
@@ -1154,7 +1154,7 @@ bool Editor::findString(const String& target, FindOptions options)
if (!resultRange)
return false;
- frame().selection().setSelection(VisibleSelection(resultRange.get(), DOWNSTREAM));
+ frame().selection().setSelection(VisibleSelection(resultRange.get()));
frame().selection().revealSelection();
return true;
}
« no previous file with comments | « Source/core/editing/EditingUtilities.cpp ('k') | Source/core/editing/FrameSelection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698