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

60 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 20b915489a Bug 1804657 - Remove dead code related to having native theme in content on Linux. r=stransky
Since the headless work (bug 1129492 and co) we realistically have no
way of rendering native scrollbars in any meaningful way. Remove dead
code that used to support using a different GTK theme on content.

Differential Revision: https://phabricator.services.mozilla.com/D179616
2023-06-01 07:37:33 +00:00
Emilio Cobos Álvarez c14065f628 Bug 1776162 - Improve LookAndFeel color caching. r=mstange
To be honest, I'm a bit baffled that bug 1773795 caused a performance
regression, but I think it's because the standins codepath is not really
cached, so system colors that are "spoofed" always go through the
massive switch, which could potentially be expensive.

To fix, this, rejigger a bit the caches so that we key on both
color-scheme and use-standins. Also, while at it, make the set of colors
we spoof a single bitflag check, rather than relying on the compiler to
do something potentially smart with it.

I had to shuffle the order of colors around so that the expression to
initialize the bitfield is constexpr (doesn't go over 1 << 64), but
other than that this patch should be relatively straight-forward.

Differential Revision: https://phabricator.services.mozilla.com/D150100
2022-06-23 22:38:02 +00:00
Emilio Cobos Álvarez f317384568 Bug 1736518 - Make browser.tabs.drawInTitlebar a tri-state. r=stransky,Gijs
To more properly support Linux having a different default at runtime.

Expose the resolved value in appinfo for convenience, and use it in the
front-end as needed.

Differential Revision: https://phabricator.services.mozilla.com/D129004
2021-10-21 09:07:12 +00:00
Emilio Cobos Álvarez d10188f9b4 Bug 1731678 - Add some generic dark system colors for Windows/Android/standins. r=dholbert
Eventually we should support all of them, but for now they are only used
by native code (unless you enable the color-scheme pref) and these will
be enough.

Differential Revision: https://phabricator.services.mozilla.com/D126737
2021-09-29 10:20:56 +00:00
Emilio Cobos Álvarez 08dccdd536 Bug 1721347 - Add OS theme info to about:support. r=Gijs,fluent-reviewers
I'm not sure what information would be useful in other OSes, so ifdef
the row for GTK for now, but I made this trivial to show in Windows /
macOS / Android as soon as they return useful information.

Differential Revision: https://phabricator.services.mozilla.com/D120331
2021-07-20 20:09:09 +00:00
Emilio Cobos Álvarez 7c4a2436ac Bug 1713920 - Add some logging for native GTK colors. r=stransky
Let's see if that allows us to figure out what's going on here.

Differential Revision: https://phabricator.services.mozilla.com/D117893
2021-06-16 14:13:43 +00:00
Emilio Cobos Álvarez 9ffb840117 Bug 1707957 - Extract both light and dark system colors in GTK. r=stransky
And add code to use the appropriate variant like we do in macOS with
respect-system-appearance (but this still needs more work as noted in
StaticPrefList.yaml).

Still, it cleans up a bunch, and allows to not depend on the content
process boundary to provide light system colors.

Depends on D113542

Differential Revision: https://phabricator.services.mozilla.com/D113543
2021-04-30 12:36:50 +00:00
Butkovits Atila 6e4df5e067 Backed out 2 changesets (bug 1707872, bug 1707957) for causing valgrind failures. CLOSED TREE
Backed out changeset 0fb0e3d056f8 (bug 1707957)
Backed out changeset 03767acc6135 (bug 1707872)
2021-04-28 07:46:21 +03:00
Emilio Cobos Álvarez 19af6bcbf4 Bug 1707957 - Extract both light and dark system colors in GTK. r=stransky
And add code to use the appropriate variant like we do in macOS with
respect-system-appearance (but this still needs more work as noted in
StaticPrefList.yaml).

Still, it cleans up a bunch, and allows to not depend on the content
process boundary to provide light system colors.

Depends on D113542

Differential Revision: https://phabricator.services.mozilla.com/D113543
2021-04-27 22:34:56 +00:00
Emilio Cobos Álvarez d3f4f81c53 Bug 1702765 - Plumb ColorScheme through nsXPLookAndFeel. r=mstange
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
2021-04-02 22:17:55 +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 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 b0cf81da8b Bug 1701825 - Allow passing some colors from GTK even in dark themes. r=stransky
Selection and accent color should be uncontroversial, since we ensure
the darker variant goes in the background, and the scrollbars were
intended to get passed from the parent theme in bug 1669368, but it was
regressed by the initial RemoteLookAndFeel work.

Differential Revision: https://phabricator.services.mozilla.com/D110175
2021-03-30 08:17:38 +00:00
Emilio Cobos Álvarez 9238b03fbe Bug 1701825 - Make the mechanism to decide whether ints are taken from the parent or child process in RemoteLookAndFeel more generic. r=stransky
For that, allow inserting out of order into the RemoteLookAndFeel maps.

Differential Revision: https://phabricator.services.mozilla.com/D110174
2021-03-30 08:17:38 +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 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
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 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 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
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 1c539d280e Bug 1672097 - Part 1: Make Gtk theme overrides work with the RemoteLookAndFeel. r=spohl,karlt
When the RemoteLookAndFeel is not in use, content processes override the
Gtk theme in some circumstances (e.g. if the theme is a dark variant, we
try choosing the light one, since that works better with Web content).

When the RemoteLookAndFeel is in use, the parent process needs to handle
this.  So we temporarily set the parent process to the overridden theme,
extract the FullLookAndFeel data, then restore the original theme.  We
make sure to avoid throwing away any cached data and restyling every
document as a result of the temporary theme change.

Differential Revision: https://phabricator.services.mozilla.com/D98418
2020-12-16 04:41:05 +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
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 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 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
Emilio Cobos Álvarez bb457d5b09 Bug 1640264 - Simplify the "notify of theme changes in all windows" code in Android. r=geckoview-reviewers,agi
I want to do something similar in the child process, and turns out
we already kinda have something like this.

Differential Revision: https://phabricator.services.mozilla.com/D76535
2020-05-22 23:03:43 +00:00
Emilio Cobos Álvarez 7b19f0d6d4 Bug 1609024 - Remove cache mechanism which is not very useful. r=hiro,snorp,mccr8
I don't think all this complexity is worth it for having a
marginally-more-realistic testing story. Using the pref just works and we should
do that, I think.

Differential Revision: https://phabricator.services.mozilla.com/D59980
2020-05-21 17:02:06 +00:00
Hiroyuki Ikezoe 21a5133d31 Bug 1606503 - Get the value for prefers-reduced-motion via LookAndFeelInt. r=geckoview-reviewers,snorp
With this change we have the same setup for prefers-reduced-motion so that
we can change the value with the same manner in automated tests.

Differential Revision: https://phabricator.services.mozilla.com/D59023

--HG--
extra : moz-landing-system : lando
2020-01-14 05:51:06 +00:00
Hiroyuki Ikezoe e538eea4dc Bug 1606503 - Move prefers-reduced-motion bits for testing into LookAndFeel. r=emilio
Now both of GTK and MacOSX backends use the same machinery, LookAndFeelInt, for
prefers-reduced-motion. And we are going to use it on Android as well so it'd
make sense to move the code into there.

On Windows we can also use the same LookAndFeelInt machinery and probably
all we have to do is to call SendNotifyMessage with SPI_SETCLIENTAREAANIMATION
in SetPrefersReducedMotionOverrideForTest.

Differential Revision: https://phabricator.services.mozilla.com/D59022

--HG--
extra : moz-landing-system : lando
2020-01-14 05:50:53 +00:00
shindli c03a2cf53a Backed out 3 changesets (bug 1606503) for causing bustages in nsXPLookAndFeel.cpp CLOSED TREE
Backed out changeset 7e9d421335e0 (bug 1606503)
Backed out changeset 371f74475fb9 (bug 1606503)
Backed out changeset 8aada655d8bc (bug 1606503)
2020-01-14 05:07:14 +02:00
Hiroyuki Ikezoe f2fbae5d7d Bug 1606503 - Get the value for prefers-reduced-motion via LookAndFeelInt. r=geckoview-reviewers,snorp
With this change we have the same setup for prefers-reduced-motion so that
we can change the value with the same manner in automated tests.

Differential Revision: https://phabricator.services.mozilla.com/D59023

--HG--
extra : moz-landing-system : lando
2020-01-14 02:34:45 +00:00
Hiroyuki Ikezoe 37f0cf306c Bug 1606503 - Move prefers-reduced-motion bits for testing into LookAndFeel. r=emilio
Now both of GTK and MacOSX backends use the same machinery, LookAndFeelInt, for
prefers-reduced-motion. And we are going to use it on Android as well so it'd
make sense to move the code into there.

On Windows we can also use the same LookAndFeelInt machinery and probably
all we have to do is to call SendNotifyMessage with SPI_SETCLIENTAREAANIMATION
in SetPrefersReducedMotionOverrideForTest.

Differential Revision: https://phabricator.services.mozilla.com/D59022

--HG--
extra : moz-landing-system : lando
2020-01-14 02:17:47 +00:00
Cameron McCormack c6ae607f04 Bug 1601846 - Record telemetry for whether the user has a dark mode OS theme. r=jmathies
Differential Revision: https://phabricator.services.mozilla.com/D56130

--HG--
extra : moz-landing-system : lando
2019-12-20 19:05:12 +00:00
Adam Gashlin 7f498141e7 Bug 1561546 Part 2 - Update theme when nsXPLookAndFeel prefs change. r=dholbert,jmathies
Also causes removing a pref to take effect immediately, and prevents
losing all color pref overrides when the theme changes.

Differential Revision: https://phabricator.services.mozilla.com/D44416

--HG--
extra : moz-landing-system : lando
2019-09-19 19:05:01 +00:00
shindli ce58db2119 Backed out changeset 9ef1dd77e6b2 (bug 1561546) for causing frequent failures in dom/animation/test/mozilla/test_restyles.html CLOSED TREE 2019-09-11 23:21:46 +03:00
Adam Gashlin 28fa13a2e5 Bug 1561546 - Update theme when nsXPLookAndFeel prefs change. r=dholbert,jmathies
Also causes removing a pref to take effect immediately, and prevents
losing all color pref overrides when the theme changes.

Differential Revision: https://phabricator.services.mozilla.com/D44416

--HG--
extra : moz-landing-system : lando
2019-09-11 18:35:44 +00:00
Kristen Wright 8d6b5f31a4 Bug 1573992 - Convert findbar.modalHighlight to static pref. r=njn
Converts findbar.modalHighlight to a static pref and updates its usages.

Differential Revision: https://phabricator.services.mozilla.com/D43522

--HG--
extra : moz-landing-system : lando
2019-08-27 00:09:29 +00:00
Kristen Wright f25c87b636 Bug 1573992 - Convert ui.use_native_colors to static pref. r=njn
Converts ui.use_native_colors to a static pref and updates its usages.

Differential Revision: https://phabricator.services.mozilla.com/D43521

--HG--
extra : moz-landing-system : lando
2019-08-27 00:07:34 +00:00
Emilio Cobos Álvarez 810916db16 Bug 1554433 - Move system colors to values::specified::color. r=xidorn
This should be an idempotent patch. The way to come up with this patch has been:

 * Run the first script attached to the bug and pipe it to xclip, then paste it
   in color.rs
 * Add the relevant #[derive] annotations and remove the color.mako.rs
   definition.
 * Reorder the values to match the ColorID definition, on which some widget
   prefs and caching stuff relies on.
 * Manually port some documentation from nsLookAndFeel.h
 * Run `rg 'eColorID_' | cut -d : -f 1 | sort | uniq >files`
 * Run the second script attached to the bug.
 * Manually fix usage of `LAST_COLOR` (adding the `End` variant), and adding
   casts to integer as needed.
 * Add an static assert so that people remember to update the prefs, rather than
   a comment on the definition :)

