Bug 666256, cannot drop files onto a plugin, r=smaug
authorNeil Deakin <neil@mozilla.com>
Tue, 23 Aug 2011 08:54:37 -0400
changeset 75738 566f15cb9c5b8e01468f51e2b0f1b6ff692c8d3e
parent 75710 1e02b2b0d6a6c150d9acd9ea14ed2542be17fa73
child 75739 f86747fb659edf2e66ee42c0004e4b9492940beb
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewerssmaug
bugs666256
milestone9.0a1
Bug 666256, cannot drop files onto a plugin, r=smaug
dom/plugins/base/nsPluginInstanceOwner.cpp
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -1872,27 +1872,22 @@ nsPluginInstanceOwner::HandleEvent(nsIDO
     return KeyPress(aEvent);
   }
 
   nsCOMPtr<nsIDOMDragEvent> dragEvent(do_QueryInterface(aEvent));
   if (dragEvent && mInstance) {
     nsCOMPtr<nsIPrivateDOMEvent> privateEvent(do_QueryInterface(aEvent));
     if (privateEvent) {
       nsEvent* ievent = privateEvent->GetInternalNSEvent();
-      if (ievent && NS_IS_TRUSTED_EVENT(ievent) &&
-          (ievent->message == NS_DRAGDROP_ENTER || ievent->message == NS_DRAGDROP_OVER)) {
-        // set the allowed effect to none here. The plugin should set it if necessary
-        nsCOMPtr<nsIDOMDataTransfer> dataTransfer;
-        dragEvent->GetDataTransfer(getter_AddRefs(dataTransfer));
-        if (dataTransfer)
-          dataTransfer->SetEffectAllowed(NS_LITERAL_STRING("none"));
+      if ((ievent && NS_IS_TRUSTED_EVENT(ievent)) &&
+           ievent->message != NS_DRAGDROP_ENTER && ievent->message != NS_DRAGDROP_OVER) {
+        aEvent->PreventDefault();
       }
 
       // Let the plugin handle drag events.
-      aEvent->PreventDefault();
       aEvent->StopPropagation();
     }
   }
   return NS_OK;
 }
 
 #ifdef MOZ_X11
 static unsigned int XInputEventState(const nsInputEvent& anEvent)