Bug 454595, improve editor drag and drop code, r+sr=neil
authorNeil Deakin <neil@mozilla.com>
Sat, 13 Sep 2008 18:09:20 -0400
changeset 19223 ecb32d66071e54c39e1061c9eadffe6779ecd154
parent 19222 1df65cbf518aee67c8ab9ccd8d78fa9d7707a42a
child 19224 83051fd9a4667004b3a34d64082ad24b16410907
push id2033
push userneil@mozilla.com
push dateSat, 13 Sep 2008 22:10:08 +0000
treeherderautoland@ecb32d66071e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs454595
milestone1.9.1b1pre
Bug 454595, improve editor drag and drop code, r+sr=neil
editor/libeditor/text/nsEditorEventListeners.cpp
--- a/editor/libeditor/text/nsEditorEventListeners.cpp
+++ b/editor/libeditor/text/nsEditorEventListeners.cpp
@@ -567,23 +567,22 @@ nsTextEditorDragListener::DragOver(nsIDO
 
     if (!dropParent->IsEditable())
       return NS_OK;
   }
 
   PRBool canDrop = CanDrop(aDragEvent);
   dragSession->SetCanDrop(canDrop);
 
-  // We need to consume the event to prevent the browser's
-  // default drag listeners from being fired. (Bug 199133)
-
-  aDragEvent->PreventDefault(); // consumed
-    
   if (canDrop)
   {
+    // We need to consume the event to prevent the browser's
+    // default drag listeners from being fired. (Bug 199133)
+    aDragEvent->PreventDefault(); // consumed
+
     if (mCaret && nsuiEvent)
     {
       PRInt32 offset = 0;
       rv = nsuiEvent->GetRangeOffset(&offset);
       if (NS_FAILED(rv)) return rv;
 
       // to avoid flicker, we could track the node and offset to see if we moved
       if (mCaretDrawn)