From 52832515c003f8436a3a1ab64dd968d40483e8b9 Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Wed, 22 Feb 2012 09:58:43 +0100 Subject: [PATCH] Bug 728887 - Double clicking a tab group creates a new group under it; r=dietrich --- browser/components/tabview/test/Makefile.in | 1 + .../tabview/test/browser_tabview_bug728887.js | 15 +++++++++++++++ browser/components/tabview/ui.js | 3 +++ 3 files changed, 19 insertions(+) create mode 100644 browser/components/tabview/test/browser_tabview_bug728887.js diff --git a/browser/components/tabview/test/Makefile.in b/browser/components/tabview/test/Makefile.in index c2c35edb603..9c6205a07b9 100644 --- a/browser/components/tabview/test/Makefile.in +++ b/browser/components/tabview/test/Makefile.in @@ -169,6 +169,7 @@ _BROWSER_FILES = \ browser_tabview_bug706430.js \ browser_tabview_bug706736.js \ browser_tabview_bug707466.js \ + browser_tabview_bug728887.js \ browser_tabview_click_group.js \ browser_tabview_dragdrop.js \ browser_tabview_exit_button.js \ diff --git a/browser/components/tabview/test/browser_tabview_bug728887.js b/browser/components/tabview/test/browser_tabview_bug728887.js new file mode 100644 index 00000000000..fd1a82bb339 --- /dev/null +++ b/browser/components/tabview/test/browser_tabview_bug728887.js @@ -0,0 +1,15 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ + +function test() { + waitForExplicitFinish(); + + showTabView(function () { + let cw = TabView.getContentWindow(); + let target = cw.GroupItems.groupItems[0].container; + EventUtils.sendMouseEvent({type: "dblclick", button: 0}, target, cw); + is(cw.GroupItems.groupItems.length, 1, "one groupItem after double clicking"); + + hideTabView(finish); + }); +} diff --git a/browser/components/tabview/ui.js b/browser/components/tabview/ui.js index 0dab4143944..650e433acaf 100644 --- a/browser/components/tabview/ui.js +++ b/browser/components/tabview/ui.js @@ -205,6 +205,9 @@ let UI = { }); iQ(gTabViewFrame.contentDocument).dblclick(function(e) { + if (e.originalTarget.id != "content") + return; + // Create a group with one tab on double click let box = new Rect(e.clientX - Math.floor(TabItems.tabWidth/2),