Bug 1501433 - Remove nsNativeTheme::GetScrollbar{Face,Track}Color. r=jmathies
authorXidorn Quan <me@upsuper.org>
Wed, 24 Oct 2018 07:21:51 +1100
changeset 507948 c0d6af045dff28630000382155d8c0632c7e1913
parent 507947 2b3783d7fa5354130d452383dc9025d96326c97e
child 507949 a6ccef7ece93aa126964145f7ffa99939295d677
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmathies
bugs1501433, 1460456, 1464722, 1494607, 1498216
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 1501433 - Remove nsNativeTheme::GetScrollbar{Face,Track}Color. r=jmathies The functions were introduced in bug 1460456 as part of the initial impl of scrollbar color properties, and then got moved to nsNativeTheme in bug 1464722 to be shared with cocoa impl. Its usage is later removed in bug 1494607 and bug 1498216 as we turn to rely on native blending instead, and these functions become unused. Differential Revision: https://phabricator.services.mozilla.com/D9596
widget/nsNativeTheme.cpp
widget/nsNativeTheme.h
--- a/widget/nsNativeTheme.cpp
+++ b/widget/nsNativeTheme.cpp
@@ -813,53 +813,8 @@ nsNativeTheme::IsWidgetScrollbarPart(Sty
     case StyleAppearance::ScrollbarthumbVertical:
     case StyleAppearance::ScrollbarthumbHorizontal:
     case StyleAppearance::Scrollcorner:
       return true;
     default:
       return false;
   }
 }
-
-static nscolor
-GetOpaqueBackgroundColor(ComputedStyle* aStyle)
-{
-  nscolor color = aStyle->StyleBackground()->BackgroundColor(aStyle);
-  if (NS_GET_A(color) == 255) {
-    return color;
-  }
-  // Compose white background with the background color.
-  return NS_ComposeColors(NS_RGB(255, 255, 255), color);
-}
-
-nscolor
-nsNativeTheme::GetScrollbarFaceColor(ComputedStyle* aStyle,
-                                     AutoColorGetter aAutoGetter)
-{
-  StyleComplexColor complexColor = aStyle->StyleUI()->mScrollbarFaceColor;
-  if (complexColor.IsAuto()) {
-    return aAutoGetter(aStyle);
-  }
-  nscolor color = complexColor.CalcColor(aStyle);
-  if (NS_GET_A(color) == 255) {
-    return color;
-  }
-  nscolor bgColor = GetOpaqueBackgroundColor(aStyle);
-  return NS_ComposeColors(bgColor, color);
-}
-
-nscolor
-nsNativeTheme::GetScrollbarTrackColor(ComputedStyle* aStyle,
-                                      AutoColorGetter aAutoGetter)
-{
-  StyleComplexColor complexColor = aStyle->StyleUI()->mScrollbarTrackColor;
-  nscolor color;
-  if (complexColor.IsAuto()) {
-    color = aAutoGetter(aStyle);
-  } else {
-    color = complexColor.CalcColor(aStyle);
-  }
-  if (NS_GET_A(color) == 255) {
-    return color;
-  }
-  nscolor bgColor = GetOpaqueBackgroundColor(aStyle);
-  return NS_ComposeColors(bgColor, color);
-}
--- a/widget/nsNativeTheme.h
+++ b/widget/nsNativeTheme.h
@@ -184,20 +184,16 @@ class nsNativeTheme : public nsITimerCal
 
   bool IsRangeHorizontal(nsIFrame* aFrame);
 
   // scrollbar
   bool IsDarkBackground(nsIFrame* aFrame);
   // custom scrollbar
   typedef nscolor (*AutoColorGetter)(mozilla::ComputedStyle*);
   bool IsWidgetScrollbarPart(mozilla::StyleAppearance aAppearance);
-  nscolor GetScrollbarFaceColor(mozilla::ComputedStyle* aStyle,
-                                AutoColorGetter aAutoGetter);
-  nscolor GetScrollbarTrackColor(mozilla::ComputedStyle* aStyle,
-                                 AutoColorGetter aAutoGetter);
 
  private:
   uint32_t mAnimatedContentTimeout;
   nsCOMPtr<nsITimer> mAnimatedContentTimer;
   AutoTArray<nsCOMPtr<nsIContent>, 20> mAnimatedContentList;
 };
 
 #endif // _NSNATIVETHEME_H_