bug 1349849 remove WidgetStateChanged() call from nsScrollbarFrame::MoveToNewPosition() r=mstange
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 23 Mar 2017 14:44:08 +1300
changeset 350648 05814c43dab7379b66000b0c62a3de3f6411b672
parent 350647 7aa9d5c0a0263e462c4bff326d073990ff37ff50
child 350649 d3164718edbf9ebd84665c4af8a6c69125a47600
push id88685
push usercbook@mozilla.com
push dateFri, 31 Mar 2017 12:48:11 +0000
treeherdermozilla-inbound@aece477a513e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1349849, 957445
milestone55.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 1349849 remove WidgetStateChanged() call from nsScrollbarFrame::MoveToNewPosition() r=mstange This was added in https://hg.mozilla.org/mozilla-central/rev/9eabf947efc3363a1bf79aa03c3053d184510846 for https://bugzilla.mozilla.org/show_bug.cgi?id=957445#c29 but the |aShouldRepaint| out parameter is not handled, and the call has no side effects. WidgetStateChanged() in nsNativeThemeWin and nsNativeThemeCocoa do not request repaint of the scrollbar nor otherwise handle curpos. nsNativeThemeGTK::WidgetStateChanged() requests a repaint on some changes in curpos only on scrollbar buttons. MozReview-Commit-ID: 98iyhLMs7ja
layout/xul/nsScrollbarFrame.cpp
--- a/layout/xul/nsScrollbarFrame.cpp
+++ b/layout/xul/nsScrollbarFrame.cpp
@@ -244,19 +244,16 @@ nsScrollbarFrame::MoveToNewPosition()
   nsCOMPtr<nsIContent> content = GetContent();
 
   // get the current pos
   int32_t curpos = nsSliderFrame::GetCurrentPosition(content);
 
   // get the max pos
   int32_t maxpos = nsSliderFrame::GetMaxPosition(content);
 
-  // save the old curpos
-  int32_t oldCurpos = curpos;
-
   // increment the given amount
   if (mIncrement) {
     curpos += mIncrement;
   }
 
   // make sure the current position is between the current and max positions
   if (curpos < 0) {
     curpos = 0;
@@ -288,24 +285,11 @@ nsScrollbarFrame::MoveToNewPosition()
       if (sliderFrame) {
         sliderFrame->AttributeChanged(kNameSpaceID_None, nsGkAtoms::curpos, nsIDOMMutationEvent::MODIFICATION);
         if (!weakFrame.IsAlive()) {
           return curpos;
         }
       }
     }
   }
-  // See if we have appearance information for a theme.
-  const nsStyleDisplay* disp = StyleDisplay();
-  nsPresContext* presContext = PresContext();
-  if (disp->UsedAppearance()) {
-    nsITheme *theme = presContext->GetTheme();
-    if (theme && theme->ThemeSupportsWidget(presContext, this, disp->UsedAppearance())) {
-      bool repaint;
-      nsAttrValue oldValue;
-      oldValue.SetTo(oldCurpos);
-      theme->WidgetStateChanged(this, disp->UsedAppearance(), nsGkAtoms::curpos,
-          &repaint, &oldValue);
-    }
-  }
   content->UnsetAttr(kNameSpaceID_None, nsGkAtoms::smooth, false);
   return curpos;
 }