Bug 685476 - App tab icons should not act as drag handlers for groupItems; r=dietrich
authorTim Taubert <tim.taubert@gmx.de>
Tue, 27 Sep 2011 04:33:35 +0200
changeset 77675 915ca38990ae9a4e3c5af81dc0089dca497aac68
parent 77674 12daae1947d755f438a9ea060832fe888a907005
child 77676 74dcfaa95ad218a4f17b5c01c08ff2a867b66eb0
push id21224
push usertim.taubert@gmx.de
push dateTue, 27 Sep 2011 11:21:51 +0000
treeherdermozilla-central@5373b67aec43 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdietrich
bugs685476
milestone9.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 685476 - App tab icons should not act as drag handlers for groupItems; r=dietrich
browser/base/content/tabview/groupitems.js
browser/base/content/test/tabview/Makefile.in
browser/base/content/test/tabview/browser_tabview_bug685476.js
--- a/browser/base/content/tabview/groupitems.js
+++ b/browser/base/content/tabview/groupitems.js
@@ -1206,16 +1206,20 @@ GroupItem.prototype = Utils.extend(new I
     let self = this;
 
     let iconUrl = GroupItems.getAppTabFavIconUrl(xulTab);
     let $appTab = iQ("<img>")
       .addClass("appTabIcon")
       .attr("src", iconUrl)
       .data("xulTab", xulTab)
       .appendTo(this.$appTabTray)
+      .mousedown(function onAppTabMousedown(event) {
+        // stop mousedown propagation to disable group dragging on app tabs
+        event.stopPropagation();
+      })
       .click(function(event) {
         if (!Utils.isLeftClick(event))
           return;
 
         UI.setActive(self, { dontSetActiveTabInGroup: true });
         UI.goToTab(iQ(this).data("xulTab"));
       });
 
--- a/browser/base/content/test/tabview/Makefile.in
+++ b/browser/base/content/test/tabview/Makefile.in
@@ -153,16 +153,17 @@ include $(topsrcdir)/config/rules.mk
                  browser_tabview_bug663421.js \
                  browser_tabview_bug665502.js \
                  browser_tabview_bug669694.js \
                  browser_tabview_bug673196.js \
                  browser_tabview_bug673729.js \
                  browser_tabview_bug677310.js \
                  browser_tabview_bug679853.js \
                  browser_tabview_bug681599.js \
+                 browser_tabview_bug685476.js \
                  browser_tabview_bug685692.js \
                  browser_tabview_bug686654.js \
                  browser_tabview_click_group.js \
                  browser_tabview_dragdrop.js \
                  browser_tabview_exit_button.js \
                  browser_tabview_expander.js \
                  browser_tabview_firstrun_pref.js \
                  browser_tabview_group.js \
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabview/browser_tabview_bug685476.js
@@ -0,0 +1,24 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function test() {
+  waitForExplicitFinish();
+
+  showTabView(function () {
+    let tab = gBrowser.addTab();
+    gBrowser.pinTab(tab);
+    registerCleanupFunction(function () gBrowser.removeTab(tab));
+
+    let cw = TabView.getContentWindow();
+    let body = cw.document.body;
+    let [appTabIcon] = cw.iQ(".appTabTray .appTabIcon");
+
+    EventUtils.synthesizeMouseAtCenter(appTabIcon, {type: "mousedown"}, cw);
+    EventUtils.synthesizeMouse(body, 500, 100, {type: "mousemove"}, cw);
+    EventUtils.synthesizeMouse(body, 500, 100, {type: "mouseup"}, cw);
+
+    ok(TabView.isVisible(), "tabview is still visible");
+
+    hideTabView(finish);
+  });
+}