Differential Revision: https://phabricator.services.mozilla.com/D32610

--HG--
extra : moz-landing-system : lando
2019-05-26 13:10:00 +00:00
Emilio Cobos Álvarez 323b5be77a Bug 1526294 - Should not need a pres context to get a system font. r=jfkthame
The only caller wants CSS pixels, no need to go back and forth.

This is the last dependency on the pres context, I think, from the style system
font code.

Differential Revision: https://phabricator.services.mozilla.com/D19147
2019-02-15 01:35:13 +01:00
Liang-Heng Chen bd2504a471 Bug 1485266 - Use stand-ins for native colors when RFP is enabled r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D17755

--HG--
extra : moz-landing-system : lando
2019-02-06 08:45:44 +00:00
Hiroyuki Ikezoe b8cb200990 Bug 1523692 - Set the prefers-reduce-motion value for test to the instance of nsLookAndFeel in child processes. r=snorp
So that we can query the test value in the child process properly.

Note that the APIs used for setting the prefers-reduced-motion value for testing
are only used on Android and MacOSX.  As for MacOSX we have a different
machinery (see bug 1486971) to deliver the test value without spinning native
event loop in the child process so the change here is valid only for Android.

Differential Revision: https://phabricator.services.mozilla.com/D18311

--HG--
extra : moz-landing-system : lando
2019-02-01 22:07:26 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Hiroyuki Ikezoe 5f958f80c7 Bug 1486971 - Test for dynamically change of the prefers-reduced-motion setting on MacOSX. r=froydnj,mstange
The framework to simulate the setting change works as following;

 - nsIDOMWindowUtils.setPrefersReducedMotion() calls an IPC function which ends
   up calling nsChildView::SetPrefersReducedMotion() in the parent process

 - nsChildView::SetPrefersReducedMotion() sets the given value into
   nsLookAndFeel::mPrefersReducedMotionCached just like we set the value queried
   via NSWorkspace.accessibilityDisplayShouldReduceMotion in the parent process
   and send a notification which is the same notification MacOSX sends when the
   system setting changed

 - Normally the cached value is cleared before quering new values since the
   cache value is stale, but in this case the value is up-to-date one, so
   nsChildView::SetPrefersReducedMotion() tells that we don't need to clear the
   cache, and nsIDOMWindowUtils.resetPrefersReducedMotion() resets that state
   of 'we don't need to clear the cache'

There are two test cases with the framework in this commit, one is just setting
the value and checking the value queried by window.matchMedia.  The other one is
receiving 'change' event and checking the value of the event target.

Note that to make this test works the patch for bug 1478212 is necessary since
the test runs in an iframe.

Depends on D5003

Differential Revision: https://phabricator.services.mozilla.com/D5004

--HG--
extra : moz-landing-system : lando
2018-09-15 01:00:07 +00:00
Markus Stange 0704012f36 Bug 1387594 - Add system colors for use in conjunction with -moz-font-smoothing-background-color and vibrant -moz-appearances. r=dbaron
MozReview-Commit-ID: IxXZwONxy41
2017-09-14 23:09:48 +02:00