Bug 1475033 part 6 - Have scrollbar auto colors resolve to the corresponding colors on Windows 10. r?jimm draft
authorXidorn Quan <me@upsuper.org>
Mon, 06 Aug 2018 15:13:17 +1000
changeset 829854 ee529ab5300d6b89de71bbfe8a14801ff2134c03
parent 829853 fca30130adf22b3b3d42d1ef7058e3c0d804297b
child 829855 9e9a53592fce925d62220fec3253aa3f297c8efa
push id118798
push userxquan@mozilla.com
push dateFri, 17 Aug 2018 01:17:12 +0000
reviewersjimm
bugs1475033
milestone63.0a1
Bug 1475033 part 6 - Have scrollbar auto colors resolve to the corresponding colors on Windows 10. r?jimm So that we can use custom scrollbar for thin scrollbar. MozReview-Commit-ID: FCHzV5MJbx
widget/windows/nsNativeThemeWin.cpp
--- a/widget/windows/nsNativeThemeWin.cpp
+++ b/widget/windows/nsNativeThemeWin.cpp
@@ -1960,29 +1960,23 @@ RENDER_AGAIN:
   nativeDrawing.PaintToContext();
 
   return NS_OK;
 }
 
 static nscolor
 GetScrollbarFaceColorForAuto(ComputedStyle* aStyle)
 {
-  // Do we want to derive from scrollbar-track-color when possible?
-  DWORD sysColor = ::GetSysColor(COLOR_SCROLLBAR);
-  return NS_RGB(GetRValue(sysColor),
-                GetGValue(sysColor),
-                GetBValue(sysColor));
+  return NS_RGB(205, 205, 205);
 }
 
 static nscolor
 GetScrollbarTrackColorForAuto(ComputedStyle* aStyle)
 {
-  // Fallback to background color for now. Do we want to derive from
-  // scrollbar-face-color somehow?
-  return aStyle->StyleBackground()->BackgroundColor(aStyle);
+  return NS_RGB(240, 240, 240);
 }
 
 nscolor
 nsNativeThemeWin::GetWidgetAutoColor(ComputedStyle* aStyle, WidgetType aWidgetType)
 {
   switch (aWidgetType) {
     case StyleAppearance::Scrollbar:
     case StyleAppearance::ScrollbarSmall: