Bug 1460116 - Remove ShouldHideScrollbars. r=jimm
authorXidorn Quan <me@upsuper.org>
Wed, 09 May 2018 11:40:58 +1000
changeset 417620 5ece8d8f7ca4054c341c60a7031459ec2d9edb44
parent 417619 49a11acd0acf4c3012d57ee45743412e236869ee
child 417621 6505db7f437de65a5b158baa8ff890239721d2b8
push id33974
push userncsoregi@mozilla.com
push dateThu, 10 May 2018 09:47:43 +0000
treeherdermozilla-central@b52b2eb81d1e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1460116
milestone62.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 1460116 - Remove ShouldHideScrollbars. r=jimm MozReview-Commit-ID: 7v6Eylefk4t
gfx/src/nsITheme.h
layout/generic/nsGfxScrollFrame.cpp
widget/windows/WinUtils.cpp
widget/windows/WinUtils.h
widget/windows/nsNativeThemeWin.cpp
widget/windows/nsNativeThemeWin.h
--- a/gfx/src/nsITheme.h
+++ b/gfx/src/nsITheme.h
@@ -211,22 +211,16 @@ public:
    * Does the nsITheme implementation draw its own focus ring for this widget?
    */
   virtual bool ThemeDrawsFocusForWidget(uint8_t aWidgetType)=0;
   
   /**
     * Should we insert a dropmarker inside of combobox button?
    */
   virtual bool ThemeNeedsComboboxDropmarker()=0;
-
-  /**
-   * Should we hide scrollbars?
-   */
-  virtual bool ShouldHideScrollbars()
-  { return false; }
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsITheme, NS_ITHEME_IID)
 
 // Creator function
 extern nsresult NS_NewNativeTheme(nsISupports *aOuter, REFNSIID aIID, void **aResult);
 
 #endif
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -3087,22 +3087,16 @@ struct HoveredStateComparator
 };
 
 void
 ScrollFrameHelper::AppendScrollPartsTo(nsDisplayListBuilder*   aBuilder,
                                        const nsDisplayListSet& aLists,
                                        bool                    aCreateLayer,
                                        bool                    aPositioned)
 {
-  nsITheme* theme = mOuter->PresContext()->GetTheme();
-  if (theme &&
-      theme->ShouldHideScrollbars()) {
-    return;
-  }
-
   bool overlayScrollbars =
     LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) != 0;
 
   AutoTArray<nsIFrame*, 3> scrollParts;
   for (nsIFrame* kid : mOuter->PrincipalChildList()) {
     if (kid == mScrolledFrame ||
         (kid->IsAbsPosContainingBlock() || overlayScrollbars) != aPositioned) {
       continue;
--- a/widget/windows/WinUtils.cpp
+++ b/widget/windows/WinUtils.cpp
@@ -1764,23 +1764,16 @@ WinUtils::SetupKeyModifiersSequence(nsTA
   for (uint32_t i = 0; i < ArrayLength(sModifierKeyMap); ++i) {
     const uint32_t* map = sModifierKeyMap[i];
     if (aModifiers & map[0]) {
       aArray->AppendElement(KeyPair(map[1], map[2]));
     }
   }
 }
 
-/* static */
-bool
-WinUtils::ShouldHideScrollbars()
-{
-  return false;
-}
-
 // This is in use here and in dom/events/TouchEvent.cpp
 /* static */
 uint32_t
 WinUtils::IsTouchDeviceSupportPresent()
 {
   int32_t touchCapabilities = ::GetSystemMetrics(SM_DIGITIZER);
   return (touchCapabilities & NID_READY) &&
          (touchCapabilities & (NID_EXTERNAL_TOUCH | NID_INTEGRATED_TOUCH));
--- a/widget/windows/WinUtils.h
+++ b/widget/windows/WinUtils.h
@@ -484,18 +484,16 @@ public:
 
   /**
    * Returns true if executable's path is on a network drive.
    */
   static bool RunningFromANetworkDrive();
 
   static void Initialize();
 
-  static bool ShouldHideScrollbars();
-
   /**
    * This function normalizes the input path, converts short filenames to long
    * filenames, and substitutes environment variables for system paths.
    * The resulting output string length is guaranteed to be <= MAX_PATH.
    */
   static bool SanitizePath(const wchar_t* aInputPath, nsAString& aOutput);
 
   /**
--- a/widget/windows/nsNativeThemeWin.cpp
+++ b/widget/windows/nsNativeThemeWin.cpp
@@ -2617,22 +2617,16 @@ nsNativeThemeWin::ThemeGeometryTypeForWi
     case NS_THEME_WINDOW_BUTTON_BOX:
     case NS_THEME_WINDOW_BUTTON_BOX_MAXIMIZED:
       return eThemeGeometryTypeWindowButtons;
     default:
       return eThemeGeometryTypeUnknown;
   }
 }
 
-bool
-nsNativeThemeWin::ShouldHideScrollbars()
-{
-  return WinUtils::ShouldHideScrollbars();
-}
-
 nsITheme::Transparency
 nsNativeThemeWin::GetWidgetTransparency(nsIFrame* aFrame, uint8_t aWidgetType)
 {
   switch (aWidgetType) {
   case NS_THEME_SCROLLBAR_SMALL:
   case NS_THEME_SCROLLBAR:
   case NS_THEME_STATUSBAR:
     // Knowing that scrollbars and statusbars are opaque improves
--- a/widget/windows/nsNativeThemeWin.h
+++ b/widget/windows/nsNativeThemeWin.h
@@ -78,18 +78,16 @@ public:
   virtual bool WidgetAppearanceDependsOnWindowFocus(uint8_t aWidgetType) override;
 
   enum {
     eThemeGeometryTypeWindowButtons = eThemeGeometryTypeUnknown + 1
   };
   virtual ThemeGeometryType ThemeGeometryTypeForWidget(nsIFrame* aFrame,
                                                        uint8_t aWidgetType) override;
 
-  virtual bool ShouldHideScrollbars() override;
-
   nsNativeThemeWin();
 
 protected:
   mozilla::Maybe<nsUXThemeClass> GetThemeClass(uint8_t aWidgetType);
   HANDLE GetTheme(uint8_t aWidgetType);
   nsresult GetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,
                                 int32_t& aPart, int32_t& aState);
   nsresult ClassicGetThemePartAndState(nsIFrame* aFrame, uint8_t aWidgetType,