From bfb302ba9e4331217bafd6f6c807e8d8715f75a6 Mon Sep 17 00:00:00 2001 From: Soeren Hentzschel Date: Wed, 5 Sep 2018 09:28:17 +0000 Subject: [PATCH] Bug 1486915 - Use the "hidden" attribute instead of a "hide" class in aboutPrivateBrowsing.js r=johannh Differential Revision: https://phabricator.services.mozilla.com/D4821 --HG-- extra : moz-landing-system : lando --- .../content/aboutPrivateBrowsing.css | 4 ---- .../content/aboutPrivateBrowsing.js | 14 +++++++------- .../content/aboutPrivateBrowsing.xhtml | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.css b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.css index 29d7a843d76d..4267813ccb6a 100644 --- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.css +++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.css @@ -4,7 +4,3 @@ body[tpEnabled] .showTpDisabled, body:not([tpEnabled]) .showTpEnabled { display: none !important; } - -.hide { - display: none; -} diff --git a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js index 68349a2bdc1a..bfd3c4c2af22 100644 --- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js +++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.js @@ -24,11 +24,11 @@ function updateTPInfo() { let tpDescription = document.getElementById("tpDescription"); let cbDescription = document.getElementById("cbDescription"); - tpTitle.classList.toggle("hide", contentBlockingUIEnabled); - tpDescription.classList.toggle("hide", contentBlockingUIEnabled); + tpTitle.toggleAttribute("hidden", contentBlockingUIEnabled); + tpDescription.toggleAttribute("hidden", contentBlockingUIEnabled); - cbTitle.classList.toggle("hide", !contentBlockingUIEnabled); - cbDescription.classList.toggle("hide", !contentBlockingUIEnabled); + cbTitle.toggleAttribute("hidden", !contentBlockingUIEnabled); + cbDescription.toggleAttribute("hidden", !contentBlockingUIEnabled); let globalTrackingEnabled = RPMGetBoolPref(TP_ENABLED_PREF); let trackingEnabled = globalTrackingEnabled || RPMGetBoolPref(TP_PB_ENABLED_PREF); @@ -37,13 +37,13 @@ function updateTPInfo() { let contentBlockingEnabled = RPMGetBoolPref(CB_ENABLED_PREF); trackingEnabled = trackingEnabled && contentBlockingEnabled; } else { - title.classList.toggle("hide", trackingEnabled); - titleTracking.classList.toggle("hide", !trackingEnabled); + title.toggleAttribute("hidden", trackingEnabled); + titleTracking.toggleAttribute("hidden", !trackingEnabled); } // if tracking protection is enabled globally we don't even give the user // a choice here by hiding the toggle completely. - tpButton.classList.toggle("hide", globalTrackingEnabled); + tpButton.toggleAttribute("hidden", globalTrackingEnabled); tpToggle.checked = trackingEnabled; tpSubHeader.classList.toggle("tp-off", !trackingEnabled); diff --git a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml index 5d37e9ad3727..2ef8bf4329b2 100644 --- a/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml +++ b/browser/components/privatebrowsing/content/aboutPrivateBrowsing.xhtml @@ -34,7 +34,7 @@

&privateBrowsing.title; - &privateBrowsing.title.tracking; +

&aboutPrivateBrowsing.info.notsaved.before;&aboutPrivateBrowsing.info.notsaved.emphasize;&aboutPrivateBrowsing.info.notsaved.after;