2010-12-03 Daniel Cheng <dcheng@chromium.org>
Reviewed by Tony Chang.
Dragging and dropping into an empty document crashes WebKit.
https://bugs.webkit.org/show_bug.cgi?id=48793
Remove the assert and update callers to check for a null return value.
Test: manual-tests/drop-in-empty-doc.html
* manual-tests/drop-in-empty-doc.html: Added.
* manual-tests/resources/drop-in-empty-doc.xhtml: Added.
* page/DragController.cpp:
(WebCore::elementUnderMouse):
(WebCore::DragController::tryDocumentDrag):
(WebCore::DragController::concludeEditDrag):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73276 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/manual-tests/drop-in-empty-doc.html b/WebCore/manual-tests/drop-in-empty-doc.html
new file mode 100644
index 0000000..eae14f8
--- /dev/null
+++ b/WebCore/manual-tests/drop-in-empty-doc.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>Click <a href="javascript:window.open('resources/drop-in-empty-doc.xhtml')">here</a> to open a new window. Drag and drop a file over the new window. It should not crash.
+</body>
+</html>