Bug 1442695 - Remove unused GetScrollbarPressStates method;r=spohl draft
authorBrian Grinstead <bgrinstead@mozilla.com>
Fri, 02 Mar 2018 09:42:55 -0800
changeset 762596 e9bc6b16de2b9848d765b9150813a0d844016895
parent 761128 c50f5f846c2e6b4c8da1e80b6790926ad84c3450
push id101214
push userbgrinstead@mozilla.com
push dateFri, 02 Mar 2018 18:47:14 +0000
reviewersspohl
bugs1442695
milestone60.0a1
Bug 1442695 - Remove unused GetScrollbarPressStates method;r=spohl MozReview-Commit-ID: GA9kzatUKfp
widget/cocoa/nsNativeThemeCocoa.h
widget/cocoa/nsNativeThemeCocoa.mm
--- a/widget/cocoa/nsNativeThemeCocoa.h
+++ b/widget/cocoa/nsNativeThemeCocoa.h
@@ -158,18 +158,16 @@ protected:
                       nsIFrame* aFrame, uint8_t aWidgetType);
   void DrawUnifiedToolbar(CGContextRef cgContext, const HIRect& inBoxRect,
                           NSWindow* aWindow);
   void DrawStatusBar(CGContextRef cgContext, const HIRect& inBoxRect,
                      nsIFrame *aFrame);
   void DrawResizer(CGContextRef cgContext, const HIRect& aRect, nsIFrame *aFrame);
 
   // Scrollbars
-  void GetScrollbarPressStates(nsIFrame *aFrame,
-                               mozilla::EventStates aButtonStates[]);
   nsIFrame* GetParentScrollbarFrame(nsIFrame *aFrame);
   bool IsParentScrollbarRolledOver(nsIFrame* aFrame);
 
 private:
   NSButtonCell* mDisclosureButtonCell;
   NSButtonCell* mHelpButtonCell;
   NSButtonCell* mPushButtonCell;
   NSButtonCell* mRadioButtonCell;
--- a/widget/cocoa/nsNativeThemeCocoa.mm
+++ b/widget/cocoa/nsNativeThemeCocoa.mm
@@ -2052,41 +2052,16 @@ nsNativeThemeCocoa::DrawSegment(CGContex
             (isPressed ? @"pressed" : (isActive ? @"normal" : @"inactive")), @"state",
             [NSNumber numberWithBool:isFocused], @"focus",
             CUIControlSizeForCocoaSize(controlSize), @"size",
             [NSNumber numberWithBool:YES], @"is.flipped",
             @"up", @"direction",
             nil]);
 }
 
-void
-nsNativeThemeCocoa::GetScrollbarPressStates(nsIFrame* aFrame,
-                                            EventStates aButtonStates[])
-{
-  static Element::AttrValuesArray attributeValues[] = {
-    &nsGkAtoms::scrollbarUpTop,
-    &nsGkAtoms::scrollbarDownTop,
-    &nsGkAtoms::scrollbarUpBottom,
-    &nsGkAtoms::scrollbarDownBottom,
-    nullptr
-  };
-
-  // Get the state of any scrollbar buttons in our child frames
-  for (nsIFrame *childFrame : aFrame->PrincipalChildList()) {
-    nsIContent *childContent = childFrame->GetContent();
-    if (!childContent || !childContent->IsElement()) continue;
-    int32_t attrIndex =
-      childContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::sbattr,
-                                                 attributeValues, eCaseMatters);
-    if (attrIndex < 0) continue;
-
-    aButtonStates[attrIndex] = GetContentState(childFrame, NS_THEME_BUTTON);
-  }
-}
-
 nsIFrame*
 nsNativeThemeCocoa::GetParentScrollbarFrame(nsIFrame *aFrame)
 {
   // Walk our parents to find a scrollbar frame
   nsIFrame* scrollbarFrame = aFrame;
   do {
     if (scrollbarFrame->IsScrollbarFrame()) break;
   } while ((scrollbarFrame = scrollbarFrame->GetParent()));