Backed out changeset b3fcb4fcea64 (bug 1691274) for bc failures on browser_pointerlock_warning.js . CLOSED TREE

This commit is contained in:
Narcis Beleuzu 2021-02-13 21:46:51 +02:00
Родитель d5d9dcef4c
Коммит ed6880e281
26 изменённых файлов: 82 добавлений и 54 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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")

Просмотреть файл

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

Просмотреть файл

@ -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() {

Просмотреть файл

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

Просмотреть файл

@ -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) {

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -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

Просмотреть файл

@ -2948,7 +2948,7 @@
}
} else {
if (tab.hidden) {
tab.hidden = true;
tab.setAttribute("hidden", "true");
hiddenTabs.set(tab, tabData.extData && tabData.extData.hiddenBy);
}

Просмотреть файл

@ -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,

Просмотреть файл

@ -404,7 +404,7 @@ DownloadsViewUI.DownloadElementShell.prototype = {
},
hideButton() {
this._downloadButton.hidden = true;
this._downloadButton.setAttribute("hidden", "true");
},
lastEstimatedSecondsLeft: Infinity,

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -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) {

Просмотреть файл

@ -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

Просмотреть файл

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

Просмотреть файл

@ -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", () => {

Просмотреть файл

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

Просмотреть файл

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

Просмотреть файл

@ -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 {

Просмотреть файл

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

Просмотреть файл

@ -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]")) {

Просмотреть файл

@ -63,7 +63,7 @@ document.addEventListener("DOMContentLoaded", function() {
});
function hideSearchBanner() {
privateSearchBanner.hidden = true;
privateSearchBanner.setAttribute("hidden", "true");
document.body.classList.remove("showBanner");
RPMSendAsyncMessage("SearchBannerDismissed");
}