Bug 1615028 - Make nsNativeBasicTheme honor custom scrollbar styles. r=spohl

By falling back to the generic code like nsNativeThemeGTK does.

We may want to be more nuanced in other platforms? I don't know.

This is very noticeable on Riot and other apps that override the scrollbar width
/ scrollbar colors.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2020-02-12 19:38:35 +00:00
parent 97684579f8
commit 4fb3a8f1ae

View File

@ -811,6 +811,16 @@ bool nsNativeBasicTheme::ThemeSupportsWidget(nsPresContext* aPresContext,
aAppearance = StyleAppearance::Menulist;
}
if (IsWidgetScrollbarPart(aAppearance)) {
const auto* style = nsLayoutUtils::StyleForScrollbar(aFrame);
// We don't currently handle custom scrollbars on nsNativeBasicTheme. We
// could, potentially.
if (style->StyleUI()->HasCustomScrollbars() ||
style->StyleUIReset()->mScrollbarWidth == StyleScrollbarWidth::Thin) {
return false;
}
}
switch (aAppearance) {
case StyleAppearance::Radio:
case StyleAppearance::Checkbox: