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

67 Коммитов

Автор SHA1 Сообщение Дата
Emilio Cobos Álvarez 288890e8bb Bug 1749645 - Remove unused native scrollbar drawing on gtk. r=stransky
We decided to keep it when initially making scrollbars non-native, but I think
it's time for it to go, since it's pretty much untested.

Nobody has complained about the non-native scrollbars in chrome documents, and
the GTK scrollbar implementation is not suitable for content because it doesn't
support scrollbar-width among other things.

Differential Revision: https://phabricator.services.mozilla.com/D135670
2022-01-12 17:06:12 +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
Emilio Cobos Álvarez 29770b5a23 Bug 1748150 - Make nsNativeThemeWin use correct native scrollbars. r=spohl
It was hard-coding Windows 10 scrollbars.

There's an argument to be made that maybe we should use
NonNativeScrollbarStyle() everywhere (perhaps except on RDM)?

Happy to make that change if you want.

There's no need for RDM to respect the non-native style override (changes to the
pref don't update gRDMInstance anyways).

Differential Revision: https://phabricator.services.mozilla.com/D134926
2022-01-03 17:45:51 +00:00
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 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 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 c84b3403f7 Bug 1733968 - Teach Linux to draw mismatched widgets using the non-native theme. r=mstange
This will make sure we can draw light textboxes with dark gtk themes and
so on.

I've kept the non-native-theme.enabled check, but perhaps we should
start removing that pref...

Differential Revision: https://phabricator.services.mozilla.com/D127649
2021-10-07 06:55:37 +00:00
Andi-Bogdan Postelnicu 1cf28e7475 Bug 1519636 - Reformat recent changes to the Google coding style. r=emilio
Updated with clang-format version 12.0.0 (taskcluster-KEgO7qdgQ8uaewA6NkRnRA)

Differential Revision: https://phabricator.services.mozilla.com/D115804
2021-05-24 15:08:47 +00:00
Emilio Cobos Álvarez e5950572b4 Bug 1710873 - Keep unconditionally returning true for nsNativeThemeGTK::ThemeSupportsScrollbarButtons. r=stransky
See bug 1710324 comment 9.

Differential Revision: https://phabricator.services.mozilla.com/D114987
2021-05-14 16:20:39 +00:00
Emilio Cobos Álvarez 2ecfa192c1 Bug 1710324 - Use non-native scrollbar drawing in nsNativeThemeGTK. r=stransky
Right now we paint scrollbars using gtk in nsNativeThemeGTK, and that
makes them look a bit inconsistent if the non-native implementation ends
up drawing them differently. I think scrollbars should look the same
regardless of where they're drawn.

This simplifies the code, and also brings proper scrollbar-{width,color}
support to the native theme, which is nice because Thunderbird uses it
if you use a theme there.

I opted for removing the code, but let me know if you'd rather keep it
behind the widget.non-native-theme.enabled pref or such.

Differential Revision: https://phabricator.services.mozilla.com/D114699
2021-05-11 13:57:18 +00:00
Emilio Cobos Álvarez fea89732e3 Bug 1710324 - nsNativeThemeGTK shouldn't need to be an nsIObserver. r=stransky
This is just cleanup. We have better ways to run code on shutdown (the pointer
to the theme object gets cleared on shutdown anyways).

Depends on D114697

Differential Revision: https://phabricator.services.mozilla.com/D114698
2021-05-11 13:57:18 +00:00
Csoregi Natalia e000635504 Backed out 3 changesets (bug 1710324) for causing mass failures and crashes. CLOSED TREE
Backed out changeset 7328372519f1 (bug 1710324)
Backed out changeset aa852464d828 (bug 1710324)
Backed out changeset 238a4cfcdc86 (bug 1710324)
2021-05-11 03:27:51 +03:00
Emilio Cobos Álvarez c25a3146e9 Bug 1710324 - nsNativeThemeGTK shouldn't need to be an nsIObserver. r=stransky
This is just cleanup. We have better ways to run code on shutdown (the pointer
to the theme object gets cleared on shutdown anyways).

Depends on D114697

Differential Revision: https://phabricator.services.mozilla.com/D114698
2021-05-10 23:33:34 +00:00
Emilio Cobos Álvarez 9f6e1b077e Bug 1707992 - Remove support for some useless appearance values in nsNativeThemeGTK. r=stransky
We use the same background-color with CSS anyways, so this shouldn't
change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D113554
2021-04-27 22:35:43 +00:00
Andi-Bogdan Postelnicu 2508edc4c5 Bug 1519636 - Reformat recent changes to the Google coding style. r=necko-reviewers,geckoview-reviewers,agi
Updated with clang-format version 11.0.1 (taskcluster-GI8pmG3eQ_OSXfjFfr2yFw)

\# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D113294
2021-04-26 15:52:25 +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 Álvarez 4b4ff83478 Bug 1689253 - Add a more sensible scrollbar size API to nsITheme, and use it to replace ScrollbarNonDisappearing. r=spohl
There's no reason we should need an scrollbar box to query the size of a
scrollbar. I plan to use this in the following patch to make the size of a
resizer not vary depending on whether the container has scrollbars or not,
which is what ultimately causes the reftest failure.

Differential Revision: https://phabricator.services.mozilla.com/D103302
2021-01-28 22:11:54 +00:00
Bogdan Tara 4a649093b9 Backed out changeset 3e90a3759639 (bug 1679208) for scrollbars-no-margin.html failures CLOSED TREE 2020-12-03 01:11:32 +02:00
Emilio Cobos Álvarez aa15236426 Bug 1679208 - Don't assume int return values in nsITheme. r=mstange
This doesn't hold with fractional scale values. Right now GTK truncates
the scale factor, Windows rounds, and non-native theme rounds as well.

With this native theme will propagate correctly the floating point
values.

I tried to not change behavior meaningfully in any of the other themes,
mostly to avoid risk. GTK and Windows can be trivially tweaked to
support fractional scale factors properly if we wanted to, but seems
better to not do that as part of this patch.

Depends on D98099

Differential Revision: https://phabricator.services.mozilla.com/D98100
2020-12-02 21:40:05 +00:00
Chris Peterson 162b8c8490 Bug 1624786 - Replace MOZ_MUST_USE with [[nodiscard]] in widget/gtk. r=karlt
Also move MOZ_MUST_USE before function declarations' specifiers and return type. While clang and gcc's __attribute__((warn_unused_result)) can appear before, between, or after function specifiers and return types, the [[nodiscard]] attribute must precede the function specifiers.

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

--HG--
extra : moz-landing-system : lando
2020-04-08 16:41:43 +00:00
Doug Thayer a848222b53 Bug 1441308 - Split out document pieces of WebRenderLayerManager r=jrmuizel
Per our discussion, this patch splits out the state management bits of
WebRenderLayerManager, allowing for them to be maintained per-document.

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

--HG--
extra : moz-landing-system : lando
2019-01-07 21:33:10 +00:00
Martin Stransky 36e0a3f5a9 Bug 1507423 - Don't draw StyleAppearance::MozWindowButtonBox on Linux/Gtk, r=mconley
Depends on D14243

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

--HG--
extra : moz-landing-system : lando
2018-12-18 10:48:28 +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
Mike Conley 097208ea2f Bug 1506248 - Backout bug 1498898 (0a63507e990c) since bug 1503272 makes it unnecessary now. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D11523

--HG--
extra : moz-landing-system : lando
2018-11-12 12:16:22 +00:00
Jonathan Watt b5bfd3a7ea Bug 1505316 p2. Rename aWidgetType to aAppearance in widget code. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D11156

--HG--
extra : rebase_source : c908a6d6419c6462453cb8b745effc583d767902
extra : source : 07e12bc71a8d96b52b1a1bbc8dc7545ae4454a4f
2018-10-24 16:24:57 +01:00
Jonathan Watt 587108c41f Bug 1505316 p1. Use StyleAppearance instead of WidgetType in widget code. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D11155

--HG--
extra : rebase_source : 7cbb8c381adfc49803c1bc0e90f4609f6cc7e6d0
2018-10-24 12:47:20 +01:00
Martin Stransky 3264d3e2dd Bug 1498898 - Don't draw container-only widgets, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D9379

--HG--
extra : moz-landing-system : lando
2018-10-25 12:54:35 +00:00
Martin Stransky f46e2e428f Bug 1442755 - Redraw titlebar widgets when application focus changes and draw inactive titlebar with GTK_STATE_FLAG_BACKDROP state, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D5582

--HG--
extra : moz-landing-system : lando
2018-09-12 11:03:56 +00:00
Cosmin Sabou 3a76399ecb Backed out changeset 19e2c611e889 (bug 1442755) for wpt reftest failures. CLOSED TREE 2018-09-11 15:11:02 +03:00
Martin Stransky 3d7f73594c Bug 1442755 - Redraw titlebar widgets when application focus changes and draw inactive titlebar with GTK_STATE_FLAG_BACKDROP state, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D5409

--HG--
extra : moz-landing-system : lando
2018-09-11 11:01:26 +00:00
Emilio Cobos Álvarez 517256e365 Bug 1478391: Autogenerate StyleAppearance. r=jwatt
This builds on bug 1428676 and introduces StyleAppearance, which replaces the
NS_THEME_* constants.

Really sorry for the size of the patch.

There's a non-trivial change in the gtk theme, which I submitted separately as
bug 1478385.

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

MozReview-Commit-ID: DiSmMWK7Krp
2018-07-26 17:06:17 +02:00
Mats Palmgren 8f2a5e19c9 Bug 1466330 - Make nsITheme::GetWidgetBorder return the border directly instead of using an out-param (idempotent patch). r=emilio 2018-06-02 19:10:48 +02:00
Mats Palmgren 6e331b1d1d Bug 1461222 part 2 - Make GetWidgetPadding return LayoutDeviceIntMargin. r=emilio 2018-05-17 17:30:35 +02:00
Mats Palmgren bae2d6f225 Bug 1461222 part 1 - Make GetWidgetBorder return LayoutDeviceIntMargin. r=emilio 2018-05-17 17:30:35 +02:00
Jan Horak 6c58e369e7 Bug 1431337 - Scale content for the actual monitor, not the first one; r=stransky
We need to use scaling factor of the monitor on which application is actually positioned.
Previously we used ScreenHelperGTK::GetGTKMonitorScaleFactor() which use the first monitor.
This does not work on hidpi+normal dpi monitors setup.

The GetSystemFontInfo() cannot return scaled value of the font by default monitor
scale factor. We need to scale it in nsLookAndFeel::GetFontImpl
by aDevPixPerCSSPixel like implementation for Windows does.

We also need to check layout.css.devPixelsPerPx because we cannot
scale per monitor when this preference is set to positive number.

MozReview-Commit-ID: AwT2NvkEqvz

--HG--
extra : rebase_source : 5b956a6abd7d215b06ebcd8c56e34c038d012940
2018-01-18 11:52:59 +01:00
Andreea Pavel 6e6687ea60 Backed out changeset cf44885dc2ac (bug 1431337) for failing mochitest browser chrome at browser/base/content/test/performance/browser_startup_images.js on a CLOSED TREE 2018-02-15 16:03:40 +02:00
Jan Horak 55b47c7c2e Bug 1431337 - Scale content for the actual monitor, not the first one; r=stransky
We need to use scaling factor of the monitor on which application is actually positioned.
Previously we used ScreenHelperGTK::GetGTKMonitorScaleFactor() which use the first monitor.
This does not work on hidpi+normal dpi monitors setup.

The GetSystemFontInfo() cannot return scaled value of the font by default monitor
scale factor. We need to scale it in nsLookAndFeel::GetFontImpl
by aDevPixPerCSSPixel like implementation for Windows does.

We also need to check layout.css.devPixelsPerPx because we cannot
scale per monitor when this preference is set to positive number.

MozReview-Commit-ID: AwT2NvkEqvz

--HG--
extra : rebase_source : 36d64957e017486d99c4302346ab64e47b5e2cc6
2018-01-18 11:52:59 +01:00
Lee Salzman a9ae481da3 Bug 1418361 - push GTK window background color rect for WR. r=nical
MozReview-Commit-ID: DUiFHtFGwQF
2018-01-22 08:01:09 -05:00
Sylvestre Ledru 2c6660f219 Bug 1278282 - Ride along Remove some trailing whitespaces r=lsalzman
MozReview-Commit-ID: 8W6VKIW8PQV

--HG--
extra : rebase_source : 23b5c300dd4bebe2b8808bdb03373073aab80b9f
2017-12-19 11:38:59 +01:00
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Alexis Beingessner adb013669b Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel
MozReview-Commit-ID: K1WUIOnvazF
2017-06-13 11:00:10 -04:00
Sebastian Hengst f3bf820bfd Backed out changeset 3d1ce85e6348 (bug 1088760) for bustage, at least on Android at layout/generic/nsPluginFrame.cpp:1612. r=backout 2017-06-13 00:30:03 +02:00
Alexis Beingessner c75211cb95 Bug 1088760 - Remove nsRenderingContext, replacing all of its uses with gfxContext. r=jwatt,jrmuizel
MozReview-Commit-ID: K1WUIOnvazF
2017-06-12 17:32:48 -04:00
L. David Baron e04a5a47c6 Bug 1367576 - Shrink existing caches to the size that's actually needed. r=karlt
Now that, thanks to bug 1367577, we have the theme constants in an enum,
we can make these arrays smaller rather than assuming that the constants
might use any valid uint8_t value.

MozReview-Commit-ID: A6GjTarVurc
2017-06-06 22:27:18 -07:00
L. David Baron d1ddf5e48e Bug 1367576 - Cache results of getting GTK widget borders. r=karlt
See comments in the header file.

This also clears out mSafeWidgetStates in ThemeChanged since that seems
like a good thing to do, and marks nsNativeThemeGTK as final.

MozReview-Commit-ID: 5Zne4eGbGlh
2017-06-06 22:27:18 -07:00
L. David Baron ee1674ecc5 Bug 1367576 - Refactor to allow for caching of some gtk widget padding/border results. r=karlt
This refactors the two nearly-identical callsites into a method so that
I can do caching in that method in the next patch.

Note that there was a slight difference between them in that the
aWidgetFlags parameter to GetGtkWidgetAndState was only passed from one
callsite.  However, given that the aState parameter is null, this
doesn't cause any behavior differences.  (Some controls in
GetGtkWidgetAndState null-check aWidgetFlags and some don't!)

Note also that this makes it always assign a result (often zero).  This
is fine for both callsites; GetWidgetPadding previously assigned zero
right before the call, and GetWidgetBorder did so at the start of the
function (and wasn't modified in between, since it was immediately
before the switch that the modified code is a case in).

MozReview-Commit-ID: IKurwry3UTi
2017-06-06 22:27:17 -07:00
Karl Tomlinson 19ee6ebe3b bug 1311604 consider block flow direction in vertical writing mode native widget layout r=jfkthame
This follows the same approach of considering block flow for all widgets
(in addition to resizers) as done for other toolkits in
https://hg.mozilla.org/mozilla-central/rev/4a65cacf8a37#l3.10

MozReview-Commit-ID: Ca3SMs1k2Tj

--HG--
extra : rebase_source : 9845e676aa2db5eecd222b7e8a678b2aecca659e
2016-10-20 17:57:55 +13:00
Jan Horak b1c2f1be2f Bug 1289148 - Fixing scrollbar metrics for GTK >= 3.20 r=karlt
The Gtk 3.20 scrollbars has moved towards usual box model. The scrollbar,
trough,thumb and scrollbar button can now have margin, padding and border set,
different for each direction (ie. left, right, bottom, top). The scrollbar
metrics become ignored in Gtk 3.20 and later.

* Draw scrollbar element [for GTK 3.20+]
* The border for scrollbar, trough, thumb and scrollbar buttons is newly
  calculated as margin+padding+border [for GTK 3.20+].
* The margin is subtracted for scrollbar, trough and sb buttons during paint
  function [for GTK 3.6+]
* All scrollbar widget's borders transfered from
  nsNativeThemeGTK::GetWidgetBorder to the moz_gtk_get_widget_border.
* Added helper function NativeThemeToGtkTheme for mapping mozilla's widget type
  to the gtk widget type.
* Scrollbar troughs are now drawn even when there is not enough room for
  the thumb [GTK 3.20+]

MozReview-Commit-ID: jd2q67gKM1

--HG--
extra : rebase_source : ecc8b85401845113d84c6c5a48219a0c3d4f8de3
2016-10-17 11:37:13 +13:00
Karl Tomlinson b799dfaa46 bug 1234158 rename GtkThemeWidgetType enum to WidgetNodeType as it will differentiate GTK CSS nodes r=Stránský
--HG--
extra : transplant_source : %11-%01%D8%F3%D6%00%E9%0C%D8%84z%A2%98%7C%F3%B5I%CF%5E
extra : histedit_source : deb6e194d8ea4466976347e24a741ee354dcc331
2016-04-14 17:47:20 +12:00