Граф коммитов

133 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 58ffc3930e Bug 1702756 - Allow color prefs to read more colors. r=mstange
This is just a minor thing, but it simplifies the code and should be
strictly better.

Differential Revision: https://phabricator.services.mozilla.com/D110679
2021-04-02 17:43:08 +00:00
Emilio Cobos Álvarez a37b56a98d Bug 1702756 - Refactor nsXPLookAndFeel's caching setup to be more consistent. r=mstange
We also cache everywhere whether getting the int/float/color failed, for
example, and do the pref lookup on demand. Seems a bit nicer. We could insert
the pref values on the cache directly on Refresh(), that's another alternative,
but I don't think it matters much either way.

Differential Revision: https://phabricator.services.mozilla.com/D110675
2021-04-02 16:34:35 +00:00
Emilio Cobos Álvarez 9e4fe964d6 Bug 1702756 - Move some hardcoded colors out of native code. r=mstange
No reason that code needs to be there. The findbar modal highlight stuff is not
being worked on and it was unclear to me why it needed a fission check, so I
removed that special case. The findbar code can customize the colors with
Selection.setColors anyways, which is a better fix.

Depends on D110673

Differential Revision: https://phabricator.services.mozilla.com/D110674
2021-04-02 16:34:34 +00:00
Emilio Cobos Álvarez 883276f35f Bug 1702756 - Lift a standins-related check to the caller. r=mstange
Depends on D110672

Differential Revision: https://phabricator.services.mozilla.com/D110673
2021-04-02 16:34:34 +00:00
Emilio Cobos Álvarez 390c6943fe Bug 1702676 - Change public LookAndFeel API to accept a color scheme. r=mstange
This shouldn't change behavior, but is the biggest cross-platform part
of the change so I'd like to get it landed sooner rather than later.

The two calls like:

  GetColor(ColorID::TextSelectBackground, color);
  if (color == 0x000000) {
    mColorTextSelectForeground = NS_RGB(0xff, 0xff, 0xff);
  } else {
    mColorTextSelectForeground = NS_DONT_CHANGE_COLOR;
  }

that I'm removing are just broken. They were calling the version of
GetColor the function that took a default value when the color wasn't
available, not the version of the color with the outparam.

To prevent such mistakes, add two signatures, GetColor(), returning a
Maybe<nscolor> and Color(), returning a color with a fallback.

Differential Revision: https://phabricator.services.mozilla.com/D110651
2021-04-02 12:22:14 +00:00
Narcis Beleuzu e9fb777466 Backed out changeset 597b9606c3ca (bug 1702676) for reftest failures on mq_prefers_reduced_motion_reduce.html CLOSED TREE 2021-04-02 09:34:53 +03:00
Emilio Cobos Álvarez f7f84a3c53 Bug 1702676 - Change public LookAndFeel API to accept a color scheme. r=mstange
This shouldn't change behavior, but is the biggest cross-platform part
of the change so I'd like to get it landed sooner rather than later.

The two calls like:

  GetColor(ColorID::TextSelectBackground, color);
  if (color == 0x000000) {
    mColorTextSelectForeground = NS_RGB(0xff, 0xff, 0xff);
  } else {
    mColorTextSelectForeground = NS_DONT_CHANGE_COLOR;
  }

that I'm removing are just broken. They were calling the version of
GetColor the function that took a default value when the color wasn't
available, not the version of the color with the outparam.

To prevent such mistakes, add two signatures, GetColor(), returning a
Maybe<nscolor> and Color(), returning a color with a fallback.

Differential Revision: https://phabricator.services.mozilla.com/D110651
2021-04-02 00:21:37 +00:00
Emilio Cobos Álvarez 22df991215 Bug 1701830 - Remove LookAndFeelCache. r=cmartin,geckoview-reviewers,mstange,esawin
Now that RemoteLookAndFeel is enabled everywhere, this is dead code.

Differential Revision: https://phabricator.services.mozilla.com/D110179
2021-03-30 22:58:22 +00:00
Emilio Cobos Álvarez 73ff1d89ad Bug 1699088 - Cache fonts / floats / ints in nsXPLookAndFeel. r=cmartin
And make FontID's indexing setup more similar to FloatID / IntID / ColorID. The
values no longer need to match the style constants since Stylo. We could also
cache whether the lookup succeeded for floats / ints, but it might not be worth
it, your call though.

