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

86 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 446bae08de Bug 1741495 - Make ThemeDrawsFocusForWidget return the right thing when drawing non-native widgets on Linux and Windows. r=spohl
Noticed this while digging into bug 1741359.

Differential Revision: https://phabricator.services.mozilla.com/D131277
2021-11-17 00:55:26 +00:00
Stephen A Pohl 73c5f21015 Bug 1719427: Move scrollbar size information from prefs to C++ and allow sizing to be overridden via prefs. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D130671
2021-11-15 12:39:39 +00:00
Stephen A Pohl b739277c24 Bug 1719427: Refactor scrollbar drawing code across platforms. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D129265
2021-11-15 12:39:38 +00:00
criss 8ace361058 Backed out 4 changesets (bug 1719427) for causing build bustages. CLOSED TREE
Backed out changeset d6948ef7f495 (bug 1719427)
Backed out changeset 4df7017f6bc9 (bug 1719427)
Backed out changeset 8c5bb08f80e9 (bug 1719427)
Backed out changeset e32004dd2014 (bug 1719427)
2021-11-15 13:46:20 +02:00
Stephen A Pohl 78a1e8621c Bug 1719427: Move scrollbar size information from prefs to C++ and allow sizing to be overridden via prefs. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D130671
2021-11-15 11:15:56 +00:00
Stephen A Pohl 0468798e53 Bug 1719427: Refactor scrollbar drawing code across platforms. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D129265
2021-11-15 11:15:54 +00:00
Emilio Cobos Álvarez 6b058cc559 Bug 1737322 - Use a semi-transparent dark color for middle of the focus outline in dark mode. r=mstange
Make both the light and dark colors less opaque too, since even in light
mode it looks very off IMO for stuff like:

  data:text/html,<body bgcolor=grey><input>

Differential Revision: https://phabricator.services.mozilla.com/D129302
2021-10-25 16:44:04 +00:00
Emilio Cobos Álvarez 4f8856c545 Bug 1730503 - Make RDM force Android-style scrollbars better. r=mstange,devtools-backward-compat-reviewers,nchevobbe
There are a few bits that still don't work with this patch but will with the
following patches.

Differential Revision: https://phabricator.services.mozilla.com/D128083
2021-10-12 09:21:17 +00:00
Emilio Cobos Álvarez 2095f9d26f Bug 1735077 - Don't change indeterminate radio rendering, as that's apparently a thing.
MANUAL PUSH: Trivial reftest fix CLOSED TREE.
2021-10-11 15:52:27 +02:00
Emilio Cobos Álvarez 745866d09d Bug 1735077 - Fix rendering of <input type=checkbox/radio disabled checked>. r=jwatt
The simplification in bug 1734115 missed this case.

Differential Revision: https://phabricator.services.mozilla.com/D128054
2021-10-11 12:45:01 +00:00
Emilio Cobos Alvarez f03b517ce2 Bug 1734723 - Don't use transparent borders for checkbox/radio when focused. r=mstange
As those don't draw the outline on top.

Differential Revision: https://phabricator.services.mozilla.com/D127890
2021-10-08 10:59:02 +00:00
Emilio Cobos Álvarez e50c80851e Bug 1734115 - Add basic support for dark form controls to nsNativeBasicTheme. r=mstange
For that:

 * Tweak the standin system colors to match the non-native theme.

 * Use those system colors for button and field backgrounds.

 * Rename the "should use system colors" bit to "is high contrast",
   which is what it really is (specially now that we use system colors
   also in non-high-contrast).

Border colors and other colors like the <input type=range> and such
might need some extra tweaking perhaps, but this is a decent start and
looks good in https://crisal.io/tmp/form-controls.html afaict (dark mode
toggle needs the color-scheme pref enabled of course).

Differential Revision: https://phabricator.services.mozilla.com/D127533
2021-10-05 14:40:52 +00:00
Emilio Cobos Álvarez e2d6174424 Bug 1734010 - Remove unneeded special-case for datetime reset button in nsNativeBasicTheme. r=jwatt
The button specifies background-color: transparent in an author
stylesheet and thus is unthemed:

  https://searchfox.org/mozilla-central/rev/25002b534963ad95ff0c1a3dd0f906ba023ddc8e/toolkit/content/widgets/datetimebox.css#53

While at it, simplify similar code / remove unneeded includes.

Differential Revision: https://phabricator.services.mozilla.com/D127486
2021-10-05 13:55:41 +00:00
Emilio Cobos Álvarez faacceefe2 Bug 1734009 - Pass color-related arguments down to the non-native theme in a more convenient way. r=dholbert
This avoids adding yet another parameter for the light/dark
color-scheme.

This shouldn't have any behavior change, but is a prerequisite to
implement dark form controls on the non-native theme.

Differential Revision: https://phabricator.services.mozilla.com/D127482
2021-10-05 09:40:00 +00:00
Emilio Cobos Álvarez cd1744924f Bug 1722397 - Add a way to use the native accent color for selection and form controls on Android. r=agi
I tied it to the use-theme-accent bit in non-native-theme just for
convenience (so that form controls just react to this).

This works nicely, but I didn't turn this on by default because the
accessiblecaret images are hardcoded-blue pngs, and they look ugly
without being the same color as the native accent.

Differential Revision: https://phabricator.services.mozilla.com/D120898
2021-07-27 17:12:15 +00:00
Emilio Cobos Alvarez ec3cfdc989 Bug 1717245 - Don't use system colors in the non-native theme if we're not painting backgrounds. r=mstange
(Like for printing with backgrounds disabled).

Otherwise layout darkens our foreground colors etc, and that causes contrast to
be poor.

Since the point of not painting backgrounds is saving ink, using the
regular colors seems fine.

Differential Revision: https://phabricator.services.mozilla.com/D118276
2021-06-22 10:43:17 +00:00
Emilio Cobos Álvarez f2a6ce01df Bug 1690954 - Draw the menulist arrow button using currentColor rather than a fixed color. r=jfkthame
As its background might not be themed.

Differential Revision: https://phabricator.services.mozilla.com/D115194
2021-05-17 12:11:15 +00:00
Emilio Cobos Álvarez a3cdeb05e3 Bug 1705605 - Fix GCC build.
MANUAL PUSH: Base toolchains build fix CLOSED TREE
2021-04-27 13:52:34 +02:00
Emilio Cobos Álvarez 34a9a0f457 Bug 1705605 - Implement accent-color in nsNativeBasicTheme. r=mstange
This is a new addition for CSS UI Level 4:

  https://drafts.csswg.org/css-ui-4/#widget-accent

I want to provide feedback on some spec issues, and thought it was a
kinda neat thing to prototype (it also makes testing contrast and such
with random GTK themes easier).

For now enable for Nightly only.

Differential Revision: https://phabricator.services.mozilla.com/D112312
2021-04-27 10:41:00 +00:00
Emilio Cobos Alvarez 9ac846cb5c Bug 1703604 - When using a transparent scrollbar button / track color, use the thumb color to paint the scrollbar arrow. r=spohl
This improves the rendering of youtube.com on Windows, and I think should be uncontroversial.

scrollbar-color: transparent transparent will still get you the fully transparent scrollbar.

Differential Revision: https://phabricator.services.mozilla.com/D111137
2021-04-08 09:48:01 +00:00
Butkovits Atila 933498728f Backed out changeset 47b38a36e71a (bug 1703604) for causing bustages at nsNativeBasicThemeGTK.cpp. CLOSED TREE 2021-04-08 02:55:47 +03:00
Emilio Cobos Alvarez 25c7684295 Bug 1703604 - When using a transparent scrollbar button / track color, use the thumb color to paint the scrollbar arrow. r=spohl
This improves the rendering of youtube.com on Windows, and I think should be uncontroversial.

scrollbar-color: transparent transparent will still get you the fully transparent scrollbar.

Differential Revision: https://phabricator.services.mozilla.com/D111137
2021-04-07 19:41:17 +00:00
Emilio Cobos Álvarez 03f14a4edc Bug 1701846 - Make setting overlay scrollbars on GTK do something sane-ish. r=mstange
So that they work sorta similar to the native ones. This is intended
mostly for testing, but hey, if someone is motivated enough...

I haven't tracked the native gtk overlay scrollbar durations down,
someone motivated enough could do that if they wanted to. But this seems
close enough.

Differential Revision: https://phabricator.services.mozilla.com/D110192
2021-03-30 03:31:21 +00:00
Emilio Cobos Álvarez 5cbba9b317 Bug 1699937 - Don't draw focus outlines for box-shadow in the non-native theme. r=mstange
This is a relatively easy way to improve the rendering with the
non-native theme while not regressing anything.

In the future, once non-native-theme is shipped and default everywhere,
I think we could provide something like:

  bool nsITheme::GetShadowRect(nsIFrame*, StyleAppearance, LayoutDeviceRect&, RectCornerRadii&)

or such, where we can provide a precise rect + radii, and we would avoid
painting the shadow if the function returned false. That would allow us
to remove the native theme box shadow code path, and avoid WR fallback,
all at once.

Differential Revision: https://phabricator.services.mozilla.com/D109209
2021-03-20 23:08:11 +00:00
Emilio Cobos Alvarez 31b583bbcc Bug 1698783 - Respect Windows' system scrollbar sizes. r=mstange
Depends on D108960

Differential Revision: https://phabricator.services.mozilla.com/D108973
2021-03-18 19:12:49 +00:00
Emilio Cobos Álvarez 2ef90f0690 Bug 1698783 - Make non-native scrollbar size configurable in Windows too. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D108960
2021-03-18 19:12:49 +00:00
Emilio Cobos Álvarez f717a6f4db Bug 1698336 - Fix high contrast rendering of <meter>. r=mstange
Using the same color for the track and the meter chunk is not going to
fly of course...

In high contrast, make the colors consistent with <progress>, which
seems like a reasonable thing to do.

Differential Revision: https://phabricator.services.mozilla.com/D108347
2021-03-15 21:06:54 +00:00
Emilio Cobos Álvarez 2950a6ee21 Bug 1698302 - Paint progress/meter chunks along with the track. r=mstange
The progress chunk already has the right size, but it's easier to get
the right clipping if we just paint it as part of the progress bar.

This is much like we paint the range track and thumb. We apply the
native appearance atomically so this should be fine.

Differential Revision: https://phabricator.services.mozilla.com/D108335
2021-03-15 21:01:08 +00:00
Emilio Cobos Álvarez de1f51fa10 Bug 1697467 - Push the high contrast code from nsNativeBasicThemeWin to nsNativeBasicTheme. r=mstange
Linux can also have high contrast (and mac, if you tweak prefs, but
let's assume that doesn't happen), so no reason we shouldn't share this
code.

One related simplification while I was doing this code move is that I
managed to remove the scrollbar "border" code. Turns out that Windows
was overriding ComputeScrollbarColors so that border and track colors
were always the same, and Linux was ignoring the border anyways, so with
this we can simplfiy the implementation a bit (as the Linux scrollbar
track / corner code can be shared with Windows now).

Differential Revision: https://phabricator.services.mozilla.com/D107863
2021-03-12 14:44:13 +00:00
Emilio Cobos Álvarez 692aa3d131 Bug 1697210 - Make the checkbox / radio rect paint to an exact number of device pixels. r=mstange
This used to be the case (for default-sized radio buttons anyways)
before bug 1693688 (since GetMinimumWidgetSize returns a
LayoutDeviceIntSize, which rounded).

With the previous patch we never see uneven borders, but the radio might
be e.g. one pixel taller than its width, which also looks odd. So
truncate to device pixels to avoid it.

Differential Revision: https://phabricator.services.mozilla.com/D107810
2021-03-12 11:25:49 +00:00
Emilio Cobos Álvarez 4f99f41d10 Bug 1697210 - Paint radio checkmark as part of nsNativeBasicTheme::PaintRadioControl, and snap the checkmark inset. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D107809
2021-03-12 11:25:49 +00:00
Emilio Cobos Álvarez 0f8e07ccf7 Bug 1696988 - Support tooltips in nsNativeBasicThemeCocoa. r=mstange
Not sure if you prefer to go this way, your call.

Depends on D107574

Differential Revision: https://phabricator.services.mozilla.com/D107575
2021-03-09 00:05:51 +00:00
Emilio Cobos Alvarez babc9888a5 Bug 1695741 - Choose more round points for windows scroll button arrows. r=mstange
This should help with fuzziness in some tests, and also look nicer.

Differential Revision: https://phabricator.services.mozilla.com/D106823
2021-03-01 22:55:37 +00:00
Emilio Cobos Álvarez 03fd22c802 Bug 1694059 - Use WebRender to render non-native range inputs and radio buttons. r=mstange
The only thing missing now are things that draw arrows / checkmarks.

Make the disabled range thumb opaque, to avoid dealing with clipping
(also matches all other browsers, fwiw).

Differential Revision: https://phabricator.services.mozilla.com/D106011
2021-02-23 23:22:19 +00:00
Cosmin Sabou 51f713408b Backed out changeset 3bf5d4016ea7 (bug 1694059) for input range reftest failures. CLOSED TREE 2021-02-23 14:25:35 +02:00
Emilio Cobos Álvarez 3ae296b53c Bug 1694059 - Use WebRender to render non-native range inputs and checkboxes. r=mstange
The only thing missing now are things that draw arrows / checkmarks.

Make the disabled range thumb opaque, to avoid dealing with clipping
(also matches all other browsers, fwiw).

Differential Revision: https://phabricator.services.mozilla.com/D106011
2021-02-23 10:51:37 +00:00
Emilio Cobos Álvarez 7f2b3314e0 Bug 1694059 - Use WebRender to render most non-native-theme widgets when possible. r=mstange
We basically use a couple primitives to draw these
(PaintRoundedRectWithRadius, FillRect), so making the code a bit generic
implementing stuff with WebRender seems straight-forward.

I've kept using the fallback codepath for the bits that draw complex
paths like arrows and such, but the rest of the things should work with
this patch.

A thing I'm not too happy about is the scrollbar painting setup (requires a lot
of boilerplate), but modulo template hacks make nsNativeBasicTheme a template
that receives its super class as a parameter or something) it seems hard to do
better.

Differential Revision: https://phabricator.services.mozilla.com/D105931
2021-02-23 10:49:37 +00:00
smolnar 7f2e38a6b3 Backed out changeset 960cb2cf2009 (bug 1694059) for causing reftest failures. 2021-02-23 06:41:58 +02:00
Emilio Cobos Álvarez c0fec9f98e Bug 1694059 - Use WebRender to render most non-native-theme widgets when possible. r=mstange
We basically use a couple primitives to draw these
(PaintRoundedRectWithRadius, FillRect), so making the code a bit generic
implementing stuff with WebRender seems straight-forward.

I've kept using the fallback codepath for the bits that draw complex
paths like arrows and such, but the rest of the things should work with
this patch.

A thing I'm not too happy about is the scrollbar painting setup (requires a lot
of boilerplate), but modulo template hacks make nsNativeBasicTheme a template
that receives its super class as a parameter or something) it seems hard to do
better.

Differential Revision: https://phabricator.services.mozilla.com/D105931
2021-02-23 02:58:47 +00:00
smolnar 79ca2f76fa Backed out changeset 4436a8bb02fd (bug 1694059) for causing reftest failures. CLOSED TREE 2021-02-23 04:17:14 +02:00
Emilio Cobos Álvarez cb286403d0 Bug 1694059 - Use WebRender to render most non-native-theme widgets when possible. r=mstange
We basically use a couple primitives to draw these
(PaintRoundedRectWithRadius, FillRect), so making the code a bit generic
implementing stuff with WebRender seems straight-forward.

I've kept using the fallback codepath for the bits that draw complex
paths like arrows and such, but the rest of the things should work with
this patch.

A thing I'm not too happy about is the scrollbar painting setup (requires a lot
of boilerplate), but modulo template hacks make nsNativeBasicTheme a template
that receives its super class as a parameter or something) it seems hard to do
better.

Differential Revision: https://phabricator.services.mozilla.com/D105931
2021-02-23 01:10:22 +00:00
Emilio Cobos Álvarez 965efb55a0 Bug 1694059 - Pass draw target by reference in non-native widget code. r=mstange
And remove some useless argument names. This is just preparation for the next
patch and shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D105930
2021-02-22 16:18:33 +00:00
Emilio Cobos Álvarez 6825bbc8f8 Bug 1693688 - Make the non-native theme not return minimum sizes for checkboxes (and most other widgets). r=spohl,mstange
This matches closer what Chrome and Safari do (Safari paints outside of
the box when this happens, but the layout box still respects the
author), see:

  data:text/html,<button style="padding: 0; width: 0">
  data:text/html,<input type=checkbox style="width: 0">

Etc. For checkboxes, this matches what OSX does, too.

Since we still want checkboxes to be slightly larger than what they'd be
otherwise, we add a hook to tweak it when non-native theme is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D105798
2021-02-20 00:13:10 +00:00
Noemi Erli 73493a49e5 Backed out 2 changesets (bug 1693688) for causing failures in browser_options-view-01.js CLOSED TREE
Backed out changeset d0bd198837ee (bug 1693688)
Backed out changeset e0b1f4b79d4b (bug 1693688)
2021-02-19 23:39:07 +02:00
Emilio Cobos Álvarez d1915bcf15 Bug 1693688 - Make the non-native theme not return minimum sizes for checkboxes (and most other widgets). r=spohl,mstange
This matches closer what Chrome and Safari do (Safari paints outside of
the box when this happens, but the layout box still respects the
author), see:

  data:text/html,<button style="padding: 0; width: 0">
  data:text/html,<input type=checkbox style="width: 0">

Etc. For checkboxes, this matches what OSX does, too.

Since we still want checkboxes to be slightly larger than what they'd be
otherwise, we add a hook to tweak it when non-native theme is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D105798
2021-02-19 18:42:17 +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
Emilio Cobos Álvarez 2cbb8a03f1 Bug 1691064 - Make outline-style auto follow border radii. r=mstange
This matches Safari and improves the rendering when this shows by
default on unthemed form controls.

Differential Revision: https://phabricator.services.mozilla.com/D104322
2021-02-08 16:25:16 +00:00
Emilio Cobos Álvarez e531b2b7fd Bug 1689615 - Only paint one outline for outline-style:auto with nnt. r=mstange
outline-style: auto might show up in non-themed controls and such, and
the double-outline there might look ugly.

Following border-radius would be an extra improvement for the reddit
case, but no platform does it currently (Safari on macOS does it), so
let's consider that in a follow-up.

Differential Revision: https://phabricator.services.mozilla.com/D104214
2021-02-05 16:25:57 +00:00
Emilio Cobos Álvarez 5d9da34947 Bug 1690700 - Improve scrollbars for non-native GTK theme. r=mstange
This is based on the windows implementation and has two nice things:

 * Makes scrollbar-color react to active / hover state, like on Windows.
 * Implements dark scrollbar support.

Differential Revision: https://phabricator.services.mozilla.com/D103969
2021-02-04 16:15:27 +00:00
Emilio Cobos Álvarez e7cfc6d6f2 Bug 1690043 - Remove requirement for root scrollbars to be opaque in the non-native theme. r=mstange
This seems to come from bug 1179780, but custom scrollbars shouldn't
have this requirement, and it's kind of artificial anyway.

Differential Revision: https://phabricator.services.mozilla.com/D103692
2021-02-01 19:32:09 +00:00