Closed Bug 2054149 Opened 10 days ago Closed 5 days ago

about:privatebrowsing legacy (non-Nova) newtab promos are invisible: hidden attribute not cleared, defeated by global [hidden] !important rule

Categories

(Firefox :: Private Browsing, defect)

defect

Tracking

()

RESOLVED FIXED
154 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox152 --- unaffected
firefox153 --- unaffected
firefox154 --- fixed

People

(Reporter: emz, Assigned: emz)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

With browser.nova.enabled set to false (the current default), the legacy private-browsing newtab promos (Focus/Klar/VPN/Pin/cookie-banner) no longer render, either naturally or when forced via ASRouter devtools. The Nova promo layout (browser.nova.enabled=true) is unaffected.

Root cause

renderLegacyPromo in browser/components/privatebrowsing/content/aboutPrivateBrowsing.js reveals the promo by adding the .promo-visible class (display: flex) but never removes the hidden attribute on the .promo container. This relied on [hidden] being a low-priority presentation attribute that any author display rule overrides.

Bug 2051196 subsequently added a global :where([hidden]) { display: none !important } rule to the base stylesheets (global-shared.css / in-content/common-shared.css). The !important now outweighs .promo-visible, so the fully-populated legacy promo stays display: none !important. The Nova path is unaffected because renderNovaPromo explicitly sets container.hidden = false.

Confirmed in a private window: ASRouter returns a valid message (promoEnabled: true, valid action), renderPromo runs to completion and adds .promo-visible, but the container computes display: none; removing the hidden attribute restores display: flex.

Fix

Clear the hidden attribute in renderLegacyPromo when revealing the promo, mirroring renderNovaPromo.

Test gap

The existing legacy-path tests (test_default_promo, test_nova_disabled_uses_legacy_promo) pass with and without the regression because they only assert the static .promo container exists in the DOM, never that it is visible. Coverage should assert visibility (e.g. ContentTaskUtils.isVisible).

Assignee: nobody → emz
Status: NEW → ASSIGNED

renderLegacyPromo revealed the promo by adding the .promo-visible class but
never removed the container's hidden attribute. This relied on [hidden] being a
low-priority presentation attribute that any author display rule overrode.

Bug 2051196 added a global :where([hidden]) { display: none !important } rule to
the base stylesheets, so [hidden] now wins over .promo-visible and the
fully-rendered legacy promo stays display: none. The Nova path was unaffected
because renderNovaPromo already sets container.hidden = false.

Clear the hidden attribute when revealing the legacy promo, mirroring the Nova
path, and extend the legacy-path tests to assert the promo is actually visible
rather than only present in the DOM.

Set release status flags based on info from the regressing bug 2051196

Pushed by ezuehlcke@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/9b64fb055dc2 https://hg.mozilla.org/integration/autoland/rev/3399e6979323 Clear the hidden attribute when showing the legacy private browsing newtab promo. r=desktop-theme-reviewers,dao
Status: ASSIGNED → RESOLVED
Closed: 5 days ago
Resolution: --- → FIXED
Target Milestone: --- → 154 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: