diff --git a/browser/base/content/browser-customization.js b/browser/base/content/browser-customization.js index f00812a9af55..5867564e4943 100644 --- a/browser/base/content/browser-customization.js +++ b/browser/base/content/browser-customization.js @@ -17,9 +17,6 @@ var CustomizationHandler = { case "customizationstarting": this._customizationStarting(); break; - case "customizationchange": - this._customizationChange(); - break; case "customizationending": this._customizationEnding(aEvent.detail); break; @@ -54,10 +51,6 @@ var CustomizationHandler = { } }, - _customizationChange() { - PlacesToolbarHelper.customizeChange(); - }, - _customizationEnding(aDetails) { // Update global UI elements that may have been added or removed if (aDetails.changed) { diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index 4e750bc53fff..db73290604a1 100644 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -1195,8 +1195,6 @@ var PlacesToolbarHelper = { if (forceToolbarOverflowCheck) { viewElt._placesView.updateOverflowStatus(); } - this._shouldWrap = false; - this._setupPlaceholder(); }, uninit: function PTH_uninit() { @@ -1211,28 +1209,6 @@ var PlacesToolbarHelper = { } finally { this._isCustomizing = true; } - this._shouldWrap = this._getShouldWrap(); - }, - - customizeChange: function PTH_customizeChange() { - this._setupPlaceholder(); - }, - - _setupPlaceholder: function PTH_setupPlaceholder() { - let placeholder = this._placeholder; - if (!placeholder) { - return; - } - - let shouldWrapNow = this._getShouldWrap(); - if (this._shouldWrap != shouldWrapNow) { - if (shouldWrapNow) { - placeholder.setAttribute("wrap", "true"); - } else { - placeholder.removeAttribute("wrap"); - } - this._shouldWrap = shouldWrapNow; - } }, customizeDone: function PTH_customizeDone() { @@ -1240,13 +1216,6 @@ var PlacesToolbarHelper = { this.init(true); }, - _getShouldWrap: function PTH_getShouldWrap() { - let placement = CustomizableUI.getPlacementOfWidget("personal-bookmarks"); - let area = placement && placement.area; - let areaType = area && CustomizableUI.getAreaType(area); - return !area || CustomizableUI.TYPE_MENU_PANEL == areaType; - }, - onPlaceholderCommand() { let widgetGroup = CustomizableUI.getWidget("personal-bookmarks"); let widget = widgetGroup.forWindow(window); diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index fac7c4c6298b..66fbb70e821e 100755 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1711,7 +1711,6 @@ var gBrowserInit = { window.addEventListener("dragover", MousePosTracker); gNavToolbox.addEventListener("customizationstarting", CustomizationHandler); - gNavToolbox.addEventListener("customizationchange", CustomizationHandler); gNavToolbox.addEventListener("customizationending", CustomizationHandler); // End startup crash tracking after a delay to catch crashes while restoring diff --git a/browser/components/customizableui/content/panelUI.js b/browser/components/customizableui/content/panelUI.js index f7b05715c6ff..661af2d3d944 100644 --- a/browser/components/customizableui/content/panelUI.js +++ b/browser/components/customizableui/content/panelUI.js @@ -257,12 +257,6 @@ const PanelUI = { return; } - let personalBookmarksPlacement = CustomizableUI.getPlacementOfWidget("personal-bookmarks"); - if (personalBookmarksPlacement && - personalBookmarksPlacement.area == CustomizableUI.AREA_PANEL) { - PlacesToolbarHelper.customizeChange(); - } - let anchor; let domEvent = null; if (!aEvent || diff --git a/browser/components/customizableui/test/browser.ini b/browser/components/customizableui/test/browser.ini index d5f5eaf2a113..e81e772f9373 100644 --- a/browser/components/customizableui/test/browser.ini +++ b/browser/components/customizableui/test/browser.ini @@ -101,8 +101,6 @@ skip-if = os == "linux" # Intermittent failures [browser_963639_customizing_attribute_non_customizable_toolbar.js] [browser_967000_button_charEncoding.js] [browser_967000_button_feeds.js] -[browser_968447_bookmarks_toolbar_items_in_panel.js] -skip-if = os == "linux" # Intemittent failures - bug 979207 [browser_968565_insert_before_hidden_items.js] [browser_969427_recreate_destroyed_widget_after_reset.js] [browser_969661_character_encoding_navbar_disabled.js] diff --git a/browser/components/customizableui/test/browser_968447_bookmarks_toolbar_items_in_panel.js b/browser/components/customizableui/test/browser_968447_bookmarks_toolbar_items_in_panel.js deleted file mode 100644 index 85c5470b95f7..000000000000 --- a/browser/components/customizableui/test/browser_968447_bookmarks_toolbar_items_in_panel.js +++ /dev/null @@ -1,66 +0,0 @@ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -"use strict"; - -// Bug 968447 - The Bookmarks Toolbar Items doesn't appear as a -// normal menu panel button in new windows. -add_task(async function() { - await SpecialPowers.pushPrefEnv({set: [["browser.photon.structure.enabled", false]]}); - const buttonId = "bookmarks-toolbar-placeholder"; - await startCustomizing(); - CustomizableUI.addWidgetToArea("personal-bookmarks", CustomizableUI.AREA_PANEL); - await endCustomizing(); - - await PanelUI.show(); - - let bookmarksToolbarPlaceholder = document.getElementById(buttonId); - ok(bookmarksToolbarPlaceholder.classList.contains("toolbarbutton-1"), - "Button should have toolbarbutton-1 class"); - is(bookmarksToolbarPlaceholder.getAttribute("wrap"), "true", - "Button should have the 'wrap' attribute"); - - info("Waiting for panel to close"); - let panelHiddenPromise = promisePanelHidden(window); - PanelUI.hide(); - await panelHiddenPromise; - - info("Waiting for window to open"); - let newWin = await openAndLoadWindow({}, true); - - info("Waiting for panel in new window to open"); - let hideTrace = function() { - info(new Error().stack); - info("Panel was hidden."); - }; - newWin.PanelUI.panel.addEventListener("popuphidden", hideTrace); - - await newWin.PanelUI.show(); - let newWinBookmarksToolbarPlaceholder = newWin.document.getElementById(buttonId); - ok(newWinBookmarksToolbarPlaceholder.classList.contains("toolbarbutton-1"), - "Button in new window should have toolbarbutton-1 class"); - is(newWinBookmarksToolbarPlaceholder.getAttribute("wrap"), "true", - "Button in new window should have 'wrap' attribute"); - - newWin.PanelUI.panel.removeEventListener("popuphidden", hideTrace); - // XXXgijs on Linux, we're sometimes seeing the panel being hidden early - // in the newly created window, probably because something else steals focus. - if (newWin.PanelUI.panel.state != "closed") { - info("Panel is still open in new window, waiting for it to close"); - panelHiddenPromise = promisePanelHidden(newWin); - newWin.PanelUI.hide(); - await panelHiddenPromise; - } else { - info("panel was already closed"); - } - - info("Waiting for new window to close"); - await promiseWindowClosed(newWin); -}); - -add_task(async function asyncCleanUp() { - await endCustomizing(); - CustomizableUI.reset(); -}); - diff --git a/browser/components/customizableui/test/head.js b/browser/components/customizableui/test/head.js index eaa03b302491..ec6a5b3f5194 100644 --- a/browser/components/customizableui/test/head.js +++ b/browser/components/customizableui/test/head.js @@ -305,7 +305,7 @@ function promisePanelHidden(win) { } function promiseOverflowHidden(win) { - let panelEl = document.getElementById("widget-overflow"); + let panelEl = win.PanelUI.overflowPanel; return promisePanelElementHidden(win, panelEl); }