Windows opened from dark PBM windows should inherit dark theme
Categories
(Firefox :: Theme, enhancement)
Tracking
()
Tracking | Status | |
---|---|---|
firefox98 | --- | fixed |
People
(Reporter: pbz, Assigned: pbz)
References
Details
(Whiteboard: [fxatps-privacy-segmentation])
Attachments
(3 files, 1 obsolete file)
For privacy segmentation we apply dark themes to private browsing mode windows.
Windows which have a contextual relationship to the private browsing windows should inherit their dark theme. This includes:
- page info window
- prompts (via
nsIPromptService
)
Windows which are launched from the PBM window, but are generally global, such as the library (history, bookmarks, etc), should not inherit the style.
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
•
|
||
I've done some experiments with the BrowsingContext flag prefersColorSchemeOverride
. While not originally implemented for the purpose of this bug, it can be used to override the color scheme per browsing context and therefore per window.
In pageInfo.js
I can check whether the parent window is in PBM and apply a dark color scheme.
This works well on Windows. On Linux it only works partially: a small portion of widgets remain dark, resulting in low contrast. On macOS it doesn't work properly: The window background remains light, only the text color is updated, which makes the text very hard to read.
We could use a similar approach for prompts, the commonDialog.xhtml
document. Again, it doesn't work properly on macOS. Also, I found that setting prefersColorSchemeOverride
for embedded prompts/browsers leads to a crash:
Hit MOZ_CRASH(CanSet failed for field(s): PrefersColorSchemeOverride) at /home/pbz/moz/build/debug/dist/include/mozilla/dom/SyncedContextInlines.h:102
Which means the approach currently only works for window prompts.
Assignee | ||
Comment 2•2 years ago
|
||
Assignee | ||
Comment 3•2 years ago
|
||
Depends on D136931
Assignee | ||
Comment 4•2 years ago
|
||
Depends on D136932
Assignee | ||
Comment 5•2 years ago
|
||
Depends on D136933
Updated•2 years ago
|
Updated•2 years ago
|
Pushed by pzuhlcke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/83581637ae08 Use prefersColorSchemeOverride to inherit dark PBM theme for prompts and pageInfo window. r=desktop-theme-reviewers,dao https://hg.mozilla.org/integration/autoland/rev/46cbaff8614d Set color scheme on window widget to fix PBM dark theme issues on macOS. r=emilio https://hg.mozilla.org/integration/autoland/rev/e3e0c8d40916 Tests for dark pageInfo and prompts. r=dao
Comment 7•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/83581637ae08
https://hg.mozilla.org/mozilla-central/rev/46cbaff8614d
https://hg.mozilla.org/mozilla-central/rev/e3e0c8d40916
Description
•