Bug 1506447 - Check overlay before checking custom scrollbar style in nsNativeThemeCocoa::GetWidgetTransparency. r=spohl
authorXidorn Quan <me@upsuper.org>
Sun, 25 Nov 2018 22:31:53 +1100
changeset 505169 a6ccef7ece93aa126964145f7ffa99939295d677
parent 505168 c0d6af045dff28630000382155d8c0632c7e1913
child 505170 b9b9586a6d8b7f291d5d03a107810dff8b7fab78
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersspohl
bugs1506447
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1506447 - Check overlay before checking custom scrollbar style in nsNativeThemeCocoa::GetWidgetTransparency. r=spohl Differential Revision: https://phabricator.services.mozilla.com/D12856
widget/cocoa/nsNativeThemeCocoa.mm
--- a/widget/cocoa/nsNativeThemeCocoa.mm
+++ b/widget/cocoa/nsNativeThemeCocoa.mm
@@ -4928,22 +4928,26 @@ nsNativeThemeCocoa::GetWidgetTransparenc
     return eTransparent;
 
   case StyleAppearance::Dialog:
     return IsWindowSheet(aFrame) ? eTransparent : eOpaque;
 
   case StyleAppearance::ScrollbarSmall:
   case StyleAppearance::Scrollbar:
   case StyleAppearance::Scrollcorner: {
+    // We don't use custom scrollbars when using overlay scrollbars.
+    if (nsLookAndFeel::UseOverlayScrollbars()) {
+      return eTransparent;
+    }
     const nsStyleUI* ui = nsLayoutUtils::StyleForScrollbar(aFrame)->StyleUI();
     StyleComplexColor trackColor = ui->mScrollbarTrackColor;
-    if (!trackColor.IsAuto()) {
-      return trackColor.MaybeTransparent() ? eTransparent : eOpaque;
+    if (!trackColor.IsAuto() && trackColor.MaybeTransparent()) {
+      return eTransparent;
     }
-    return nsLookAndFeel::UseOverlayScrollbars() ? eTransparent : eOpaque;
+    return eOpaque;
   }
 
   case StyleAppearance::Statusbar:
     // Knowing that scrollbars and statusbars are opaque improves
     // performance, because we create layers for them.
     return eOpaque;
 
   case StyleAppearance::Toolbar: