Bug 471438, check whether the drop event was cancelled when handling links in the browser
authorNeil Deakin <neil@mozilla.com>
Wed, 14 Jan 2009 13:23:33 -0500
changeset 23683 ad53d0f865f9d23d95bb08c7487d7ad899757bae
parent 23682 fa2d1d0b9345a0f9cdb32655ddc827beff6a3926
child 23684 9cee068f81089207db9941e8f99a470472cb9985
push id4676
push userneil@mozilla.com
push dateWed, 14 Jan 2009 18:25:10 +0000
treeherdermozilla-central@ad53d0f865f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs471438
milestone1.9.2a1pre
Bug 471438, check whether the drop event was cancelled when handling links in the browser
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -4912,16 +4912,19 @@ function middleMousePaste(event)
  *
  * Do not add any new fuctionality here other than what is needed for
  * a standalone product.
  */
 
 var contentAreaDNDObserver = {
   onDrop: function (aEvent, aXferData, aDragSession)
     {
+      if (aEvent.getPreventDefault())
+        return;
+
       var url = transferUtils.retrieveURLFromData(aXferData.data, aXferData.flavour.contentType);
 
       // valid urls don't contain spaces ' '; if we have a space it
       // isn't a valid url, or if it's a javascript: or data: url,
       // bail out
       if (!url || !url.length || url.indexOf(" ", 0) != -1 ||
           /^\s*(javascript|data):/.test(url))
         return;