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

71 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez a7773ac831 Bug 1679208 - Use more strongly typed rects in nsNativeBasicTheme. r=heycam
As per review comments.

Depends on D97937

Differential Revision: https://phabricator.services.mozilla.com/D98099
2020-11-29 22:19:10 +00:00
Emilio Cobos Alvarez ab2154bd1b Bug 1679208 - Improve non-native theme with fractional scaling. r=heycam
This greatly improves non-native theme on Windows in presence of fractional DPI
(see bug 1657191).

This matches what the Windows native theme does, to my knowledge, see
ScaleForFrameDPI in nsNativeThemeWin.h.

However I think the right fix is to not make these LayoutDeviceInt* things but
LayoutDevice*.

That's a bigger fix, and fits well as a follow-up to this bug, so let's land
this in the meantime.

Differential Revision: https://phabricator.services.mozilla.com/D97937
2020-11-30 04:48:07 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Emilio Cobos Álvarez 2fff1fa936 Bug 1678194 - Only paint focusrings in the non-native theme when the focusring pseudo-classes apply. r=mstange
This prevents outlines from showing up every time you click on a
checkbox (on non-mac), for example.

Differential Revision: https://phabricator.services.mozilla.com/D97523
2020-11-19 02:15:44 +00:00
Stephen A Pohl c2000738cd Bug 1675015: Add Windows high contrast support to non-native theme. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D96803
2020-11-17 20:53:01 +00:00
Emilio Cobos Álvarez 4d284ec375 Bug 1620360 - Support outline-style: auto in the non-native theme. r=mstange
This is arguably a big outline compared with the usual one, so if it
somehow caused problems (which it really shouldn't because outline is
ink overflow rather than scrollable overflow) we could avoid painting
the second ring or such.

Differential Revision: https://phabricator.services.mozilla.com/D97157
2020-11-16 16:53:23 +00:00
Markus Stange 1958913b1e Bug 1674010 - Draw a shadow under the range thumb in the basic theme. r=spohl
What's implemented in this patch doesn't match the spec to 100%, but it comes
pretty close. This patch is cutting two corners: We're only using one shadow
instead of two, and we're using a smaller blur radius (2 instead of 2 and 4).
Both adjustments are done to improve performance; blurring is a computationally
expensive operation, so we should minimize its cost.

As the shadow color, I'm using a transparent black instead of a transparent
gray, because this makes it easier to do the blurring on an A8 surface rather
than on a full RGBA surface, given the current Moz2D API.

Differential Revision: https://phabricator.services.mozilla.com/D95090
2020-11-02 17:09:05 +00:00
Markus Stange 3caf85f6a6 Bug 1671704 - Add nsNativeBasicTheme::PaintScrollbarTrack which does nothing by default. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D95078
2020-11-02 17:09:00 +00:00
Markus Stange 2b0dcca520 Bug 1671704 - Give scrollbar painting functions access to the nsIFrame*. r=spohl
The Mac theme will need this to check for RTL, and for whether the scrollbar has
the hover attribute, and for whether the scrollbar is on a dark background.

It looks like the philosophy of the virtual DrawScrollbar* methods was to supply
narrow pieces of information, instead of the frame itself. So this patch undoes
that separation of concerns.
In theory, we could grab the three pieces of state in
nsNativeBasicTheme::DrawWidgetBackground, but then we'd do a bunch of
computations (especially the "dark background" check) unnecessarily on platforms
that don't need them.

Differential Revision: https://phabricator.services.mozilla.com/D95077
2020-11-02 17:08:58 +00:00
Markus Stange 71c34591a0 Bug 1673923 - Draw the range thumb with the thumb rect. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D95032
2020-10-30 15:34:50 +00:00
Markus Stange c52ab8c422 Bug 1673287 - Clip out the range thumb when drawing the progress and track pieces. r=spohl
This makes the disabled state look good because the track pieces are no longer
visible behind the partially-transparent disabled thumb.

Differential Revision: https://phabricator.services.mozilla.com/D94701
2020-10-26 23:18:00 +00:00
Markus Stange 86bd737305 Bug 1673287 - Draw thumb as part of the range control. r=spohl
This makes the thumb respect the disabled, active and hover state of the range
control.

Differential Revision: https://phabricator.services.mozilla.com/D94700
2020-10-26 23:17:57 +00:00
Markus Stange 5288096ded Bug 1673287 - Draw range progress and track pieces with the same rounded rect but different rectangular clips. r=spohl
This feels a bit nicer but the difference isn't visible to the user.
But it demonstrates how we can fix progress bars.

Differential Revision: https://phabricator.services.mozilla.com/D94699
2020-10-26 23:17:50 +00:00
Markus Stange 716b39d928 Bug 1673121 - Simplify nsNativeBasicTheme scrollbar painting methods. r=spohl
This removes some duplication and replaces it with a bool aHorizontal parameter.
It also splits out scroll corner drawing into its own method.
And it consistently passes down the DPI ratio into all methods.

Drive-by fixes:
 - The border of horizontal scrollbars in the default theme now scales with the
   DPI ratio.
 - The border is device-pixel aligned by insetting the stroked rectangle by
   half the stroke width.

This patch also changes the scroll corner drawing in the default theme to no
longer draw a border on the left. We can revert that if needed

Differential Revision: https://phabricator.services.mozilla.com/D94662
2020-10-27 15:27:31 +00:00
Markus Stange af68ac4a30 Bug 1673132 - Use the -moz-default-appearance values "scrollbar-horizontal" and "scrollbar-vertical" on macOS and remove the now-unused value "scrollbar". r=emilio
Other platforms were already converted to scrollbar-horizontal and scrollbar-vertical in bug 1205643.

Differential Revision: https://phabricator.services.mozilla.com/D94674
2020-10-27 12:37:44 +00:00
Markus Stange cb8968058f Bug 1673132 - Remove "scrollbar-small" -moz-default-appearance value and replace its single use with scrollbar-width: thin. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D94673
2020-10-27 12:37:44 +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 0534c6ad1a Bug 1670853 - Support scrollbar-color and scrollbar-width on cross-platform and Linux non-native theme. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D93307
2020-10-15 04:54:41 +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 7105217e53 Bug 1670853 - Support scrollbar-color and scrollbar-width on cross-platform and Linux non-native theme. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D93307
2020-10-15 00:24:06 +00:00
Cameron McCormack 37c635bfdc Bug 1669131 - Size and paint non-native theme scrollbars to emulate native non-overlay Gtk scrollbars. r=spohl
This doesn't yet use theme-derived colors, and also doesn't yet
support window active state dependent colors.

Differential Revision: https://phabricator.services.mozilla.com/D92368
2020-10-05 21:15:18 +00:00
Emilio Cobos Álvarez 5e1e2a4c05 Bug 1669173 - Keep active state even if not hovering over scrollbars. r=spohl
This is different than most of the form controls, but matches windows,
gtk, and common sense.

Differential Revision: https://phabricator.services.mozilla.com/D92382
2020-10-05 13:29:54 +00:00
Botond Ballo 01b3c7969d Bug 1667594 - Move nsLayoutUtils::RectCallback to namespace scope. r=emilio,jgilbert
This allows it to be forward-declared (while a nested class cannot be),
such that headers files that use RectCallback by pointer or reference
do not need to include nsLayoutUtils.h.

This avoids including nsLayoutUtils.h in nsRange.h.

Differential Revision: https://phabricator.services.mozilla.com/D91685
2020-09-30 21:06:47 +00:00
Emilio Cobos Álvarez c8cd713611 Bug 1656471 - Scrollbars and a bunch of other widgets should have no extra overflow. r=spohl
Otherwise we show the buttons underneath which is no good.

Differential Revision: https://phabricator.services.mozilla.com/D85568
2020-07-31 15:16:34 +00:00
Emilio Cobos Álvarez d04663f5aa Bug 1640195 - Remove using namespace from nsNativeBasicTheme.h. r=nical
Sorry, should've caught this during review.

Differential Revision: https://phabricator.services.mozilla.com/D85566
2020-07-31 12:04:29 +00:00
Stephen A Pohl 09651af1bd Bug 1640195: Address UX feedback for non-native widget styling. r=geckoview-reviewers,emilio,agi
Differential Revision: https://phabricator.services.mozilla.com/D76509
2020-07-30 17:02:02 +00:00
Noemi Erli 4d01914553 Backed out changeset 4fbc6775e743 (bug 1640195) for causing multiple failures CLOSED TREE 2020-07-30 02:58:03 +03:00
Stephen A Pohl 597bb7d3e0 Bug 1640195: Address UX feedback for non-native widget styling. r=geckoview-reviewers,emilio,agi
Differential Revision: https://phabricator.services.mozilla.com/D76509
2020-07-29 22:16:06 +00:00
Cameron McCormack c40850b854 Bug 1650256 - Remove unused StyleAppearance values. r=emilio
The parsing of these values was disabled in bug 1554150.

Differential Revision: https://phabricator.services.mozilla.com/D82122
2020-07-03 04:06:13 +00:00
Emilio Cobos Álvarez 8ca5b42689 Bug 1646558 - Remove the old android "native" theme. r=geckoview-reviewers,agi
We've had nsNativeBasicTheme enabled since 75, and all reported issues
were fixed real soon (and I haven't heard of any of them recently).

Given the non-native theme is likely changing in the future, I'd rather
not maintain three themes for Android :)

Differential Revision: https://phabricator.services.mozilla.com/D80105
2020-06-18 20:34:16 +00:00
Emilio Cobos Álvarez f0953195ce Bug 1636998 - Make ::-moz-focus-outer a no-op, and remove it on Nightly. r=jwatt
See https://bugzilla.mozilla.org/show_bug.cgi?id=932410#c2 for the
context for which this pseudo-element was added.

In the previous patch, I had to special-case range appearance because of
this pseudo-class, but that patch makes this pseudo-class completely
redundant, as now all form controls, themed and unthemed, display
outlines, unless the native theme displays a focus indicator on its own.

Remove the special case, and make ranges use outlines like everything
else rather than this bespoke pseudo-element.

Differential Revision: https://phabricator.services.mozilla.com/D74734
2020-05-18 10:54:16 +00:00
Csoregi Natalia f6ee95862e Backed out changeset 62ad26fbfaf8 (bug 1636998) for reftest failures on 1174332-1.html. CLOSED TREE 2020-05-18 13:31:56 +03:00
Emilio Cobos Álvarez 36b46408b8 Bug 1636998 - Make ::-moz-focus-outer a no-op, and remove it on Nightly. r=jwatt
See https://bugzilla.mozilla.org/show_bug.cgi?id=932410#c2 for the
context for which this pseudo-element was added.

In the previous patch, I had to special-case range appearance because of
this pseudo-class, but that patch makes this pseudo-class completely
redundant, as now all form controls, themed and unthemed, display
outlines, unless the native theme displays a focus indicator on its own.

Remove the special case, and make ranges use outlines like everything
else rather than this bespoke pseudo-element.

Differential Revision: https://phabricator.services.mozilla.com/D74734
2020-05-18 07:59:32 +00:00
Emilio Cobos Álvarez 7a14870e23 Bug 1636998 - Only suppress auto-style outlines for widgets that paint their own focus indicator. r=jfkthame
Turns out we did have a hook for this already! But it is used to draw or
not inner button styles, so not quite equivalent.

I had to expand the amount of things it applies to because buttons and
such do paint focus indicators in all widgets. This patch could cause
some undesired outlines in some widgets. I hope not (I tried to audit to
the best of my knowledge), but in that case they'd be just more values
to add to the list.

Differential Revision: https://phabricator.services.mozilla.com/D74733
2020-05-13 20:38:26 +00:00
Narcis Beleuzu 23b4220599 Backed out changeset f5546bfc9604 (bug 1636998) for reftest failures on 1174332-1.html . CLOSED TREE 2020-05-13 23:22:56 +03:00
Emilio Cobos Álvarez dbbe7901c1 Bug 1636998 - Only suppress auto-style outlines for widgets that paint their own focus indicator. r=jfkthame
Turns out we did have a hook for this already! But it is used to draw or
not inner button styles, so not quite equivalent.

I had to expand the amount of things it applies to because buttons and
such do paint focus indicators in all widgets. This patch could cause
some undesired outlines in some widgets. I hope not (I tried to audit to
the best of my knowledge), but in that case they'd be just more values
to add to the list.

Differential Revision: https://phabricator.services.mozilla.com/D74733
2020-05-13 14:47:07 +00:00
Emilio Cobos Álvarez 3e3dc71cba Bug 1631887 - Claim to support NonDisappearingScrollbarWidth on the non-native theme. r=spohl
This is used by platforms with overlay scrollbars, only in order to
reserve enough space for the chevron of the `<select>` element.

So our general min-widget-size, which is the same as for scrollbars
works.

Differential Revision: https://phabricator.services.mozilla.com/D71825
2020-04-22 17:45:39 +00:00
Bogdan Tara 62d94d25d6 Backed out changeset c7623d3b49ec (bug 1631887) for foreignObject-img-form-theme.html CLOSED TREE 2020-04-22 02:14:37 +03:00
Emilio Cobos Álvarez 2368532cda Bug 1631887 - Claim to support NonDisappearingScrollbarWidth on the non-native theme. r=spohl
This is used by platforms with overlay scrollbars, only in order to
reserve enough space for the chevron of the `<select>` element.

So our general min-widget-size, which is the same as for scrollbars
works.

Differential Revision: https://phabricator.services.mozilla.com/D71825
2020-04-21 20:36:22 +00:00
Emilio Cobos Álvarez e13b4495b3 Bug 1624708 - Make non-native theme keyboard navigable. r=spohl
By painting focus colors. I suspect this was mostly an oversight? But it is the
most obvious issue I always find with this theme.

I followed active > focus > hover, which seems to match what GTK does (and makes
sense, generally).

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

--HG--
extra : moz-landing-system : lando
2020-03-24 22:51:26 +00:00
Emilio Cobos Álvarez 53477db16b Bug 1624696 - Respect padding for all elements except checkbox/radio. r=spohl,mstange
Only button / menulist-button were missing from the hard-coded if condition. I
don't think we ever want to override author padding, and this can cause compat
issues as the one in this bug.

I'm making HasAuthorSpecifiedRules fast in bug 1624080, btw.

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

--HG--
extra : moz-landing-system : lando
2020-03-24 22:51:26 +00:00
Narcis Beleuzu 464f343178 Backed out changeset f3c5f5a1b35d (bug 1624696) for wpt failures on baseline-alignment-and-overflow.tentative.html . CLOSED TREE 2020-03-25 00:24:22 +02:00
Narcis Beleuzu 2f0ac811bf Backed out changeset 0ee82dc106f2 (bug 1624708) for reftest failure on 359903-1.html . CLOSED TREE 2020-03-25 00:22:30 +02:00
Emilio Cobos Álvarez 403e32fa76 Bug 1624708 - Make non-native theme keyboard navigable. r=spohl
By painting focus colors. I suspect this was mostly an oversight? But it is the
most obvious issue I always find with this theme.

I followed active > focus > hover, which seems to match what GTK does (and makes
sense, generally).

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

--HG--
extra : moz-landing-system : lando
2020-03-24 21:01:34 +00:00
Emilio Cobos Álvarez e1dadb10e3 Bug 1624696 - Respect padding for all elements except checkbox/radio. r=spohl,mstange
Only button / menulist-button were missing from the hard-coded if condition. I
don't think we ever want to override author padding, and this can cause compat
issues as the one in this bug.

I'm making HasAuthorSpecifiedRules fast in bug 1624080, btw.

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

--HG--
extra : moz-landing-system : lando
2020-03-24 21:02:12 +00:00
Emilio Cobos Álvarez 0f47b5390f Bug 1621319 - Implement GetWidgetBorder properly for some widgets. r=mstange
I've left checkbox / radio / range-thumb alone because they don't have borders
on gtk either. We need this for the next patch to fix our test.

In particular, our combination of padding + no border means that
sanityEventUtils tries to hit an <input>, but it hits the anonymous scrollable
element instead, and asserts that it doesn't.

I don't think that test is particularly correct, but implementing
GetWidgetBorder works around it, and seems like the right thing to do anyways.

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

--HG--
extra : moz-landing-system : lando
2020-03-11 01:52:51 +00:00
Dorel Luca cefe4ffd34 Backed out 3 changesets (bug 1621319) for Mochitest failures in Harness_sanity/test_sanityEventUtils.html
Backed out changeset 9181798549f2 (bug 1621319)
Backed out changeset 0522121ddf22 (bug 1621319)
Backed out changeset b65f1bde461a (bug 1621319)
2020-03-11 03:48:03 +02:00
Emilio Cobos Álvarez 5302c2ab15 Bug 1621319 - Implement GetWidgetBorder properly for some widgets. r=mstange
I've left checkbox / radio / range-thumb alone because they don't have borders
on gtk either. We need this for the next patch to fix our test.

In particular, our combination of padding + no border means that
sanityEventUtils tries to hit an <input>, but it hits the anonymous scrollable
element instead, and asserts that it doesn't.

I don't think that test is particularly correct, but implementing
GetWidgetBorder works around it, and seems like the right thing to do anyways.

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

--HG--
extra : moz-landing-system : lando
2020-03-10 19:33:56 +00:00