mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1719948 - Respect scrollbar-color for overlay scrollbars on macOS. r=emilio
This makes the behavior on macOS consistent with Android, and with overlay scrollbars on GTK and Windows 11. We don't display the track unless the scrollbar is hovered. If we run into color contrast issues, for example because web authors only considered color contrast between the thumb and the track and not the color contrast between the thumb and the page background, then we may change to always display the track. But if we do that, we should do it across all platforms with overlay scrollbars. Differential Revision: https://phabricator.services.mozilla.com/D140405
This commit is contained in:
parent
68745fb52b
commit
75400f81c3
@ -61,16 +61,13 @@ static ScrollbarParams ComputeScrollbarParams(nsIFrame* aFrame,
|
||||
params.isHorizontal = aIsHorizontal;
|
||||
params.isOnDarkBackground = !StaticPrefs::widget_disable_dark_scrollbar() &&
|
||||
nsNativeTheme::IsDarkBackground(aFrame);
|
||||
// Don't use custom scrollbars for overlay scrollbars since they are
|
||||
// generally good enough for use cases of custom scrollbars.
|
||||
if (!params.isOverlay) {
|
||||
const nsStyleUI* ui = aStyle.StyleUI();
|
||||
if (ui->HasCustomScrollbars()) {
|
||||
const auto& colors = ui->mScrollbarColor.AsColors();
|
||||
params.isCustom = true;
|
||||
params.trackColor = colors.track.CalcColor(aStyle);
|
||||
params.faceColor = colors.thumb.CalcColor(aStyle);
|
||||
}
|
||||
|
||||
const nsStyleUI* ui = aStyle.StyleUI();
|
||||
if (ui->HasCustomScrollbars()) {
|
||||
const auto& colors = ui->mScrollbarColor.AsColors();
|
||||
params.isCustom = true;
|
||||
params.trackColor = colors.track.CalcColor(aStyle);
|
||||
params.faceColor = colors.thumb.CalcColor(aStyle);
|
||||
}
|
||||
|
||||
return params;
|
||||
|
Loading…
Reference in New Issue
Block a user