From 426a1483b8562287423bdd2b44ced3534d5860ce Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Tue, 21 Jun 2011 15:06:42 -0700 Subject: [PATCH 1/8] Bug 665044 - lift CC GC outside of the CCRunner mutex. r=bent --- xpcom/base/nsCycleCollector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index 4fbe1512498..ca892d7d233 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -3414,6 +3414,8 @@ public: { NS_ASSERTION(NS_IsMainThread(), "Wrong thread!"); + mCollector->GCIfNeeded(PR_FALSE); + MutexAutoLock autoLock(mLock); if (!mRunning) @@ -3426,8 +3428,6 @@ public: NS_ASSERTION(!mListener, "Should have cleared this already!"); mListener = aListener; - mCollector->GCIfNeeded(PR_FALSE); - mRequest.Notify(); mReply.Wait(); From b32ddb068b17cd1fb71602c9c87b4eef1023e524 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Mon, 27 Jun 2011 11:14:07 -0700 Subject: [PATCH 2/8] Bug 666842 - Use an ellipsis for long tab names in Panorama. r=dao --- browser/base/content/tabview/tabview.css | 3 +++ browser/themes/gnomestripe/browser/tabview/tabview.css | 2 -- browser/themes/pinstripe/browser/tabview/tabview.css | 2 -- browser/themes/winstripe/browser/tabview/tabview.css | 2 -- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/browser/base/content/tabview/tabview.css b/browser/base/content/tabview/tabview.css index 682997b7279..8a0eb7dc1c3 100644 --- a/browser/base/content/tabview/tabview.css +++ b/browser/base/content/tabview/tabview.css @@ -72,6 +72,9 @@ body { .tab-title { position: absolute; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .stacked .tab-title { diff --git a/browser/themes/gnomestripe/browser/tabview/tabview.css b/browser/themes/gnomestripe/browser/tabview/tabview.css index 12445e630ba..bdea111163a 100644 --- a/browser/themes/gnomestripe/browser/tabview/tabview.css +++ b/browser/themes/gnomestripe/browser/tabview/tabview.css @@ -142,8 +142,6 @@ html[dir=rtl] .expander { top: 100%; text-align: center; width: 94.5%; - white-space: nowrap; - overflow: hidden; } .stacked { diff --git a/browser/themes/pinstripe/browser/tabview/tabview.css b/browser/themes/pinstripe/browser/tabview/tabview.css index 9ecda844fd8..0b5a40ca036 100644 --- a/browser/themes/pinstripe/browser/tabview/tabview.css +++ b/browser/themes/pinstripe/browser/tabview/tabview.css @@ -134,8 +134,6 @@ html[dir=rtl] .expander { bottom: -20px; text-align: center; width: 94.5%; - white-space: nowrap; - overflow: hidden; text-shadow: 0 1px rgba(255, 255, 255, 0.6); } diff --git a/browser/themes/winstripe/browser/tabview/tabview.css b/browser/themes/winstripe/browser/tabview/tabview.css index 025a7b02bd2..76fcae72aee 100644 --- a/browser/themes/winstripe/browser/tabview/tabview.css +++ b/browser/themes/winstripe/browser/tabview/tabview.css @@ -139,8 +139,6 @@ html[dir=rtl] .expander { bottom: -20px; text-align: center; width: 94.5%; - white-space: nowrap; - overflow: hidden; text-shadow: 0 1px rgba(255, 255, 255, 0.6); } From d6902ff885a0afed4fe045353b5a0998c3dab71c Mon Sep 17 00:00:00 2001 From: Jonas Sicking Date: Mon, 27 Jun 2011 12:25:55 -0700 Subject: [PATCH 3/8] Bug 665609: Remove Add/RemoveEventListenerByIID API usage from nsXULPopupListener. r=smaug. Also r=ms2ger on killing NS_NewXULPopupListener. --- content/xul/content/src/nsXULElement.cpp | 9 +-- .../xul/content/src/nsXULPopupListener.cpp | 55 +++++-------------- content/xul/content/src/nsXULPopupListener.h | 38 ++----------- 3 files changed, 21 insertions(+), 81 deletions(-) diff --git a/content/xul/content/src/nsXULElement.cpp b/content/xul/content/src/nsXULElement.cpp index 57e20072dc5..e735d7b99c7 100644 --- a/content/xul/content/src/nsXULElement.cpp +++ b/content/xul/content/src/nsXULElement.cpp @@ -2217,16 +2217,13 @@ nsXULElement::AddPopupListener(nsIAtom* aName) return NS_OK; } - nsresult rv = NS_NewXULPopupListener(this, isContext, - getter_AddRefs(popupListener)); - if (NS_FAILED(rv)) - return rv; + popupListener = new nsXULPopupListener(this, isContext); // Add the popup as a listener on this element. nsEventListenerManager* manager = GetListenerManager(PR_TRUE); NS_ENSURE_TRUE(manager, NS_ERROR_FAILURE); - rv = SetProperty(listenerAtom, popupListener, PopupListenerPropertyDtor, - PR_TRUE); + nsresult rv = SetProperty(listenerAtom, popupListener, + PopupListenerPropertyDtor, PR_TRUE); NS_ENSURE_SUCCESS(rv, rv); // Want the property to have a reference to the listener. nsIDOMEventListener* listener = nsnull; diff --git a/content/xul/content/src/nsXULPopupListener.cpp b/content/xul/content/src/nsXULPopupListener.cpp index c6b7aaba01b..2f7b6937708 100644 --- a/content/xul/content/src/nsXULPopupListener.cpp +++ b/content/xul/content/src/nsXULPopupListener.cpp @@ -104,39 +104,26 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(nsXULPopupListener) NS_IMPL_CYCLE_COLLECTING_RELEASE(nsXULPopupListener) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsXULPopupListener) - NS_INTERFACE_MAP_ENTRY(nsIDOMMouseListener) - NS_INTERFACE_MAP_ENTRY(nsIDOMContextMenuListener) - NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsIDOMEventListener, nsIDOMMouseListener) + NS_INTERFACE_MAP_ENTRY(nsIDOMEventListener) + NS_INTERFACE_MAP_ENTRY(nsISupports) NS_INTERFACE_MAP_END //////////////////////////////////////////////////////////////// -// nsIDOMMouseListener +// nsIDOMEventListener nsresult -nsXULPopupListener::MouseDown(nsIDOMEvent* aMouseEvent) +nsXULPopupListener::HandleEvent(nsIDOMEvent* aEvent) { - if(!mIsContext) - return PreLaunchPopup(aMouseEvent); - else + nsAutoString eventType; + aEvent->GetType(eventType); + + if(!((eventType.EqualsLiteral("mousedown") && !mIsContext) || + (eventType.EqualsLiteral("contextmenu") && mIsContext))) return NS_OK; -} -nsresult -nsXULPopupListener::ContextMenu(nsIDOMEvent* aMouseEvent) -{ - if(mIsContext) - return PreLaunchPopup(aMouseEvent); - else - return NS_OK; -} - -nsresult -nsXULPopupListener::PreLaunchPopup(nsIDOMEvent* aMouseEvent) -{ PRUint16 button; - nsCOMPtr mouseEvent; - mouseEvent = do_QueryInterface(aMouseEvent); + nsCOMPtr mouseEvent = do_QueryInterface(aEvent); if (!mouseEvent) { //non-ui event passed in. bad things. return NS_OK; @@ -223,7 +210,7 @@ nsXULPopupListener::PreLaunchPopup(nsIDOMEvent* aMouseEvent) return NS_OK; } - nsCOMPtr nsevent(do_QueryInterface(aMouseEvent)); + nsCOMPtr nsevent = do_QueryInterface(aEvent); if (mIsContext) { #ifndef NS_CONTEXT_MENU_IS_MOUSEUP @@ -240,9 +227,9 @@ nsXULPopupListener::PreLaunchPopup(nsIDOMEvent* aMouseEvent) } // Open the popup and cancel the default handling of the event. - LaunchPopup(aMouseEvent, targetContent); - aMouseEvent->StopPropagation(); - aMouseEvent->PreventDefault(); + LaunchPopup(aEvent, targetContent); + aEvent->StopPropagation(); + aEvent->PreventDefault(); return NS_OK; } @@ -474,17 +461,3 @@ nsXULPopupListener::LaunchPopup(nsIDOMEvent* aEvent, nsIContent* aTargetContent) return NS_OK; } - -//////////////////////////////////////////////////////////////// -nsresult -NS_NewXULPopupListener(nsIDOMElement* aElement, PRBool aIsContext, - nsIDOMEventListener** aListener) -{ - nsXULPopupListener* pl = new nsXULPopupListener(aElement, aIsContext); - if (!pl) - return NS_ERROR_OUT_OF_MEMORY; - - *aListener = static_cast(pl); - NS_ADDREF(*aListener); - return NS_OK; -} diff --git a/content/xul/content/src/nsXULPopupListener.h b/content/xul/content/src/nsXULPopupListener.h index 96876b8a605..82c198f2bd7 100644 --- a/content/xul/content/src/nsXULPopupListener.h +++ b/content/xul/content/src/nsXULPopupListener.h @@ -52,12 +52,10 @@ #include "nsIDOMElement.h" #include "nsIDOMMouseEvent.h" #include "nsIFrame.h" -#include "nsIDOMMouseListener.h" -#include "nsIDOMContextMenuListener.h" +#include "nsIDOMEventListener.h" #include "nsCycleCollectionParticipant.h" -class nsXULPopupListener : public nsIDOMMouseListener, - public nsIDOMContextMenuListener +class nsXULPopupListener : public nsIDOMEventListener { public: // aElement is the element that the popup is attached to. If aIsContext is @@ -69,25 +67,10 @@ public: // nsISupports NS_DECL_CYCLE_COLLECTING_ISUPPORTS - NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsXULPopupListener, - nsIDOMMouseListener) - - // nsIDOMMouseListener - NS_IMETHOD MouseDown(nsIDOMEvent* aMouseEvent); - NS_IMETHOD MouseUp(nsIDOMEvent* aMouseEvent) { return NS_OK; } - NS_IMETHOD MouseClick(nsIDOMEvent* aMouseEvent) { return NS_OK; } - NS_IMETHOD MouseDblClick(nsIDOMEvent* aMouseEvent) { return NS_OK; } - NS_IMETHOD MouseOver(nsIDOMEvent* aMouseEvent) { return NS_OK; } - NS_IMETHOD MouseOut(nsIDOMEvent* aMouseEvent) { return NS_OK; } - - // nsIDOMContextMenuListener - NS_IMETHOD ContextMenu(nsIDOMEvent* aContextMenuEvent); - - // nsIDOMEventListener - NS_IMETHOD HandleEvent(nsIDOMEvent* anEvent) { return NS_OK; } + NS_DECL_CYCLE_COLLECTION_CLASS(nsXULPopupListener) + NS_DECL_NSIDOMEVENTLISTENER protected: - // open the popup. aEvent is the event that triggered the popup such as // a mouse click and aTargetContent is the target of this event. virtual nsresult LaunchPopup(nsIDOMEvent* aEvent, nsIContent* aTargetContent); @@ -96,12 +79,6 @@ protected: virtual void ClosePopup(); private: - - // PreLaunchPopup is called before LaunchPopup to ensure that the event is - // suitable and to initialize the XUL document's popupNode to the event - // target. - nsresult PreLaunchPopup(nsIDOMEvent* aMouseEvent); - #ifndef NS_CONTEXT_MENU_IS_MOUSEUP // When a context menu is opened, focus the target of the contextmenu event. nsresult FireFocusOnTargetContent(nsIDOMNode* aTargetNode); @@ -117,11 +94,4 @@ private: PRBool mIsContext; }; -// Construct a new nsXULPopupListener and return in aListener. See the -// nsXULPopupListener constructor for details about the aElement and -// aIsContext arguments. -nsresult -NS_NewXULPopupListener(nsIDOMElement* aElement, PRBool aIsContext, - nsIDOMEventListener** aListener); - #endif // nsXULPopupListener_h___ From f64d744ad73ed42cf830ba3bd06befa9b308dff5 Mon Sep 17 00:00:00 2001 From: Steffen Wilberg Date: Mon, 27 Jun 2011 21:32:53 +0200 Subject: [PATCH 4/8] Bug 611568: Move File > Import to the Library. ui-r=faaborg, r=dao --- browser/base/content/browser-menubar.inc | 7 -- browser/base/content/browser.js | 22 ------ browser/components/places/content/places.js | 68 ++++++++++++++++--- browser/components/places/content/places.xul | 17 +++-- .../browser/browser_privatebrowsing_import.js | 63 +++++++++++++---- .../locales/en-US/chrome/browser/browser.dtd | 2 - .../en-US/chrome/browser/places/places.dtd | 10 +-- 7 files changed, 126 insertions(+), 63 deletions(-) diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/browser-menubar.inc index 230db564316..094a0f202a3 100644 --- a/browser/base/content/browser-menubar.inc +++ b/browser/base/content/browser-menubar.inc @@ -108,13 +108,6 @@ key="printKb" command="cmd_print"/> - -#ifndef XP_MACOSX - -#endif * Ehsan Akhgari * Drew Willcoxon + * Steffen Wilberg * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -114,6 +115,8 @@ var PlacesOrganizer = { // remove the "Properties" context-menu item, we've our own details pane document.getElementById("placesContext") .removeChild(document.getElementById("placesContext_show:info")); + + gPrivateBrowsingListener.init(); }, QueryInterface: function PO_QueryInterface(aIID) { @@ -145,6 +148,7 @@ var PlacesOrganizer = { }, destroy: function PO_destroy() { + gPrivateBrowsingListener.uninit(); }, _location: null, @@ -364,19 +368,24 @@ var PlacesOrganizer = { }, /** - * Show the migration wizard for importing from a file. + * Show the migration wizard for importing passwords, + * cookies, history, preferences, and bookmarks. */ - importBookmarks: function PO_import() { - // XXX: ifdef it to be non-modal (non-"sheet") on mac (see bug 259039) - var features = "modal,centerscreen,chrome,resizable=no"; + importFromBrowser: function PO_importFromBrowser() { +#ifdef XP_MACOSX + // On Mac, the window is not modal + let win = Services.wm.getMostRecentWindow("Browser:MigrationWizard"); + if (win) { + win.focus(); + return; + } - // The migrator window will set this to true when it closes, if the user - // chose to migrate from a specific file. - window.fromFile = false; - openDialog("chrome://browser/content/migration/migration.xul", - "migration", features, "bookmarks"); - if (window.fromFile) - this.importFromFile(); + let features = "centerscreen,chrome,resizable=no"; +#else + let features = "modal,centerscreen,chrome,resizable=no"; +#endif + window.openDialog("chrome://browser/content/migration/migration.xul", + "migration", features); }, /** @@ -1340,4 +1349,41 @@ var ViewMenu = { result.sortingAnnotation = colLookupTable[columnId].anno || ""; result.sortingMode = Ci.nsINavHistoryQueryOptions[sortConst]; } +} + +/** + * Disables the "Import and Backup->Import From Another Browser" menu item + * in private browsing mode. + */ +let gPrivateBrowsingListener = { + _cmd_import: null, + + init: function PO_PB_init() { + this._cmd_import = document.getElementById("OrganizerCommand_browserImport"); + + let pbs = Cc["@mozilla.org/privatebrowsing;1"]. + getService(Ci.nsIPrivateBrowsingService); + if (pbs.privateBrowsingEnabled) + this.updateUI(true); + + Services.obs.addObserver(this, "private-browsing", false); + }, + + uninit: function PO_PB_uninit() { + Services.obs.removeObserver(this, "private-browsing"); + }, + + observe: function PO_PB_observe(aSubject, aTopic, aData) { + if (aData == "enter") + this.updateUI(true); + else if (aData == "exit") + this.updateUI(false); + }, + + updateUI: function PO_PB_updateUI(PBmode) { + if (PBmode) + this._cmd_import.setAttribute("disabled", "true"); + else + this._cmd_import.removeAttribute("disabled"); + } }; diff --git a/browser/components/places/content/places.xul b/browser/components/places/content/places.xul index e89121c2046..63c4517213a 100644 --- a/browser/components/places/content/places.xul +++ b/browser/components/places/content/places.xul @@ -109,7 +109,9 @@ + oncommand="PlacesOrganizer.importFromFile();"/> + + label="&importBookmarksFromHTML.label;" + accesskey="&importBookmarksFromHTML.accesskey;"/> + label="&exportBookmarksToHTML.label;" + accesskey="&exportBookmarksToHTML.accesskey;"/> + + #ifdef XP_MACOSX diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_import.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_import.js index b7de165a94c..c58c8b51fef 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_import.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_import.js @@ -20,6 +20,7 @@ * * Contributor(s): * Ehsan Akhgari (Original Author) + * Steffen Wilberg * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), @@ -35,33 +36,71 @@ * * ***** END LICENSE BLOCK ***** */ -// This test makes sure that the File->Import menu item is disabled inside the -// private browsing mode. +// This test makes sure that the "Import and Backup->Import From Another Browser" +// menu item in the Places Organizer is disabled inside private browsing mode. + +// TEST_PATH=browser/components/privatebrowsing/test/browser/browser_privatebrowsing_import.js make -C $(OBJDIR) mochitest-browser-chrome + +let pb = Cc["@mozilla.org/privatebrowsing;1"]. + getService(Ci.nsIPrivateBrowsingService); function test() { - // initialization + waitForExplicitFinish(); gPrefService.setBoolPref("browser.privatebrowsing.keep_current_session", true); - let pb = Cc["@mozilla.org/privatebrowsing;1"]. - getService(Ci.nsIPrivateBrowsingService); - let importMenuItem = document.getElementById("menu_import"); + // first test: open the library with PB disabled + pb.privateBrowsingEnabled = false; + openLibrary(testPBoff); +} - // make sure the menu item is not disabled to begin with +function openLibrary(callback) { + var library = window.openDialog("chrome://browser/content/places/places.xul", + "", "chrome,toolbar=yes,dialog=no,resizable"); + waitForFocus(function () { + callback(library); + }, library); +} + +function testPBoff(win) { + // XXX want to test the #browserImport menuitem instead + let importMenuItem = win.document.getElementById("OrganizerCommand_browserImport"); + + // make sure the menu item is enabled outside PB mode when opening the Library ok(!importMenuItem.hasAttribute("disabled"), - "File->Import menu item should not be disabled outside of the private browsing mode"); + "Import From Another Browser menu item should be enabled outside PB mode when opening the Library"); // enter private browsing mode pb.privateBrowsingEnabled = true; - ok(importMenuItem.hasAttribute("disabled"), - "File->Import menu item should be disabled inside of the private browsing mode"); + "Import From Another Browser menu item should be disabled after starting PB mode"); // leave private browsing mode pb.privateBrowsingEnabled = false; - ok(!importMenuItem.hasAttribute("disabled"), - "File->Import menu item should not be disabled after leaving the private browsing mode"); + "Import From Another Browser menu item should not be disabled after leaving the PB mode"); + + win.close(); + + // launch the second test: open the Library with PB enabled + pb.privateBrowsingEnabled = true; + openLibrary(testPBon); +} + +function testPBon(win) { + let importMenuItem = win.document.getElementById("OrganizerCommand_browserImport"); + + // make sure the menu item is disabled in PB mode when opening the Library + ok(importMenuItem.hasAttribute("disabled"), + "Import From Another Browser menu item should be disabled in PB mode when opening the Libary"); + + // leave private browsing mode + pb.privateBrowsingEnabled = false; + ok(!importMenuItem.hasAttribute("disabled"), + "Import From Another Browser menu item should not be disabled after leaving PB mode"); + + win.close(); // cleanup gPrefService.clearUserPref("browser.privatebrowsing.keep_current_session"); + finish(); } diff --git a/browser/locales/en-US/chrome/browser/browser.dtd b/browser/locales/en-US/chrome/browser/browser.dtd index 5113eb777b0..4a61e6f9f53 100644 --- a/browser/locales/en-US/chrome/browser/browser.dtd +++ b/browser/locales/en-US/chrome/browser/browser.dtd @@ -57,8 +57,6 @@ can reach it easily. --> - - diff --git a/browser/locales/en-US/chrome/browser/places/places.dtd b/browser/locales/en-US/chrome/browser/places/places.dtd index 35e06c471cc..0c8b86faf8c 100644 --- a/browser/locales/en-US/chrome/browser/places/places.dtd +++ b/browser/locales/en-US/chrome/browser/places/places.dtd @@ -28,10 +28,12 @@ - - - - + + + + + + From cf8467b9e0eb554985081b53e8b446b1728f2d61 Mon Sep 17 00:00:00 2001 From: Raymond Lee Date: Fri, 24 Jun 2011 04:56:32 +0800 Subject: [PATCH 5/8] Bug 663838 - Intermittent TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/base/content/test/tabview/browser_tabview_launch.js | Test timed out r=ian --- .../test/tabview/browser_tabview_launch.js | 108 +++++++----------- 1 file changed, 41 insertions(+), 67 deletions(-) diff --git a/browser/base/content/test/tabview/browser_tabview_launch.js b/browser/base/content/test/tabview/browser_tabview_launch.js index 5084caead85..db4ff070bc9 100644 --- a/browser/base/content/test/tabview/browser_tabview_launch.js +++ b/browser/base/content/test/tabview/browser_tabview_launch.js @@ -1,83 +1,57 @@ /* Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ */ -let tabViewShownCount = 0; let timerId; +let newWin; // ---------- function test() { waitForExplicitFinish(); - // verify initial state - ok(!TabView.isVisible(), "Tab View starts hidden"); - // launch tab view for the first time - window.addEventListener("tabviewshown", onTabViewLoadedAndShown, false); - TabView.toggle(); + newWindowWithTabView(function() {}, function(win) { + newWin = win; + + let onSelect = function(event) { + if (deck != event.target) + return; + + let iframe = win.document.getElementById("tab-view"); + if (deck.selectedPanel != iframe) + return; + + deck.removeEventListener("select", onSelect, true); + + whenTabViewIsShown(function() { + executeSoon(function() { + testMethodToHideAndShowTabView(function() { + newWin.document.getElementById("menu_tabview").doCommand(); + }, function() { + testMethodToHideAndShowTabView(function() { + EventUtils.synthesizeKey("E", { accelKey: true, shiftKey: true }, newWin); + }, finish); + }); + }); + }, win); + }; + + let deck = win.document.getElementById("tab-view-deck"); + deck.addEventListener("select", onSelect, true); + }); registerCleanupFunction(function () { - window.removeEventListener("tabviewshown", onTabViewLoadedAndShown, false); - if (timerId) - clearTimeout(timerId); - TabView.hide() + newWin.close(); }); } -// ---------- -function onTabViewLoadedAndShown() { - window.removeEventListener("tabviewshown", onTabViewLoadedAndShown, false); - - // Evidently sometimes isVisible (which is based on the selectedIndex of the - // tabview deck) isn't updated immediately when called from button.doCommand, - // so we add a little timeout here to get outside of the doCommand call. - // If the initial timeout isn't enough, we keep waiting in case it's taking - // longer than expected. - // See bug 594909. - let deck = document.getElementById("tab-view-deck"); - let iframe = document.getElementById("tab-view"); - ok(iframe, "The tab view iframe exists"); - - function waitForSwitch() { - if (deck.selectedPanel == iframe) { - ok(TabView.isVisible(), "Tab View is visible. Count: " + tabViewShownCount); - tabViewShownCount++; - - // kick off the series - window.addEventListener("tabviewshown", onTabViewShown, false); - window.addEventListener("tabviewhidden", onTabViewHidden, false); - - registerCleanupFunction(function () { - window.removeEventListener("tabviewshown", onTabViewShown, false); - window.removeEventListener("tabviewhidden", onTabViewHidden, false); - }); - TabView.toggle(); - } else { - timerId = setTimeout(waitForSwitch, 10); - } - } - - timerId = setTimeout(waitForSwitch, 1); -} - -// ---------- -function onTabViewShown() { - // add the count to the message so we can track things more easily. - ok(TabView.isVisible(), "Tab View is visible. Count: " + tabViewShownCount); - tabViewShownCount++; - TabView.toggle(); -} - -// ---------- -function onTabViewHidden() { - ok(!TabView.isVisible(), "Tab View is hidden. Count: " + tabViewShownCount); - - if (tabViewShownCount == 1) { - document.getElementById("menu_tabview").doCommand(); - } else if (tabViewShownCount == 2) { - EventUtils.synthesizeKey("E", { accelKey: true, shiftKey: true }); - } else if (tabViewShownCount == 3) { - window.removeEventListener("tabviewshown", onTabViewShown, false); - window.removeEventListener("tabviewhidden", onTabViewHidden, false); - finish(); - } +function testMethodToHideAndShowTabView(executeFunc, callback) { + whenTabViewIsHidden(function() { + ok(!newWin.TabView.isVisible(), "Tab View is not visible after executing the function"); + whenTabViewIsShown(function() { + ok(newWin.TabView.isVisible(), "Tab View is visible after executing the function again"); + callback(); + }, newWin); + executeFunc(); + }, newWin); + executeFunc(); } From 882fbf9fad75af57fc86e875d87cba3912352f87 Mon Sep 17 00:00:00 2001 From: Tim Taubert Date: Mon, 27 Jun 2011 23:40:55 +0200 Subject: [PATCH 6/8] Bug 632293 - Why does GroupItem constructor add children before it sets its bounds? r=dietrich --- browser/base/content/tabview/groupitems.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/browser/base/content/tabview/groupitems.js b/browser/base/content/tabview/groupitems.js index bb910d2a64c..9d7bd8561f8 100644 --- a/browser/base/content/tabview/groupitems.js +++ b/browser/base/content/tabview/groupitems.js @@ -249,7 +249,11 @@ function GroupItem(listOfEls, options) { this._init($container[0]); // ___ Children - Array.prototype.forEach.call(listOfEls, function(el) { + // We explicitly set dontArrange=true to prevent the groupItem from + // re-arranging its children after a tabItem has been added. This saves us a + // group.arrange() call per child and therefore some tab.setBounds() calls. + options.dontArrange = true; + listOfEls.forEach(function (el) { self.add(el, options); }); From 5ddc8b75ed11232c758ed51d7d2111e1e54a1db9 Mon Sep 17 00:00:00 2001 From: Bas Schouten Date: Tue, 28 Jun 2011 02:10:06 +0200 Subject: [PATCH 7/8] Bug 667290: Properly clear the downsampled destination before blending to it. r=jrmuizel --- gfx/2d/DrawTargetD2D.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gfx/2d/DrawTargetD2D.cpp b/gfx/2d/DrawTargetD2D.cpp index 5d80061f4b4..dd34e0a85c0 100644 --- a/gfx/2d/DrawTargetD2D.cpp +++ b/gfx/2d/DrawTargetD2D.cpp @@ -446,6 +446,11 @@ DrawTargetD2D::DrawSurfaceWithShadow(SourceSurface *aSurface, mDevice->CreateRenderTargetView(tmpDSTexture, NULL, byRef(dsRTView)); mDevice->CreateShaderResourceView(tmpDSTexture, NULL, byRef(dsSRView)); + // We're not guaranteed the texture we created will be empty, we've + // seen old content at least on NVidia drivers. + float color[4] = { 0, 0, 0, 0 }; + mDevice->ClearRenderTargetView(dsRTView, color); + rtViews = dsRTView; mDevice->OMSetRenderTargets(1, &rtViews, NULL); From cc68d86e1fcf56bd31c7bb444745bd39a1c96839 Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Mon, 27 Jun 2011 20:57:35 -0400 Subject: [PATCH 8/8] Bug 667323: right clicking a video shouldn't trigger play/pause behavior, r=gavin --- toolkit/content/widgets/videocontrols.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/content/widgets/videocontrols.xml b/toolkit/content/widgets/videocontrols.xml index af23d23f2de..da9d9476533 100644 --- a/toolkit/content/widgets/videocontrols.xml +++ b/toolkit/content/widgets/videocontrols.xml @@ -943,7 +943,7 @@ var self = this; this.muteButton.addEventListener("command", function() { self.toggleMute(); }, false); this.playButton.addEventListener("command", function() { self.togglePause(); }, false); - this.controlsSpacer.addEventListener("click", function() { self.togglePause(); }, false); + this.controlsSpacer.addEventListener("click", function(e) { if (e.button == 0) { self.togglePause(); } }, false); if (!this.isAudioOnly) { this.muteButton.addEventListener("mouseover", function(e) { self.onVolumeMouseInOut(e); }, false); this.muteButton.addEventListener("mouseout", function(e) { self.onVolumeMouseInOut(e); }, false);