From 36960fb87f6f631055d35693c496a98d3f327e32 Mon Sep 17 00:00:00 2001 From: Tim Nguyen Date: Tue, 9 Feb 2021 15:40:06 +0000 Subject: [PATCH] Bug 1691315 - Replace .setAttribute("hidden", X) usages in devtools/startup. r=nchevobbe Differential Revision: https://phabricator.services.mozilla.com/D104338 --- devtools/startup/DevToolsStartup.jsm | 6 ++---- devtools/startup/aboutdevtools/aboutdevtools.css | 6 +----- devtools/startup/aboutdevtools/aboutdevtools.js | 11 ++--------- devtools/startup/aboutdevtools/aboutdevtools.xhtml | 16 ++++++++-------- 4 files changed, 13 insertions(+), 26 deletions(-) diff --git a/devtools/startup/DevToolsStartup.jsm b/devtools/startup/DevToolsStartup.jsm index 2c0525c04153..edc33c403259 100644 --- a/devtools/startup/DevToolsStartup.jsm +++ b/devtools/startup/DevToolsStartup.jsm @@ -479,14 +479,12 @@ DevToolsStartup.prototype = { removeDevToolsMenus(window) { // This will hide the "Tools > Web Developer" menu. - window.document - .getElementById("webDeveloperMenu") - .setAttribute("hidden", "true"); + window.document.getElementById("webDeveloperMenu").hidden = true; // This will hide the "Web Developer" item in the hamburger menu. PanelMultiView.getViewNode( window.document, "appMenu-developer-button" - ).setAttribute("hidden", "true"); + ).hidden = true; }, onFirstWindowReady(window) { diff --git a/devtools/startup/aboutdevtools/aboutdevtools.css b/devtools/startup/aboutdevtools/aboutdevtools.css index e054b7566faf..ec38cb3d5080 100644 --- a/devtools/startup/aboutdevtools/aboutdevtools.css +++ b/devtools/startup/aboutdevtools/aboutdevtools.css @@ -30,7 +30,7 @@ p { margin-right: calc(100% - 100vw); } -.wrapper { +.wrapper:not([hidden]) { display: flex; flex-direction: column; align-items: center; @@ -146,10 +146,6 @@ button::-moz-focus-inner { border: 0; } -[hidden="true"] { - display: none; -} - footer { display: flex; align-items: center; diff --git a/devtools/startup/aboutdevtools/aboutdevtools.js b/devtools/startup/aboutdevtools/aboutdevtools.js index 9eac3966757f..226310dd62b1 100644 --- a/devtools/startup/aboutdevtools/aboutdevtools.js +++ b/devtools/startup/aboutdevtools/aboutdevtools.js @@ -48,16 +48,9 @@ function onCloseButtonClick() { } function updatePage() { - const installPage = document.getElementById("install-page"); - const welcomePage = document.getElementById("welcome-page"); const isEnabled = Services.prefs.getBoolPref("devtools.enabled"); - if (isEnabled) { - installPage.setAttribute("hidden", "true"); - welcomePage.removeAttribute("hidden"); - } else { - welcomePage.setAttribute("hidden", "true"); - installPage.removeAttribute("hidden"); - } + document.getElementById("install-page").hidden = isEnabled; + document.getElementById("welcome-page").hidden = !isEnabled; } /** diff --git a/devtools/startup/aboutdevtools/aboutdevtools.xhtml b/devtools/startup/aboutdevtools/aboutdevtools.xhtml index 5b0709e9a57a..881870e49d71 100644 --- a/devtools/startup/aboutdevtools/aboutdevtools.xhtml +++ b/devtools/startup/aboutdevtools/aboutdevtools.xhtml @@ -20,19 +20,19 @@ -