Bug 896596 - _onDragStart hack in CustomizeMode should not cause placeholders to get inserted after exiting customize mode. r=Gijs.
authorMike Conley <mconley@mozilla.com>
Tue, 23 Jul 2013 11:11:09 -0400
changeset 155584 d7fd9dcb68a8a404b226cfe7dbbcb05fd5c0d8e0
parent 155583 0c53c2cf98b5eb0acbdc884cb6fb404a5dd12105
child 155585 d6623f06fe55de418f70332f88e79d7ed6923056
push id25666
push userjwein@mozilla.com
push dateMon, 18 Nov 2013 15:56:58 +0000
treeherdermozilla-central@f2adb62d07eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs896596
milestone25.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 896596 - _onDragStart hack in CustomizeMode should not cause placeholders to get inserted after exiting customize mode. r=Gijs.
browser/components/customizableui/src/CustomizeMode.jsm
--- a/browser/components/customizableui/src/CustomizeMode.jsm
+++ b/browser/components/customizableui/src/CustomizeMode.jsm
@@ -694,18 +694,23 @@ CustomizeMode.prototype = {
 
     dt.mozSetDataAt(kDragDataTypePrefix + documentId, data, 0);
     dt.effectAllowed = "move";
 
     // Hack needed so that the dragimage will still show the
     // item as it appeared before it was hidden.
     let win = aEvent.target.ownerDocument.defaultView;
     win.setTimeout(function() {
-      item.hidden = true;
-      this._showPanelCustomizationPlaceholders();
+      // For automated tests, we sometimes start exiting customization mode
+      // before this fires, which leaves us with placeholders inserted after
+      // we've exited. So we need to check that we are indeed customizing.
+      if (this._customizing && !this._transitioning) {
+        item.hidden = true;
+        this._showPanelCustomizationPlaceholders();
+      }
     }.bind(this), 0);
   },
 
   _onDragOver: function(aEvent) {
     __dumpDragData(aEvent);
 
     let document = aEvent.target.ownerDocument;
     let documentId = document.documentElement.id;