Widget elements in the content process now rendering in a dark theme
Categories
(Core :: Widget: Gtk, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox86 | --- | fixed |
People
(Reporter: evilpies, Assigned: heycam)
References
Details
Attachments
(4 files)
I use a dark GTK system theme. For rendering of elements like <input> in web pages Firefox however used to use some light theme variant.
One of the bugs in this range regressed that.
| Reporter | ||
Comment 1•5 years ago
|
||
| Reporter | ||
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Same problem for me, with a consistent regression range (2020-12-16-09-36-04 is good, 2020-12-16-21-48-34 is bad).
At the same time, @media (prefers-color-scheme: dark) stopped matching, so pages such as this Bugzilla unexpectedly switched from dark mode to light mode. It would make sense for this to have a common cause: Firefox must now think my Adwaita-dark theme is light.
| Assignee | ||
Comment 3•5 years ago
|
||
Thanks for the report.
There was a prefers-color-scheme problem, fixed now in bug 1683026. It's possible this problem also affects prefers-color-scheme too.
Anyway, I just tried with the system set to Adwaita-dark (set in gnome-tweaks), and can reproduce, if the widget.disable-native-theme-for-content pref disabled.
I will take a look at the underlying problem tomorrow, but I'll land a change to turn off the pref for the regressing bug now.
| Assignee | ||
Comment 4•5 years ago
|
||
| Assignee | ||
Updated•5 years ago
|
Comment 6•5 years ago
|
||
| bugherder | ||
| Assignee | ||
Comment 8•5 years ago
|
||
So I think if we want the RemoteLookAndFeel to be usable when the non-native theme has not been enabled, then RemoteLookAndFeel::NativeInit needs to call into nsLookAndFeel::ConfigureContentGtkTheme, so that widget painting uses the right theme.
| Assignee | ||
Comment 10•5 years ago
|
||
And re-enable the RemoteLookAndFeel by default with Gtk.
When the RemoteLookAndFeel is enabled and the non-native theme is not
enabled, we still need to configure the Gtk theme in content processes,
since we're still using Gtk to paint widget backgrounds etc. Without
this, we can end up using LookAndFeel colors from a light theme but
painting widget backgrounds from a dark theme.
Other platforms don't configure themes for content processes
differently, so on those platforms LookAndFeelTheme is an empty struct
and we skip the ConfigureTheme call.
| Assignee | ||
Comment 11•5 years ago
|
||
Comment 12•5 years ago
|
||
Comment 13•5 years ago
|
||
| bugherder | ||
Comment 14•5 years ago
|
||
== Change summary for alert #28260 (as of Mon, 28 Dec 2020 08:09:52 GMT) ==
Improvements:
| Ratio | Suite | Test | Platform | Options | Absolute values (old vs new) |
|---|---|---|---|---|---|
| 9% | Base Content Heap Unclassified | linux1804-64-shippable | 4,002,296.67 -> 3,643,805.33 | ||
| 9% | Base Content Heap Unclassified | linux1804-64-shippable-qr | 4,043,851.33 -> 3,684,823.33 | ||
| 8% | Base Content Heap Unclassified | linux1804-64-shippable-qr | 4,013,857.33 -> 3,684,823.33 | ||
| 4% | Base Content Explicit | linux1804-64-shippable | 9,958,741.33 -> 9,562,112.00 | ||
| 4% | Base Content Explicit | linux1804-64-shippable-qr | 9,999,530.67 -> 9,626,794.67 | ||
| 3% | Base Content Resident Unique Memory | linux1804-64-shippable | 16,457,130.67 -> 16,007,338.67 | ||
| 2% | Heap Unclassified | linux1804-64-shippable | 69,184,272.07 -> 67,548,813.50 |
For up to date results, see: https://treeherder.mozilla.org/perfherder/alerts?id=28260
| Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 15•5 years ago
|
||
This change also removed the theming of the main scrollbar and now it uses the light theme colors even if the dark theme is enabled. Is it possible to only paint the scrollbar if non-native dark theme is used?
| Assignee | ||
Comment 16•5 years ago
|
||
Emilio, can you make a decision re comment 15 here?
Comment 17•5 years ago
|
||
What do you mean with "is it possible to only paint the scrollbar if non-native dark theme is used?"
We need to paint an scrollbar, somehow :-)
But yeah, file a bug about this and ni? me, probably we should implement the same kind of scrollbar darkening that Windows has on Linux, if there's a native dark theme we have a place to pull the values from, even.
Updated•5 years ago
|
Description
•