From ed6880e281d4004567baba4dbe4407f5b3996f52 Mon Sep 17 00:00:00 2001 From: Narcis Beleuzu Date: Sat, 13 Feb 2021 21:46:51 +0200 Subject: [PATCH] Backed out changeset b3fcb4fcea64 (bug 1691274) for bc failures on browser_pointerlock_warning.js . CLOSED TREE --- accessible/tests/browser/mac/doc_aria_tabs.html | 2 +- browser/actors/AboutReaderParent.jsm | 4 ++-- browser/base/content/aboutNetError.js | 4 +++- browser/base/content/blockedSite.js | 6 +++++- .../content/browser-fullScreenAndPointerLock.js | 6 +++--- browser/base/content/browser-places.js | 12 +++++++----- .../base/content/browser-sitePermissionPanel.js | 6 +++--- browser/base/content/browser-sync.js | 6 +++--- browser/base/content/browser.js | 8 +++++--- browser/base/content/nonbrowser-mac.js | 2 +- browser/base/content/nsContextMenu.js | 10 +++++++--- browser/base/content/tabbrowser.js | 2 +- .../browser_886323_buildArea_removable_nodes.js | 2 +- browser/components/downloads/DownloadsViewUI.jsm | 2 +- browser/components/downloads/content/indicator.js | 4 ++-- browser/components/fxmonitor/FirefoxMonitor.jsm | 2 +- browser/components/newtab/lib/CFRPageActions.jsm | 11 +++++++---- browser/components/newtab/lib/ToolbarBadgeHub.jsm | 2 +- browser/components/newtab/lib/ToolbarPanelHub.jsm | 4 ++-- .../newtab/test/unit/lib/ToolbarPanelHub.test.js | 8 ++++---- browser/components/places/content/places.js | 14 ++++++++++---- browser/components/pocket/content/SaveToPocket.jsm | 2 +- .../preferences/dialogs/sitePermissions.js | 4 ++-- browser/components/preferences/privacy.js | 4 ++-- browser/components/preferences/sync.js | 7 ++++++- .../content/aboutPrivateBrowsing.js | 2 +- 26 files changed, 82 insertions(+), 54 deletions(-) diff --git a/accessible/tests/browser/mac/doc_aria_tabs.html b/accessible/tests/browser/mac/doc_aria_tabs.html index 0c8f2afd6f74..9de6f8b81cd7 100644 --- a/accessible/tests/browser/mac/doc_aria_tabs.html +++ b/accessible/tests/browser/mac/doc_aria_tabs.html @@ -58,7 +58,7 @@ // Hide all tab panels grandparent .querySelectorAll('[role="tabpanel"]') - .forEach(p => (p.hidden = true)); + .forEach(p => p.setAttribute("hidden", true)); // Show the selected panel grandparent.parentNode diff --git a/browser/actors/AboutReaderParent.jsm b/browser/actors/AboutReaderParent.jsm index 8c01daf1df2d..6643631dba15 100644 --- a/browser/actors/AboutReaderParent.jsm +++ b/browser/actors/AboutReaderParent.jsm @@ -192,7 +192,7 @@ class AboutReaderParent extends JSWindowActorParent { button.setAttribute("aria-label", closeText); menuitem.setAttribute("label", closeText); - menuitem.hidden = false; + menuitem.setAttribute("hidden", false); menuitem.setAttribute( "accesskey", gStringBundle.GetStringFromName("readerView.close.accesskey") @@ -209,7 +209,7 @@ class AboutReaderParent extends JSWindowActorParent { button.setAttribute("aria-label", enterText); menuitem.setAttribute("label", enterText); - menuitem.hidden = !browser.isArticle; + menuitem.setAttribute("hidden", !browser.isArticle); menuitem.setAttribute( "accesskey", gStringBundle.GetStringFromName("readerView.enter.accesskey") diff --git a/browser/base/content/aboutNetError.js b/browser/base/content/aboutNetError.js index 9e6e77486918..376d9d9dea97 100644 --- a/browser/base/content/aboutNetError.js +++ b/browser/base/content/aboutNetError.js @@ -180,7 +180,9 @@ function disallowCertOverridesIfNeeded() { // host and the cert is bad (STS Spec section 7.3) or if the // certerror is in a frame (bug 633691). if (cssClass == "badStsCert" || window != top) { - document.getElementById("exceptionDialogButton").hidden = true; + document + .getElementById("exceptionDialogButton") + .setAttribute("hidden", "true"); } if (cssClass == "badStsCert") { document.getElementById("badStsCertExplanation").removeAttribute("hidden"); diff --git a/browser/base/content/blockedSite.js b/browser/base/content/blockedSite.js index dd2aa914fe70..9a1a9d85953c 100644 --- a/browser/base/content/blockedSite.js +++ b/browser/base/content/blockedSite.js @@ -63,7 +63,11 @@ function getHostString() { function onClickSeeDetails() { let details = document.getElementById("errorDescriptionContainer"); - details.hidden = !details.hidden; + if (details.hidden) { + details.removeAttribute("hidden"); + } else { + details.setAttribute("hidden", "true"); + } } function initPage() { diff --git a/browser/base/content/browser-fullScreenAndPointerLock.js b/browser/base/content/browser-fullScreenAndPointerLock.js index b46d295dde78..8cba66cfa96b 100644 --- a/browser/base/content/browser-fullScreenAndPointerLock.js +++ b/browser/base/content/browser-fullScreenAndPointerLock.js @@ -90,7 +90,7 @@ var PointerlockFsWarning = { ".pointerlockfswarning-domain-text" ); if (!host) { - textElem.hidden = true; + textElem.setAttribute("hidden", true); } else { textElem.removeAttribute("hidden"); // Document's principal's URI has a host. Display a warning including it. @@ -135,7 +135,7 @@ var PointerlockFsWarning = { this._element .querySelector(".pointerlockfswarning-domain-text") .removeAttribute("data-l10n-id"); - this._element.hidden = true; + this._element.setAttribute("hidden", true); // Remove all event listeners this._element.removeEventListener("transitionend", this); window.removeEventListener("mousemove", this, true); @@ -231,7 +231,7 @@ var PointerlockFsWarning = { } case "transitionend": { if (this._state == "hiding") { - this._element.hidden = true; + this._element.setAttribute("hidden", true); } break; } diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index 90de28c2c02a..81948ec12ffc 100644 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -691,9 +691,11 @@ HistoryMenu.prototype = { }, toggleHiddenTabs() { - const isShown = - window.gBrowser && gBrowser.visibleTabs.length < gBrowser.tabs.length; - this.hiddenTabsMenu.hidden = !isShown; + if (window.gBrowser && gBrowser.visibleTabs.length < gBrowser.tabs.length) { + this.hiddenTabsMenu.removeAttribute("hidden"); + } else { + this.hiddenTabsMenu.setAttribute("hidden", "true"); + } }, toggleRecentlyClosedTabs: function HM_toggleRecentlyClosedTabs() { @@ -784,11 +786,11 @@ HistoryMenu.prototype = { } if (!PlacesUIUtils.shouldShowTabsFromOtherComputersMenuitem()) { - this.syncTabsMenuitem.hidden = true; + this.syncTabsMenuitem.setAttribute("hidden", true); return; } - this.syncTabsMenuitem.hidden = false; + this.syncTabsMenuitem.setAttribute("hidden", false); }, _onPopupShowing: function HM__onPopupShowing(aEvent) { diff --git a/browser/base/content/browser-sitePermissionPanel.js b/browser/base/content/browser-sitePermissionPanel.js index c0086b664335..2b0504386d40 100644 --- a/browser/base/content/browser-sitePermissionPanel.js +++ b/browser/base/content/browser-sitePermissionPanel.js @@ -191,7 +191,7 @@ var gPermissionPanel = { this._initializePopup(); // Remove the reload hint that we show after a user has cleared a permission. - this._permissionReloadHint.hidden = true; + this._permissionReloadHint.setAttribute("hidden", "true"); // Update the popup strings this._refreshPermissionPopup(); @@ -363,7 +363,7 @@ var gPermissionPanel = { onLocationChange() { if (this._popupInitialized && this._permissionPopup.state != "closed") { - this._permissionReloadHint.hidden = true; + this._permissionReloadHint.setAttribute("hidden", "true"); } }, @@ -779,7 +779,7 @@ var gPermissionPanel = { browser ); - this._permissionReloadHint.hidden = false; + this._permissionReloadHint.removeAttribute("hidden"); PanelView.forNode( this._permissionPopupMainView ).descriptionHeightWorkaround(); diff --git a/browser/base/content/browser-sync.js b/browser/base/content/browser-sync.js index c939502eec48..3f5879fea8e2 100644 --- a/browser/base/content/browser-sync.js +++ b/browser/base/content/browser-sync.js @@ -502,10 +502,10 @@ var gSync = { fxaMenuPanel.removeAttribute("title"); cadButtonEl.setAttribute("disabled", true); - syncNowButtonEl.hidden = true; + syncNowButtonEl.setAttribute("hidden", true); fxaMenuAccountButtonEl.classList.remove("subviewbutton-nav"); fxaMenuAccountButtonEl.removeAttribute("closemenu"); - syncPrefsButtonEl.hidden = true; + syncPrefsButtonEl.setAttribute("hidden", true); syncSetupButtonEl.removeAttribute("hidden"); if (state.status === UIState.STATUS_NOT_CONFIGURED) { @@ -547,7 +547,7 @@ var gSync = { if (state.syncEnabled) { syncNowButtonEl.removeAttribute("hidden"); syncPrefsButtonEl.removeAttribute("hidden"); - syncSetupButtonEl.hidden = true; + syncSetupButtonEl.setAttribute("hidden", true); } fxaMenuAccountButtonEl.classList.add("subviewbutton-nav"); diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 4f03070cd747..45827fc203e0 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1181,7 +1181,7 @@ var gPopupBlockerObserver = { blockedPopupAllowSite.removeAttribute("block"); } } catch (e) { - blockedPopupAllowSite.hidden = true; + blockedPopupAllowSite.setAttribute("hidden", "true"); } if (PrivateBrowsingUtils.isWindowPrivate(window)) { @@ -1205,7 +1205,7 @@ var gPopupBlockerObserver = { let blockedPopupsSeparator = document.getElementById( "blockedPopupsSeparator" ); - blockedPopupsSeparator.hidden = true; + blockedPopupsSeparator.setAttribute("hidden", true); browser.popupBlocker.getBlockedPopups().then(blockedPopups => { let foundUsablePopupURI = false; @@ -8404,7 +8404,9 @@ var RestoreLastSessionObserver = { Services.obs.addObserver(this, "sessionstore-last-session-cleared", true); goSetCommandEnabled("Browser:RestoreLastSession", true); } else if (SessionStore.willAutoRestore) { - document.getElementById("Browser:RestoreLastSession").hidden = true; + document + .getElementById("Browser:RestoreLastSession") + .setAttribute("hidden", true); } }, diff --git a/browser/base/content/nonbrowser-mac.js b/browser/base/content/nonbrowser-mac.js index 387b5ab52c98..c49aa779332a 100644 --- a/browser/base/content/nonbrowser-mac.js +++ b/browser/base/content/nonbrowser-mac.js @@ -85,7 +85,7 @@ function nonBrowserWindowStartup() { // Also hide the window-list separator. element = document.getElementById("sep-window-list"); - element.hidden = true; + element.setAttribute("hidden", "true"); // Setup the dock menu. let dockMenuElement = document.getElementById("menu_mac_dockmenu"); diff --git a/browser/base/content/nsContextMenu.js b/browser/base/content/nsContextMenu.js index e72bf7b667cf..158b50fa1d4d 100644 --- a/browser/base/content/nsContextMenu.js +++ b/browser/base/content/nsContextMenu.js @@ -719,9 +719,13 @@ class nsContextMenu { // Hide menu entries for images, show otherwise if (this.inFrame) { - this.viewFrameSourceElement.hidden = !BrowserUtils.mimeTypeIsTextBased( - this.target.ownerDocument.contentType - ); + if ( + BrowserUtils.mimeTypeIsTextBased(this.target.ownerDocument.contentType) + ) { + this.viewFrameSourceElement.removeAttribute("hidden"); + } else { + this.viewFrameSourceElement.setAttribute("hidden", "true"); + } } // BiDi UI diff --git a/browser/base/content/tabbrowser.js b/browser/base/content/tabbrowser.js index 2a882cae23dd..930c14ceea86 100644 --- a/browser/base/content/tabbrowser.js +++ b/browser/base/content/tabbrowser.js @@ -2948,7 +2948,7 @@ } } else { if (tab.hidden) { - tab.hidden = true; + tab.setAttribute("hidden", "true"); hiddenTabs.set(tab, tabData.extData && tabData.extData.hiddenBy); } diff --git a/browser/components/customizableui/test/browser_886323_buildArea_removable_nodes.js b/browser/components/customizableui/test/browser_886323_buildArea_removable_nodes.js index f7b3f417fafd..b3c55b787ef2 100644 --- a/browser/components/customizableui/test/browser_886323_buildArea_removable_nodes.js +++ b/browser/components/customizableui/test/browser_886323_buildArea_removable_nodes.js @@ -18,7 +18,7 @@ add_task(async function() { let popupSet = document.getElementById("mainPopupSet"); gLazyArea = document.createXULElement("panel"); gLazyArea.id = kLazyAreaId; - gLazyArea.hidden = true; + gLazyArea.setAttribute("hidden", "true"); popupSet.appendChild(gLazyArea); CustomizableUI.registerArea(kLazyAreaId, { type: CustomizableUI.TYPE_MENU_PANEL, diff --git a/browser/components/downloads/DownloadsViewUI.jsm b/browser/components/downloads/DownloadsViewUI.jsm index e157b562fa62..9b3f7afb10e2 100644 --- a/browser/components/downloads/DownloadsViewUI.jsm +++ b/browser/components/downloads/DownloadsViewUI.jsm @@ -404,7 +404,7 @@ DownloadsViewUI.DownloadElementShell.prototype = { }, hideButton() { - this._downloadButton.hidden = true; + this._downloadButton.setAttribute("hidden", "true"); }, lastEstimatedSecondsLeft: Infinity, diff --git a/browser/components/downloads/content/indicator.js b/browser/components/downloads/content/indicator.js index bcc66c28a0e2..30c8027906b4 100644 --- a/browser/components/downloads/content/indicator.js +++ b/browser/components/downloads/content/indicator.js @@ -154,7 +154,7 @@ const DownloadsButton = { let button = this._placeholder; if (this.autoHideDownloadsButton && button && button.closest("toolbar")) { DownloadsPanel.hidePanel(); - button.hidden = true; + button.setAttribute("hidden", "true"); this._navBar.removeAttribute("downloadsbuttonshown"); } }, @@ -450,7 +450,7 @@ const DownloadsIndicatorView = { setTimeout(() => { requestAnimationFrame(() => { - notifier.hidden = true; + notifier.setAttribute("hidden", "true"); notifier.removeAttribute("notification"); notifier.style.transform = ""; anchor.removeAttribute("notification"); diff --git a/browser/components/fxmonitor/FirefoxMonitor.jsm b/browser/components/fxmonitor/FirefoxMonitor.jsm index b44d0cca9e17..a8f4ac98b7a7 100644 --- a/browser/components/fxmonitor/FirefoxMonitor.jsm +++ b/browser/components/fxmonitor/FirefoxMonitor.jsm @@ -368,7 +368,7 @@ this.FirefoxMonitor = { pnContent.appendChild(panelUI.box); pn.appendChild(pnContent); pn.setAttribute("id", `${this.kNotificationID}-notification`); - pn.hidden = true; + pn.setAttribute("hidden", "true"); parentElt.appendChild(pn); this.panelUIsByWindow.set(win, panelUI); return panelUI; diff --git a/browser/components/newtab/lib/CFRPageActions.jsm b/browser/components/newtab/lib/CFRPageActions.jsm index 43780771e889..52901dc3e730 100644 --- a/browser/components/newtab/lib/CFRPageActions.jsm +++ b/browser/components/newtab/lib/CFRPageActions.jsm @@ -420,16 +420,19 @@ class PageAction { args: { total: users }, }) ); - footerUsers.hidden = false; + footerUsers.removeAttribute("hidden"); } else { // Prevent whitespace around empty label from affecting other spacing - footerUsers.hidden = true; + footerUsers.setAttribute("hidden", true); footerUsers.removeAttribute("value"); } // Spacer pushes the link to the opposite end when there's other content - - footerSpacer.hidden = !rating && !users; + if (rating || users) { + footerSpacer.removeAttribute("hidden"); + } else { + footerSpacer.setAttribute("hidden", true); + } } _createElementAndAppend({ type, id }, parent) { diff --git a/browser/components/newtab/lib/ToolbarBadgeHub.jsm b/browser/components/newtab/lib/ToolbarBadgeHub.jsm index eb1407c29dfb..4914d941f528 100644 --- a/browser/components/newtab/lib/ToolbarBadgeHub.jsm +++ b/browser/components/newtab/lib/ToolbarBadgeHub.jsm @@ -189,7 +189,7 @@ class _ToolbarBadgeHub { "id", "toolbarbutton-notification-description" ); - descriptionEl.hidden = true; + descriptionEl.setAttribute("hidden", true); document.l10n.setAttributes( descriptionEl, message.content.badgeDescription.string_id diff --git a/browser/components/newtab/lib/ToolbarPanelHub.jsm b/browser/components/newtab/lib/ToolbarPanelHub.jsm index 47ced8308b29..06d27ed09058 100644 --- a/browser/components/newtab/lib/ToolbarPanelHub.jsm +++ b/browser/components/newtab/lib/ToolbarPanelHub.jsm @@ -502,13 +502,13 @@ class _ToolbarPanelHub { _showElement(document, id, string_id) { const el = PanelMultiView.getViewNode(document, id); document.l10n.setAttributes(el, string_id); - el.hidden = false; + el.removeAttribute("hidden"); } _hideElement(document, id) { const el = PanelMultiView.getViewNode(document, id); if (el) { - el.hidden = true; + el.setAttribute("hidden", true); } } diff --git a/browser/components/newtab/test/unit/lib/ToolbarPanelHub.test.js b/browser/components/newtab/test/unit/lib/ToolbarPanelHub.test.js index 75403346eedf..b614716efa35 100644 --- a/browser/components/newtab/test/unit/lib/ToolbarPanelHub.test.js +++ b/browser/components/newtab/test/unit/lib/ToolbarPanelHub.test.js @@ -314,11 +314,11 @@ describe("ToolbarPanelHub", () => { it("should unhide appmenu button on _showAppmenuButton()", async () => { await instance._showAppmenuButton(fakeWindow); - assert.equal(fakeElementById.hidden, false); + assert.calledWith(fakeElementById.removeAttribute, "hidden"); }); it("should hide appmenu button on _hideAppmenuButton()", () => { instance._hideAppmenuButton(fakeWindow); - assert.equal(fakeElementById.hidden, true); + assert.calledWith(fakeElementById.setAttribute, "hidden", true); }); it("should not do anything if the window is closed", () => { instance._hideAppmenuButton(fakeWindow, true); @@ -334,11 +334,11 @@ describe("ToolbarPanelHub", () => { it("should unhide toolbar button on _showToolbarButton()", async () => { await instance._showToolbarButton(fakeWindow); - assert.equal(fakeElementById.hidden, false); + assert.calledWith(fakeElementById.removeAttribute, "hidden"); }); it("should hide toolbar button on _hideToolbarButton()", () => { instance._hideToolbarButton(fakeWindow); - assert.equal(fakeElementById.hidden, true); + assert.calledWith(fakeElementById.setAttribute, "hidden", true); }); }); describe("#renderMessages", () => { diff --git a/browser/components/places/content/places.js b/browser/components/places/content/places.js index 205c1feec106..5ac14a95a7b3 100644 --- a/browser/components/places/content/places.js +++ b/browser/components/places/content/places.js @@ -1195,10 +1195,16 @@ var ViewMenu = { splitter = null; } - const isChecked = element.getAttribute("checked") == "true"; - column.hidden = !isChecked; - if (splitter) { - splitter.hidden = !isChecked; + if (element.getAttribute("checked") == "true") { + column.setAttribute("hidden", "false"); + if (splitter) { + splitter.removeAttribute("hidden"); + } + } else { + column.setAttribute("hidden", "true"); + if (splitter) { + splitter.setAttribute("hidden", "true"); + } } }, diff --git a/browser/components/pocket/content/SaveToPocket.jsm b/browser/components/pocket/content/SaveToPocket.jsm index 21209d19a514..09e4aed67019 100644 --- a/browser/components/pocket/content/SaveToPocket.jsm +++ b/browser/components/pocket/content/SaveToPocket.jsm @@ -179,7 +179,7 @@ var PocketPageAction = { for (let win of browserWindows()) { let doc = win.document; let pocketButton = doc.getElementById("pocket-button"); - pocketButton.hidden = true; + pocketButton.setAttribute("hidden", "true"); } this.pageAction.remove(); diff --git a/browser/components/preferences/dialogs/sitePermissions.js b/browser/components/preferences/dialogs/sitePermissions.js index 019ca0510ac4..051329687f0f 100644 --- a/browser/components/preferences/dialogs/sitePermissions.js +++ b/browser/components/preferences/dialogs/sitePermissions.js @@ -228,8 +228,8 @@ var gSitePermissionsManager = { } if (this._currentDefaultPermissionsState === null) { - this._checkbox.hidden = true; - this._permissionsDisableDescription.hidden = true; + this._checkbox.setAttribute("hidden", true); + this._permissionsDisableDescription.setAttribute("hidden", true); } else if (this._currentDefaultPermissionsState == SitePermissions.BLOCK) { this._checkbox.checked = true; } else { diff --git a/browser/components/preferences/privacy.js b/browser/components/preferences/privacy.js index 87006eea83e3..3aaa2bbeb499 100644 --- a/browser/components/preferences/privacy.js +++ b/browser/components/preferences/privacy.js @@ -1478,7 +1478,7 @@ var gPrivacyPane = { this._updateSanitizeSettingsButton(); } } else { - clearDataSettings.hidden = true; + clearDataSettings.setAttribute("hidden", "true"); } }, @@ -2423,7 +2423,7 @@ var gPrivacyPane = { if (url) { el.setAttribute("href", url); } else { - el.hidden = true; + el.setAttribute("hidden", "true"); } }, diff --git a/browser/components/preferences/sync.js b/browser/components/preferences/sync.js index 4a816a73eb19..1bbff20c829f 100644 --- a/browser/components/preferences/sync.js +++ b/browser/components/preferences/sync.js @@ -587,7 +587,12 @@ var gSyncPane = { // preferences used for this engines. setupEnginesUI() { let observe = (elt, prefName) => { - elt.hidden = !Services.prefs.getBoolPref(prefName, false); + let enabled = Services.prefs.getBoolPref(prefName, false); + if (enabled) { + elt.removeAttribute("hidden"); + } else { + elt.setAttribute("hidden", "true"); + } }; for (let elt of document.querySelectorAll("[engine_preference]")) { diff --git a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js index b16077beb846..5d9b78b90217 100644 --- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js +++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js @@ -63,7 +63,7 @@ document.addEventListener("DOMContentLoaded", function() { }); function hideSearchBanner() { - privateSearchBanner.hidden = true; + privateSearchBanner.setAttribute("hidden", "true"); document.body.classList.remove("showBanner"); RPMSendAsyncMessage("SearchBannerDismissed"); }