Upstream version 10.38.208.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / editing / DOMSelection.cpp
index 68f9d09..cd4cb26 100644 (file)
@@ -197,10 +197,14 @@ int DOMSelection::rangeCount() const
 
 void DOMSelection::collapse(Node* node, int offset, ExceptionState& exceptionState)
 {
-    ASSERT(node);
     if (!m_frame)
         return;
 
+    if (!node) {
+        m_frame->selection().clear();
+        return;
+    }
+
     if (offset < 0) {
         exceptionState.throwDOMException(IndexSizeError, String::number(offset) + " is not a valid offset.");
         return;