Differential Revision: https://phabricator.services.mozilla.com/D108765
2021-03-24 22:57:36 +00:00
Emilio Cobos Álvarez 19830f087b Bug 1699088 - Make the color cache generic. r=cmartin
We'll use this for more stuff.

Differential Revision: https://phabricator.services.mozilla.com/D108764
2021-03-18 21:04:52 +00:00
Emilio Cobos Álvarez 8e09166c3a Bug 1699088 - Move LookAndFeel color caching and prefs code into nsXPLookAndFeel.cpp. r=cmartin
No reason this needs to be declared in the header.

Differential Revision: https://phabricator.services.mozilla.com/D108763
2021-03-18 18:00:26 +00:00
Markus Stange e3927f3261 Bug 1697338 - Remove unused -moz-default-appearance values -moz-mac-vibrancy-light/dark, and the system colors of the same name. r=emilio
Starting with macOS 10.14, the generic light/dark vibrancy is deprecated, and semantic vibrancy names are preferred.
If we ever need more vibrancy, we can add new values with semantic names.

Depends on D107910

Differential Revision: https://phabricator.services.mozilla.com/D108152
2021-03-17 16:50:08 +00:00
Emilio Cobos Alvarez 52c38f586e Bug 1698291 - Make -moz-accent-color reflect the windows accent color. r=dao
And remove the windows-specific versions of this color.

Also fix the hard-coded defaults by the colors I get in the default windows
theme.

Differential Revision: https://phabricator.services.mozilla.com/D108325
2021-03-15 20:59:42 +00:00
Emilio Cobos Álvarez 343674f3d5 Bug 1678487 - Color-manage system colors from style too. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D104947
2021-03-08 18:12:07 +00:00
Bogdan Tara 544268f5a4 Backed out 2 changesets (bug 1678487) for static gfxPlatform::InitializeCMS crashes CLOSED TREE
Backed out changeset af0927300d51 (bug 1678487)
Backed out changeset 9ed081f10e63 (bug 1678487)
2021-03-08 04:47:16 +02:00
Emilio Cobos Álvarez 5506f49e17 Bug 1678487 - Color-manage system colors from style too. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D104947
2021-03-08 02:02:42 +00:00
Emilio Cobos Álvarez 3f5561a2f7 Bug 1678487 - Make CMSMode an enum class. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D104945
2021-02-13 03:59:23 +00:00
Emilio Cobos Álvarez 513e28b55b Bug 1678487 - Minor cleanups to nsXPLookAndFeel::GetColorValue. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D104943
2021-02-13 03:59:22 +00:00
Mihai Alexandru Michis afd69c4be3 Backed out 3 changesets (bug 1678487) for causing reftest failures.
CLOSED TREE

Backed out changeset f6519420f910 (bug 1678487)
Backed out changeset 9beae015d19b (bug 1678487)
Backed out changeset 029cc10d2477 (bug 1678487)
2021-02-13 05:18:54 +02:00
Emilio Cobos Álvarez ba4d1a3c68 Bug 1678487 - Make CMSMode an enum class. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D104945
2021-02-13 02:15:22 +00:00
Emilio Cobos Álvarez 0c17b55528 Bug 1678487 - Minor cleanups to nsXPLookAndFeel::GetColorValue. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D104943
2021-02-13 02:15:21 +00:00
Brindusan Cristian d930c1c648 Backed out 5 changesets (bug 1678487) for multiple failures. CLOSED TREE
Backed out changeset 00242b4230f2 (bug 1678487)
Backed out changeset 63612a51cfee (bug 1678487)
Backed out changeset bd0321ad1968 (bug 1678487)
Backed out changeset c6a4d3c17d39 (bug 1678487)
Backed out changeset 5de112a29a87 (bug 1678487)
2021-02-13 02:41:17 +02:00
Emilio Cobos Álvarez 7de7e91542 Bug 1678487 - Color-manage system colors from style too. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D104947
2021-02-12 23:30:02 +00:00
Emilio Cobos Álvarez d7aca6b47c Bug 1678487 - Make CMSMode an enum class. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D104945
2021-02-12 23:23:31 +00:00
Emilio Cobos Álvarez 6f2e7c40a0 Bug 1678487 - Minor cleanups to nsXPLookAndFeel::GetColorValue. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D104943
2021-02-12 23:23:30 +00:00
Emilio Cobos Álvarez 5035989860 Bug 1692224 - Remove ui.use_native_colors. r=spohl
It's not set to false anywhere and the browser would be quite broken
with it set to false.

Differential Revision: https://phabricator.services.mozilla.com/D104906
2021-02-12 01:01:32 +00:00
Emilio Cobos Álvarez 7345d01ad7 Bug 1692224 - Use standins for system colors pairs that paint over non-native theme widgets to guarantee contrast. r=spohl
Nothing like having the code already written for you :-)

Differential Revision: https://phabricator.services.mozilla.com/D104905
2021-02-12 01:01:31 +00:00
Emilio Cobos Álvarez d96854eeb1 Bug 1691781 - Make Linux tab bar use the darker of the highlight / highlighttext colors. r=dao
Some GTK themes use very soft colors for selection backgrounds, using
darker colors for the text. This makes the tab and focus outlines in the
tab bar not have sufficient contrast with usual backgrounds.

I needed to do this for bug 1690778, but it seems worth doing it on the
front-end as well.

Differential Revision: https://phabricator.services.mozilla.com/D104547
2021-02-11 16:36:54 +00:00
Emilio Cobos Álvarez 1d3c069803 Bug 1690778 - Derive accent color from theme highlight color in GTK. r=mstange
This makes form controls match the rest of the GTK theme like selection
colors, etc.

An alternative to this would be to just use non-native colors on GTK for
all content, but that seems somewhat unfortunate and we do the right
thing for scrollbars so...

I've tried on a variety of themes and this looks nice so far.

Differential Revision: https://phabricator.services.mozilla.com/D104496
2021-02-10 00:47:38 +00:00
Cameron McCormack eefbb537b9 Bug 1683204 - Include content theme configuration details in FullLookAndFeel. r=spohl
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.

Differential Revision: https://phabricator.services.mozilla.com/D100223
2020-12-22 19:26:41 +00:00
Cameron McCormack 6b2ba19c4c Bug 1672097 - Part 2: Cache FullLookAndFeel data. r=karlt
This avoids us doing the full work of ExtractData every time a new content
process is created.  That work is probably not super expensive, but without
this caching it does trip up
browser/base/content/test/performance/browser_preferences_usage.js due to
looking up a non-mirrored pref.

Differential Revision: https://phabricator.services.mozilla.com/D98990
2020-12-16 04:41:46 +00:00
Jed Davis 907aa1cd3c Bug 1470983 - Remote all LookAndFeel values for the Gtk backend. r=spohl,jld
This adds a new LookAndFeel implementation, RemoteLookAndFeel, which can
be used in content processes and is supplied with all of its values by the
parent process.

Co-authored-by: Cameron McCormack <cam@mcc.id.au>

Differential Revision: https://phabricator.services.mozilla.com/D97977
2020-12-16 04:17:36 +00:00
Cameron McCormack 0f3cfafb48 Bug 1678540 - Refactor nsXPLookAndFeel::GetIntImpl etc. r=spohl
This will allow calling into NativeGetInt etc. to get native LookAndFeel values without
looking at the prefs.

Differential Revision: https://phabricator.services.mozilla.com/D97725
2020-11-20 23:52:47 +00:00
Cameron McCormack 104a5a7dde Bug 1678540 - Don't provide default values for IntID::ScrollButtonLeftMouseButtonAction etc. r=spohl
This simplifies the way nsXPLookAndFeel::GetIntImpl and its overrides interact.

Differential Revision: https://phabricator.services.mozilla.com/D97724
2020-11-20 23:52:52 +00:00
Jed Davis 96f7c5cf5c Bug 1657401 - Change LookAndFeel IPC to use IPDL structs. r=spohl
Aside from automating boilerplate, this will allow reusing some of these
structs for full LookAndFeel remoting in bug 1470983.

Differential Revision: https://phabricator.services.mozilla.com/D94531
2020-11-11 23:26:51 +00:00
Cameron McCormack 7d5661d677 Bug 1676057 - Test. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D96499
2020-11-10 22:15:25 +00:00
Emilio Cobos Álvarez d622f54db0 Bug 1668875 - Distinguish theme changes that can and cannot affect style/layout. r=tnikkel
This should make the optimization landed earlier in this bug apply for
some of the NotifyThemeChanged() calls in nsWindow.cpp which are causing
all the extra invalidations.

