All NativeGetFont implementations do, so child processes see something
different from parent processes which is pretty unfortunate, and isn't
the goal of RemoteLookAndFeel.
I found this by code inspection. Seems this is mostly used for debugging
etc?
Differential Revision: https://phabricator.services.mozilla.com/D110914
The first part fixes the bookmarks sidebars etc when in a light theme.
The second fixes too-light selection colors in websites.
Differential Revision: https://phabricator.services.mozilla.com/D110729
After this patch, there are two remaining pieces to fix bug 1700294:
* macOS nsLookAndFeel needs to return the right colors for light / dark
appearance.
* We need to return ColorScheme::Dark for the right documents in
ColorSchemeForDocument.
Both of those should be straight-forward.
Differential Revision: https://phabricator.services.mozilla.com/D110680
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
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
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
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
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
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
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
CLOSED TREE
Backed out changeset f6519420f910 (bug 1678487)
Backed out changeset 9beae015d19b (bug 1678487)
Backed out changeset 029cc10d2477 (bug 1678487)
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
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
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
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
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
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
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
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
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