Bug 538585, check if event is cancelled before dragging window, r=neil
authorNeil Deakin <neil@mozilla.com>
Mon, 01 Feb 2010 10:11:08 -0500
changeset 37790 be38c78eb674076c899f248f43466d09831780fa
parent 37789 f57b95afb57e72b65a4e56de0d5582e8248442bb
child 37791 653a6ad047ba34f4eb7a1a90d26caf6d435108bb
push id11436
push userneil@mozilla.com
push dateMon, 01 Feb 2010 15:13:06 +0000
treeherdermozilla-central@4ab5e6695dc8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil
bugs538585
milestone1.9.3a1pre
Bug 538585, check if event is cancelled before dragging window, r=neil
toolkit/content/WindowDraggingUtils.jsm
--- a/toolkit/content/WindowDraggingUtils.jsm
+++ b/toolkit/content/WindowDraggingUtils.jsm
@@ -45,17 +45,18 @@ function WindowDraggingElement(elem, win
 WindowDraggingElement.prototype = {
   mouseDownCheck: function(e) { return true; },
   dragTags: ["box", "hbox", "vbox", "spacer", "label", "statusbarpanel", "stack",
              "toolbaritem", "toolbarseparator", "toolbarspring", "toolbarspacer",
              "radiogroup", "deck", "scrollbox"],
   handleEvent: function(aEvent) {
     switch (aEvent.type) {
       case "mousedown":
-        if (aEvent.button != 0 || !this.mouseDownCheck.call(this._elem, aEvent))
+        if (aEvent.button != 0 || !this.mouseDownCheck.call(this._elem, aEvent) ||
+            aEvent.getPreventDefault())
           return;
 
         let target = aEvent.originalTarget, parent = aEvent.originalTarget;
         while (parent != this._elem) {
           let mousethrough = parent.getAttribute("mousethrough");
           if (mousethrough == "always")
             target = parent.parentNode;
           else if (mousethrough == "never")