Commit fec70a9b authored by yosin@chromium.org's avatar yosin@chromium.org

Make DragController to use VisibleSelection::toNormalizedEphemeralRange()...

Make DragController to use VisibleSelection::toNormalizedEphemeralRange() instead of toNormalizedRange()

This patch changes |DragController| class to use |toNormalizedEphemeralRange()|
in |VisibleSelection| class instead of |toNormalizedRange()| as a preparation
of templatizing |VisibleSelection| to use templatized positions instead of
DOM position to represent range.

This patch is a preparation of making selection to handle granularity for web
component, http://crrev.com/1277863002

BUG=513568
TEST=n/a; no behavior changes

Review URL: https://codereview.chromium.org/1316603002

git-svn-id: svn://svn.chromium.org/blink/trunk@201115 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 008c9ab1
...@@ -430,7 +430,7 @@ static bool setSelectionToDragCaret(LocalFrame* frame, VisibleSelection& dragCar ...@@ -430,7 +430,7 @@ static bool setSelectionToDragCaret(LocalFrame* frame, VisibleSelection& dragCar
if (frame->selection().isNone()) { if (frame->selection().isNone()) {
dragCaret = VisibleSelection(frame->positionForPoint(point)); dragCaret = VisibleSelection(frame->positionForPoint(point));
frame->selection().setSelection(dragCaret); frame->selection().setSelection(dragCaret);
range = dragCaret.toNormalizedRange(); range = createRange(dragCaret.toNormalizedEphemeralRange());
} }
return !frame->selection().isNone() && frame->selection().isContentEditable(); return !frame->selection().isNone() && frame->selection().isContentEditable();
} }
...@@ -483,7 +483,7 @@ bool DragController::concludeEditDrag(DragData* dragData) ...@@ -483,7 +483,7 @@ bool DragController::concludeEditDrag(DragData* dragData)
VisibleSelection dragCaret(m_page->dragCaretController().caretPosition()); VisibleSelection dragCaret(m_page->dragCaretController().caretPosition());
m_page->dragCaretController().clear(); m_page->dragCaretController().clear();
RefPtrWillBeRawPtr<Range> range = dragCaret.toNormalizedRange(); RefPtrWillBeRawPtr<Range> range = createRange(dragCaret.toNormalizedEphemeralRange());
RefPtrWillBeRawPtr<Element> rootEditableElement = innerFrame->selection().rootEditableElement(); RefPtrWillBeRawPtr<Element> rootEditableElement = innerFrame->selection().rootEditableElement();
// For range to be null a WebKit client must have done something bad while // For range to be null a WebKit client must have done something bad while
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment