prefers-color-scheme is not updated immediately after changing ui.systemUsesDarkTheme
Categories
(Core :: Widget, defect, P2)
Tracking
()
People
(Reporter: eight04, Assigned: agashlin)
References
Details
Attachments
(2 files, 1 obsolete file)
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0
Steps to reproduce:
- Visit
bugzilla.mozilla.org
- Verify the site is displayed in light theme
- Open a new tab
about:config
, setui.systemUsesDarkTheme
to1
- Switch back to the bugzilla tab
Actual results:
Bugzilla is still displayed in light theme. If you resize the window, dark theme applies immediately.
Expected results:
Changing theme should not require a resize. Also, I think this issue may prevent background page from detecting changes of prefers-color-scheme
.
Comment 1•5 years ago
|
||
Managed to reproduce this issue on Firefox Nightly 69.0a1, Firefox 68.0b14 and Firefox 67.0.4 on Windows 10 x 64, Mac OS X 10.14 and on Ubuntu 18.04 x64.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Widget code is what tracks these prefs. This should not be too hard to fix.
Comment 3•5 years ago
|
||
The component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit auto_nag documentation.
Comment 4•5 years ago
|
||
The priority flag is not set for this bug.
:jimm, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 5•5 years ago
|
||
Something to poke at when you need a break from update work.
Assignee | ||
Comment 6•5 years ago
|
||
Mostly this just needs to run RefreshSystemMetrics(), but to ensure
that runs after the preference change has affected the LookAndFeel,
I'm calling ThemeChanged(), which should do the work after all
other preference callbacks have run.
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 7•5 years ago
|
||
Also causes removing a pref to take effect immediately, and prevents
losing all color pref overrides when the theme changes.
Assignee | ||
Updated•5 years ago
|
Comment 8•5 years ago
|
||
That looks good to me, thanks!
Maybe instead of the observer service we should use something like what the android code does for device changes, putting it in a common place?
Basically what that (fairly ugly) piece of code is doing is just going through all windows and call ThemeChanged on each.
In any case either way looks ok to me.
Updated•5 years ago
|
Pushed by agashlin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9ef1dd77e6b2 Update theme when nsXPLookAndFeel prefs change. r=dholbert,jmathies
Comment 10•5 years ago
|
||
Backed out changeset 9ef1dd77e6b2 (Bug 1561546) for causing frequent failures in dom/animation/test/mozilla/test_restyles.html CLOSED TREE
https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=266173162&repo=autoland&lineNumber=4271
Comment 11•5 years ago
|
||
Backout by shindli@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/235856e26f56 Backed out changeset 9ef1dd77e6b2 for causing frequent failures in dom/animation/test/mozilla/test_restyles.html CLOSED TREE
Assignee | ||
Comment 12•5 years ago
|
||
Updated•5 years ago
|
Comment 13•5 years ago
|
||
Pushed by agashlin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e452ba381a62 Part 1 - Change scrollbar pref early. r=hiro
Comment 14•5 years ago
|
||
Pushed by agashlin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/29b8270e326c Part 2 - Update theme when nsXPLookAndFeel prefs change. r=dholbert,jmathies
Comment 15•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e452ba381a62
https://hg.mozilla.org/mozilla-central/rev/29b8270e326c
Comment 16•5 years ago
|
||
Since the status are different for nightly and release, what's the status for beta?
For more information, please visit auto_nag documentation.
Comment 17•5 years ago
|
||
I'm assuming this can ride the trains, feel free to reset status and request uplift if not.
Comment 18•5 years ago
|
||
During my tests on Win 10 v1903 x64 (build 18362.387, Pro & Education) , both Firefox 71.0a1 (win64 exe, 2019-10-05) nightly and the firefox-71.0a1.en-US.win64.zip downloaded from https://archive.mozilla.org/pub/firefox/nightly/2019/09/2019-09-20-09-49-18-mozilla-central/ can not make extensions respond on dark theme changes.
Assignee | ||
Comment 19•5 years ago
|
||
Hello Dahan,
Did this previously work on Firefox 70? If so, please file a new regression bug, and fill in the "regressed by" field with this bug number (1561546).
If not, it is still a good idea to file a new bug, and you might leave that bug number in the "see also" field of this bug so interested parties will know to look at it.
In either case, please provide some more information about how to reproduce the bug, such as a particular extension that doesn't respond, what it was supposed to do, and what specific "dark theme changes" you mean.
Comment 20•5 years ago
|
||
(In reply to Adam Gashlin (he/him) [:agashlin] from comment #19)
Hello Dahan,
Did this previously work on Firefox 70? If so, please file a new regression bug, and fill in the "regressed by" field with this bug number (1561546).If not, it is still a good idea to file a new bug, and you might leave that bug number in the "see also" field of this bug so interested parties will know to look at it.
In either case, please provide some more information about how to reproduce the bug, such as a particular extension that doesn't respond, what it was supposed to do, and what specific "dark theme changes" you mean.
Then it seems not a "regression bug", so I've created https://bugzilla.mozilla.org/show_bug.cgi?id=1587723 .
Updated•5 years ago
|
Comment 21•5 years ago
|
||
Confirmed with 69.0a1(2019-06-26).
Verfiied fix with 71.0b5.
Comment 22•5 years ago
|
||
Bugbug thinks this bug is a regression, but please revert this change in case of error.
Updated•5 years ago
|
Description
•