Closed Bug 2098422 Opened 6 days ago Closed 2 days ago

New Window (Ctrl+N) from a Private Browsing Window creates a window with dark-mode theme regardless of settings

Categories

(Firefox :: Theme, defect)

Firefox 161
defect

Tracking

()

VERIFIED FIXED
163 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr153 --- unaffected
firefox161 --- wontfix
firefox162 --- verified
firefox163 --- verified

People

(Reporter: danweiss, Assigned: emilio)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 2 external files)

Attached image 2 - new window.png —

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:161.0) Gecko/20100101 Firefox/161.0

Steps to reproduce

Make sure Firefox's theme is not set to Dark Mode. (Settings -> Appearance -> Browser Theme)
Open a private browsing window (Ctrl+Shift+P)
While the private browsing window is active, open a New window (Ctrl+N)

Actual results

Firefox opened a window with the Dark Mode theme applied, even when the main window does not use that theme. For people who do not use Dark Mode as their main theme, this can appear confusingly similar to a private browsing window, and can mislead people.

Problem also seen in Firefox Nightly as well.

Expected results

Firefox should have opened a window matching the default theme.

The Bugbug bot thinks this bug should belong to the 'Firefox::Theme' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Theme

Claude investigation

confirmed as b731bc2cd303, Bug 2087393. I checked the diff myself:
BrowsingContext::SetOpener now copies the color scheme from the opener's document (GetOverriddenOrEmbedderColorScheme()), and a dark private window's scheme is "dark".
The patch removed the line in LightweightThemeConsumer._update that used to reset the new window's override to "none". Nothing else writes it now, so the inherited "dark" sticks.
Ctrl+N passes the private window as the opener (OpenBrowserWindow, then options.openerWindow ??= window). It should reproduce with the default System theme on a light OS.
Fix direction: reset prefersColorSchemeOverride = "none" for top-level windows in _update.

:emilio, since you are the author of the regressor, bug 2087393, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Assignee: nobody → emilio
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Duplicate of this bug: 2098373
Pushed by ealvarez@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/ef0aa0e454c5 https://hg.mozilla.org/integration/autoland/rev/abdf22059779 Reset opener color-scheme override from theming code. r=desktop-theme-reviewers,dao
Status: ASSIGNED → RESOLVED
Closed: 2 days ago
Resolution: --- → FIXED
Target Milestone: --- → 163 Branch

The patch landed in nightly and beta is affected.

:emilio, please make an uplift decision for beta:

  • For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set status-firefox162 to wontfix if the fix can wait for the next release.

The bugbug regressor model rates the patch as high risk: about 15% of the patches with this rating cause a regression. Unless the fix is important for this release, consider letting it ride the trains.

Uplift requests can be submitted from Lando: D346958.

See Requesting an Uplift for documentation on how to request an uplift.

For more information, please visit BugBot documentation.

Flags: needinfo?(emilio)

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: regression fix
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: yes
  • Steps to reproduce for manual QE testing: comment 0
  • Risk associated with taking this patch: low
  • Explanation of risk level: one-liner
  • String changes made/needed?: none
  • Is Android affected?: no
Attachment #9693877 - Flags: approval-mozilla-beta?
Flags: qe-verify+
Flags: needinfo?(emilio)
Attachment #9693877 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
QA Whiteboard: [uplift][qa-ver-needed-c163/b162]

Reproduced the initial issue on Firefox 161.0.1 on Windows 11 - a new window opened from a private window uses the Dark theme, even when the initial normal window uses the Light theme.

Verified as fixed using Firefox 162 and the latest Nightly 163.0a1 on Windows 11, macOS 26 and Ubuntu 24.04 - the new window opened from a private window now matches the theme of the initial normal window.

Status: RESOLVED → VERIFIED
QA Whiteboard: [uplift][qa-ver-needed-c163/b162] → [uplift][qa-ver-done-c163/b162]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: