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

Unified Diff: Source/core/editing/Editor.cpp

Issue 1293593004: Introduce enum class TextAffinity as replacement of enum EAffinity (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-19T18:09:55 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/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;
}

Powered by Google App Engine
This is Rietveld 408576698