Index: Source/core/page/DOMSelection.cpp |
diff --git a/Source/core/page/DOMSelection.cpp b/Source/core/page/DOMSelection.cpp |
index 04a5a906f620d609a8fd18b0d527c6eb179fffde..e98d6fba7d52a6dbd0daa1a0e11f4742fb0a5440 100644 |
--- a/Source/core/page/DOMSelection.cpp |
+++ b/Source/core/page/DOMSelection.cpp |
@@ -207,9 +207,14 @@ void DOMSelection::collapse(Node* node, int offset, ExceptionState& exceptionSta |
if (!isValidForPosition(node)) |
return; |
- |
- // FIXME: Eliminate legacy editing positions |
- m_frame->selection().moveTo(VisiblePosition(createLegacyEditingPosition(node, offset), DOWNSTREAM)); |
+ RefPtrWillBeRawPtr<Range> range = Range::create(node->document()); |
+ range->setStart(node, offset, exceptionState); |
+ if (exceptionState.hadException()) |
+ return; |
+ range->setEnd(node, offset, exceptionState); |
+ if (exceptionState.hadException()) |
+ return; |
+ m_frame->selection().setSelectedRange(range.get(), DOWNSTREAM, m_frame->selection().isDirectional()); |
} |
void DOMSelection::collapse(Node* node, ExceptionState& exceptionState) |