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

285 Коммитов

Автор SHA1 Сообщение Дата
Dão Gottwald f0e33014a0 Bug 1788822 - Simplify color-scheme content override pref to only be [dark, light, auto]. r=emilio,fluent-reviewers,extension-reviewers,robwu,flod
Differential Revision: https://phabricator.services.mozilla.com/D156710
2022-09-08 17:55:07 +00:00
Frederic Wang 39dd537031 Bug 1588733 - Make maction/semantics elements behave as an mrow with the first child. r=emilio
See https://groups.google.com/forum/#!topic/mozilla.dev.platform/BWUvjERSXUM

Differential Revision: https://phabricator.services.mozilla.com/D49285
2022-09-06 04:32:15 +00:00
Emilio Cobos Álvarez 1ee4fdcb2a Bug 1782595 - Distinguish between "preferred" and "used" color-scheme. r=tnikkel
The "preferred" one is the behavior we have for chrome docs, where we
fall back always to the document's preferred color-scheme rather than
falling back to light.

We'll use this in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D154923
2022-08-18 15:49:52 +00:00
Emilio Cobos Álvarez 534f39ed75 Bug 1785310 - Remove mozilla/StaticPrefs_layout.h includes from other headers. r=dholbert
Adding layout prefs cause massive rebuilds because of this.

Differential Revision: https://phabricator.services.mozilla.com/D154928
2022-08-17 21:26:36 +00:00
Emilio Cobos Álvarez ff538cab0e Bug 1784349 - Don't use -moz-bool-pref for flexbox -moz-box emulation. r=dholbert,perftest-reviewers,sparky
Use a bool pref media query which allows dynamic changes to get
reflected instantly.

Differential Revision: https://phabricator.services.mozilla.com/D154449
2022-08-11 23:22:52 +00:00
Emilio Cobos Álvarez cf26510de6 Bug 1782858 - Make color-scheme affect Windows' non-native menus. r=desktop-theme-reviewers,dao
This matches what Linux and macOS do, and that allows the fix for bug 1782623
to work on Windows for unstyled selects.

This also simplifies the CSS (though it adds a new system color which is a bit
more annoying). I filed https://github.com/w3c/csswg-drafts/issues/7561 to
propose adding a more generic way to do this in the future (not just for
Firefox).

Differential Revision: https://phabricator.services.mozilla.com/D153549
2022-08-03 20:33:09 +00:00
Emilio Cobos Álvarez cb92d1eb7a Bug 1780247 - Fix a typo in the windows non-native menu pref. r=mstange,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D152189
2022-07-19 20:36:46 +00:00
Emilio Cobos Álvarez a4adec1fe6 Bug 1778834 - Fix a typo in AccentColor handling. r=dholbert
If we're using the theme accent then we should _not_ use the standin.

Differential Revision: https://phabricator.services.mozilla.com/D151442
2022-07-10 18:09:57 +00:00
Emilio Cobos Álvarez 2e0d7c56fd Bug 1776556 - Restore Windows' accent-color / system-color behavior for now. r=mstange
This basically pref-gates some of the accent-color changes that landed before
the soft-freeze to match current release behavior, at least for now.

In the future we might want to reconsider turning these on, but at the very
least we should figure out a good story for the grey-ish accent colors, see the
comments in the pref definitions.

The only tricky bit is the use-theme-accent pref handling. I made it specific
to the non-native-theme again so that AccentColor and NNT kept behaving
consistently, but AccentColor in the browser chrome used the real accent color.

Differential Revision: https://phabricator.services.mozilla.com/D150339
2022-06-28 18:55:27 +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 fe85e4d99d Bug 1775247 - Make AccentColor/Text consistent with accent-color: auto. r=mstange
It'd be weird otherwise, as in platforms where use-theme-accent is false
(Windows), form controls would be blue (the default accent color) but
the AccentColor color would be the system accent color still.

Differential Revision: https://phabricator.services.mozilla.com/D149877
2022-06-22 09:45:07 +00:00
Emilio Cobos Álvarez 4c5f20179e Bug 1775247 - Implement AccentColor/AccentColorText and remove -moz-prefixed version of the color. r=mstange
As per https://github.com/w3c/csswg-drafts/issues/7347.

Mostly renaming, doesn't change behavior other than exposing the new
color keywords (tested in wpt).

Differential Revision: https://phabricator.services.mozilla.com/D149876
2022-06-22 09:45:06 +00:00
Emilio Cobos Álvarez f5da42c507 Bug 1773795 - Spoof window/windowtext colors in content. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D149143
2022-06-15 09:53:13 +00:00
Emilio Cobos Álvarez 4b0f655deb Bug 1774016 - Document non-native theme color-spoofing better. r=dholbert,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D149142
2022-06-15 09:40:42 +00:00
Emilio Cobos Álvarez 10e96ff14e Bug 1773633 - Allow configuring OS zoom behavior. r=tnikkel
This is reasonably straight-forward and should allow us change the
desired behavior on platforms if / when we need.

Also, this adds tests for the feature by using the relevant float pref
(though we can't easily assert the full-zoom behavior because it changes
the size of the reftest window itself).

Differential Revision: https://phabricator.services.mozilla.com/D148902
2022-06-13 11:38:43 +00:00
Csoregi Natalia b5e25cb54f Backed out 2 changesets (bug 1773633) for causing failures on 1773633.html . CLOSED TREE
Backed out changeset a3f117c8f671 (bug 1773633)
Backed out changeset 5df8a7315ddb (bug 1773633)
2022-06-13 06:05:36 +03:00
Emilio Cobos Álvarez 9fc2aa47fc Bug 1773558 - Move fixed-point font types to Rust. r=layout-reviewers,jfkthame
Now that cbindgen and rust support const generics, it seems more simple.

This centralizes all the relevant font constants etc in rust and avoids
conversions when going from rust to C++ and vice versa.

Differential Revision: https://phabricator.services.mozilla.com/D148847
2022-06-13 00:59:23 +00:00
Emilio Cobos Álvarez 3514929e87 Bug 1773633 - Allow configuring OS zoom behavior. r=tnikkel
This is reasonably straight-forward and should allow us change the
desired behavior on platforms if / when we need.

Also, this adds tests for the feature by using the relevant float pref
(though we can't easily assert the full-zoom behavior because it changes
the size of the reftest window itself).

Differential Revision: https://phabricator.services.mozilla.com/D148902
2022-06-13 00:05:00 +00:00
Noemi Erli 841e350bc4 Backed out changeset 7585591a9bad (bug 1773558) for causing failures in system-fonts.html 2022-06-12 19:02:33 +03:00
Emilio Cobos Álvarez e441089ca0 Bug 1773558 - Move fixed-point font types to Rust. r=layout-reviewers,jfkthame
Now that cbindgen and rust support const generics, it seems more simple.

This centralizes all the relevant font constants etc in rust and avoids
conversions when going from rust to C++ and vice versa.

Differential Revision: https://phabricator.services.mozilla.com/D148847
2022-06-12 10:48:58 +00:00
Emilio Cobos Álvarez 9349aeea85 Bug 1771796 - Remove -moz-scrollbar-thumb-proportional. r=dholbert
It unconditionally matches on all platforms, so it's not returning any useful information.

Depends on D147689

Differential Revision: https://phabricator.services.mozilla.com/D147690
2022-06-02 11:58:18 +00:00
Emilio Cobos Álvarez f9b1d27b17 Bug 1771792 - Remove some dead vibrancy code. r=mstange
Drive-by cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D147698
2022-05-31 10:43:29 +00:00
criss 9933879ba5 Backed out changeset 68b233bf0519 (bug 1771792) for causing xpcshell failures on test_css-properties-db.js . CLOSED TREE 2022-05-31 02:06:55 +03:00
Emilio Cobos Álvarez 22ec54e75f Bug 1771792 - Remove some dead vibrancy code. r=mstange
Drive-by cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D147698
2022-05-30 22:17:11 +00:00
Emilio Cobos Álvarez b73c08693f Bug 1768004 - Remove proton places tooltip code. r=dao
There's nobody working on it, and tooltips should hopefully be nice
enough after recent changes (bug 1765423).

Having it enabled causes artifacts like bug 1767815 comment 3. We can
always rescue this from hg history if needed.

Differential Revision: https://phabricator.services.mozilla.com/D145621
2022-05-05 16:18:17 +00:00
Emilio Cobos Álvarez b8f1a27f5a Bug 1761923 - Make some shadow colors react to dark mode in GTK/Cocoa. r=mstange
This matches Windows' behavior.

Differential Revision: https://phabricator.services.mozilla.com/D142319
2022-04-06 17:16:41 +00:00
Emilio Cobos Álvarez a18fdda05d Bug 1762298 - GCC build bustage and reftest fixes.
MANUAL PUSH: Orange fix CLOSED TREE
2022-04-04 22:14:24 +02:00
Emilio Cobos Álvarez cae6641413 Bug 1761923 - Add generic Buttonshadow support.
MANUAL PUSH: Fixes orange CLOSED TREE
2022-04-04 22:00:28 +02:00
Emilio Cobos Álvarez e47024038c Bug 1762018 - Derive a color scheme when forcing preference colors. r=morgan
This patch is a bit bigger than I'd like, but it's mostly moving code
around to centralize the color/color-scheme decisions we make when
forcing colors.

In practice, the only behavior change should be that when "use system
colors" is false and we force colors, we force a color-scheme that
matches the user-chosen background (via the LookAndFeel::IsDarkColor
check).

That should make sure that text from system colors is light and matches
the user expectations.

Before this patch, we used to force the color-scheme to light, but that
was just so that we ended up looking at mLightColors. Instead, we
achieve that via a separate bit (mForcedLightColorSet, naming up for
debate, not a fan), so that we can use the right system colors
otherwise.

Another alternative I considered is making all non-link system colors
return mDefaultBackground / mDefault depending on whether they are
background / foreground colors. That seemed a lot more work and
potentially a regression in various ways. I think this should be
strictly an improvement instead.

Differential Revision: https://phabricator.services.mozilla.com/D142423
2022-04-01 01:21:22 +00:00
Cristian Tuns da85cd4a66 Backed out changeset 5d97c7b1b9b5 (bug 1762018) for causing mochitest failures in test_bug232227.html CLOSED TREE 2022-03-31 19:12:48 -04:00
Emilio Cobos Álvarez 0555de1ae2 Bug 1762018 - Derive a color scheme when forcing preference colors. r=morgan
This patch is a bit bigger than I'd like, but it's mostly moving code
around to centralize the color/color-scheme decisions we make when
forcing colors.

In practice, the only behavior change should be that when "use system
colors" is false and we force colors, we force a color-scheme that
matches the user-chosen background (via the LookAndFeel::IsDarkColor
check).

That should make sure that text from system colors is light and matches
the user expectations.

Before this patch, we used to force the color-scheme to light, but that
was just so that we ended up looking at mLightColors. Instead, we
achieve that via a separate bit (mForcedLightColorSet, naming up for
debate, not a fan), so that we can use the right system colors
otherwise.

Another alternative I considered is making all non-link system colors
return mDefaultBackground / mDefault depending on whether they are
background / foreground colors. That seemed a lot more work and
potentially a regression in various ways. I think this should be
strictly an improvement instead.

Differential Revision: https://phabricator.services.mozilla.com/D142423
2022-03-31 22:03:09 +00:00
Brad Werth ac55f07b1b Bug 1751217 Part 4: Make macOS declare video-dynamic-range: high with new-enough OS. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D141056
2022-03-24 18:19:50 +00:00
Butkovits Atila fbd6ad4819 Backed out 5 changesets (bug 1751217) for causing failures at dynamic-range.html. CLOSED TREE
Backed out changeset f0a4879c9709 (bug 1751217)
Backed out changeset 50b6310935d4 (bug 1751217)
Backed out changeset bfa455b8bb1a (bug 1751217)
Backed out changeset 277064a1facb (bug 1751217)
Backed out changeset 21e1650b12db (bug 1751217)
2022-03-23 22:22:54 +02:00
Brad Werth c2a8cb2d17 Bug 1751217 Part 4: Make macOS declare video-dynamic-range: high with new-enough OS. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D141056
2022-03-23 18:23:01 +00:00
Marian-Vasile Laza 77029463ac Backed out 5 changesets (bug 1751217) for causing wpt(Screen-pixelDepth-Screen-colorDepth001.html) and mochitest(test_media_queries.html) failures. CLOSED TREE
Backed out changeset 60a4497fd1f5 (bug 1751217)
Backed out changeset 785f4c5f719d (bug 1751217)
Backed out changeset 81e41f7a1ee4 (bug 1751217)
Backed out changeset d35c5648c936 (bug 1751217)
Backed out changeset f16305c6ec83 (bug 1751217)
2022-03-23 10:11:53 -07:00
Brad Werth e2d894d2e2 Bug 1751217 Part 4: Make macOS declare video-dynamic-range: high with new-enough OS. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D141056
2022-03-23 15:24:39 +00:00
Emilio Cobos Álvarez 5950d7b598 Bug 1736218 - Stop using heuristics to determine content color-scheme. r=dao
Use system color-scheme for content for anything that isn't explicitly
opted into.

Differential Revision: https://phabricator.services.mozilla.com/D140376
2022-03-17 14:44:04 +00:00
Emilio Cobos Álvarez 3d2bf29691 Bug 1750932 - Add color_scheme / content_color_scheme properties to theme API. r=robwu,dao
This allows themes to override our light / dark theme heuristics if they
choose to, so that we don't have to complicate the heuristics too much.

This is specially useful for themes with images, where the image might
be "light", but still have enough contrast with light text. A good
example is the theme mentioned in bug 1749837 comment 0.

The semantics are:

 * color_scheme: If set, overrides the general "toolbar theme" (so
   window and context menu appearance and so on), otherwise we fall back
   to heuristics.

 * content_color_scheme: If set, overrides the color scheme for the
   content area. Otherwise we fall back to color_scheme if present, or
   heuristics otherwise.

One thing that I didn't include was a sort of "system" option, which
might be useful to say "this theme is neutral, and works both for light
and dark themes". Let me know if you think that's a must-have, otherwise
I think it's probably worth deferring to a follow-up if it's needed at
all.

Differential Revision: https://phabricator.services.mozilla.com/D136354
2022-03-17 14:44:03 +00:00
Emilio Cobos Álvarez e7bfa879da Bug 1736218 - Expose theme-derived color-scheme to privileged code. r=Gijs
This will be needed to determine whether following the Firefox theme
would produce light or dark colors.

Differential Revision: https://phabricator.services.mozilla.com/D140221
2022-03-04 13:08:30 +00:00
Emilio Cobos Álvarez 96533d3817 Bug 1756082 - Properly support ui.systemUsesDarkMode switching on Linux. r=karlt
So the issue here is that GTK's nsLookAndFeel doesn't know about the
effective value of the pref, and thus ends up potentially choosing the
wrong GTK theme (and thus choosing light system colors, but thinking
that we can paint the textfield background natively with GTK, which
would have a dark background, for example).

The right fix here is treating the pref as a stronger hint than the
ColorSchemePreference that we compute from DBUS for the same purpose.
This makes us follow the same code-path as if the system had specified
dark mode itself, fixing the contrast issue.

While at it, fix dynamic changes to this pref, which need to update
system colors.

Differential Revision: https://phabricator.services.mozilla.com/D139093
2022-02-21 10:04:57 +00:00
Emilio Cobos Álvarez c7de191b45 Bug 1147847 - Allow users to enable overlay scrollbars on Linux from about:preferences. r=Gijs,fluent-reviewers,preferences-reviewers
We might want to do this on Windows 11 as well, but Windows 11 has a
system-wide preference with UI so let's not do that just yet at least,
UI-exposed preference.

Differential Revision: https://phabricator.services.mozilla.com/D138502
2022-02-14 07:43:42 +00:00
Emilio Cobos Álvarez 5fed8de04b Bug 1754547 - Generalize moz-os-version into moz-platform. r=dao,preferences-reviewers,Gijs
Allow differentiating non-windows platforms on it.

Differential Revision: https://phabricator.services.mozilla.com/D138431
2022-02-10 15:50:31 +00:00
Emilio Cobos Álvarez 7346b0b19c Bug 1750483 - Add a generic dark color for ThreeDFace. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D136405
2022-01-19 19:33:34 +00:00
Emilio Cobos Álvarez 9db1237953 Bug 1750330 - Move global LookAndFeel changes to mozilla::LookAndFeel. r=mstange
So that the changes don't get lost when there's no PresShell in the
process.

Differential Revision: https://phabricator.services.mozilla.com/D136155
2022-01-17 16:34:11 +00:00
Emilio Cobos Álvarez de7b391af7 Bug 1749645 - Rename nsNativeBasicTheme{,Cocoa} to Theme{,Cocoa}. r=mstange
We have this situation right now where all the themes are inheriting from
nsNativeBasicTheme. Rename it to a nicer name, and clean up some code while at
it.

In the future I'd like to simplify the inheritance chain to remove
nsNativeTheme altogether (so that all nsITheme implementations use
mozilla::widget::Theme).

That's not hard to do mechanically, but rather than dumping all of
nsNativeTheme into Theme I'd like to do it a bit more carefully, to hopefully
remove a lot of the helpers that nsNativeTheme has to deal with XUL and so on
and use something nicer. Eventually the inheritance chain will be something
like:

 * nsITheme : public nsISupports
 * Theme : public nsITheme, public nsITimerCallback, public nsINamed
 * ThemeCocoa : public Theme
 * nsNativeThemeCocoa : public ThemeCocoa
 * nsNativeThemeWin : public Theme
 * nsNativeThemeGtk : public Theme

Differential Revision: https://phabricator.services.mozilla.com/D135668
2022-01-12 16:33:31 +00:00
Xidorn Quan 855814f769 Bug 1748190 - Convert findbar.modalHighlight from static pref to dynamic one. r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D134937
2022-01-03 06:27:03 +00:00
Emilio Cobos Álvarez b4eb3f9643 Bug 1745894 - Don't draw window decorations when painting headerbar on wayland. r=stransky
This is a better fix for the double decorations than clipping them using
CSS.

Differential Revision: https://phabricator.services.mozilla.com/D133871
2021-12-15 13:12:01 +00:00
Andi-Bogdan Postelnicu 359e82a664 Bug 1519636 - Reformat recent changes to the Google coding style. r=sylvestre
Updated with clang-format version 13.0.0 (taskcluster-cMIjs2JaRe6fqM2zK7ZACQ)

Differential Revision: https://phabricator.services.mozilla.com/D132868
2021-12-05 19:04:18 +00:00
Emilio Cobos Álvarez 2abc89c41e Bug 1509931 - Use titlebar radius on Linux and make titlebar set-up work for lightweight themes. r=stransky,dao
To do this, we always draw the native titlebar behind the toolbox, and
then make the toolbox adapt to it by using the titlebar radius. This
makes us preserve the shadow properly.

On Wayland we'd double-draw the shadow (see bug 1509931 comment 4) so
this fixes it by trimming it as well using border-radius.

Differential Revision: https://phabricator.services.mozilla.com/D128681
2021-12-01 18:15:12 +00:00
Emilio Cobos Álvarez f869c28593 Bug 1740518 - Remove allow-gtk-dark-theme special-case in color-scheme computation. r=mstange
See the comments as for why. If as a user you want to get this behavior
you could put something like:

  :root { color-scheme: light dark }

in a user stylesheet, but that could cause the same contrast issues the
allow-gtk-dark-theme pref has now.

Differential Revision: https://phabricator.services.mozilla.com/D132361
2021-11-29 21:49:42 +00:00