about:privatebrowsing legacy (non-Nova) newtab promos are invisible: hidden attribute not cleared, defeated by global [hidden] !important rule
Categories
(Firefox :: Private Browsing, defect)
Tracking
()
| 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 | ||
Updated•10 days ago
|
| Assignee | ||
Comment 1•10 days ago
|
||
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.
Comment 2•10 days ago
|
||
Set release status flags based on info from the regressing bug 2051196
Comment 4•5 days ago
|
||
| bugherder | ||
Description
•