Bug 685476 - App tab icons should not act as drag handlers for groupItems; r=dietrich

This commit is contained in:
Tim Taubert 2011-09-27 04:33:35 +02:00
parent e56193e6e8
commit e1b485937d
3 changed files with 29 additions and 0 deletions

View File

@ -1211,6 +1211,10 @@ GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
.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;

View File

@ -158,6 +158,7 @@ _BROWSER_FILES = \
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 \

View File

@ -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);
});
}