If we know that system colors/fonts didn't change, we can avoid doing a
bunch of reflow work and the patch from earlier in the bug can avoid
re-rasterizing images too.

Differential Revision: https://phabricator.services.mozilla.com/D94425
2020-10-27 10:24:40 +00:00
Cameron McCormack d7eee82ba1 Bug 1671401 - Use separate Scrollbar and ThemedScrollbar ColorIDs. r=spohl
Otherwise on Windows, we have a ColorID::Scrollbar but not any of the other scrollbar part
colors, and the Windows-provided value for Scrollbar doesn't work well
with the default values for the other scrollbar parts that come from the
non-native theme.

Differential Revision: https://phabricator.services.mozilla.com/D93728
2020-10-16 12:49:47 +00:00
Cameron McCormack c529225214 Bug 1669368 - Use LookAndFeelCache to pass Gtk theme-derived scrollbar colors to content processes. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D93467
2020-10-15 04:54:41 +00:00
Cameron McCormack 76405ab8fe Bug 1670145 - Record telemetry on Gtk version and other theme related info. r=tdsmith,spohl
Differential Revision: https://phabricator.services.mozilla.com/D93051
2020-10-15 04:50:48 +00:00
Razvan Maries 8d3a29c27b Backed out 4 changesets (bug 1670694, bug 1670853, bug 1669368, bug 1670145) for build bustages on nsNativeBasicTheme.h. CLOSED TREE
Backed out changeset fcb1b57645e0 (bug 1669368)
Backed out changeset 6ac5b674c3b6 (bug 1670853)
Backed out changeset 913fd041e5dd (bug 1670145)
Backed out changeset 89504c0fb0cd (bug 1670694)
2020-10-15 07:45:35 +03:00
Cameron McCormack 76b30e3307 Bug 1669368 - Use LookAndFeelCache to pass Gtk theme-derived scrollbar colors to content processes. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D93467
2020-10-15 00:24:09 +00:00
Cameron McCormack 7f8dad291b Bug 1670145 - Record telemetry on Gtk version and other theme related info. r=tdsmith,spohl
Differential Revision: https://phabricator.services.mozilla.com/D93051
2020-10-15 00:23:57 +00:00
Chris Martin 552aa91269 Bug 1652561 - Remote Win32k calls in nsLookAndFeel::GetFontImpl() r=emilio,geckoview-reviewers,agi,froydnj
Content processes will now receive cached values for GetFontImpl() from the
parent process during initialization and whenever the theme changes.

This eliminates the use of several Win32k calls in content.

Differential Revision: https://phabricator.services.mozilla.com/D83406
2020-07-31 16:21:44 +00:00
Zeke Medley d65fae1c28 Bug 1654918 - Improve prefers-contrast reftests with the `ui.useAccessibilityTheme` preference r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D84765
2020-07-29 20:27:42 +00:00
Simon Giesecke 426bb6e4a5 Bug 1651930 - Add missing include in nsXPLookAndFeel.cpp. r=geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D83048
2020-07-15 12:45:07 +00:00
Sylvestre Ledru 85c05f3a47 Bug 1519636 - Reformat recent changes to the Google coding style r=andi
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D79795
2020-06-16 14:37:23 +00:00
Emilio Cobos Álvarez ef3d21048d Bug 1640623 - Use enum classes for LookAndFeel int and float IDs. r=jmathies,geckoview-reviewers,esawin
Differential Revision: https://phabricator.services.mozilla.com/D76694
2020-06-11 11:27:43 +00:00
Colomban Wendling 120fea1c42 Bug 1628762 - Fix tree column header color to follow theme. r=geckoview-reviewers,snorp
The background color for the tree column headers is drawn using the
system APIs, but the foreground uses custom colors, which didn't follow
theme.  This can lead to unreadable text with specific colors, e.g.
leading to black on black.

Fix this by using system colors for the foreground as well.  It also
adds on-hover styling to match possible background change on hover.

Differential Revision: https://phabricator.services.mozilla.com/D78073
2020-06-03 20:52:55 +00:00
Kashav Madan b389ac5721 Bug 1641929 - Replace uses of StaticPrefs::fission_autostart() with FissionAutostart(), r=nika
Differential Revision: https://phabricator.services.mozilla.com/D78799
2020-06-08 23:00:21 +00:00