[Cocoa] Remove typedef from NSScrollerImp to ScrollbarPainter
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 13 Mar 2016 03:58:41 +0000 (03:58 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 13 Mar 2016 03:58:41 +0000 (03:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155379

Reviewed by Beth Dakin.

There's no reason to not call them what they are.

No new tests because there is no behavior change.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars):
(WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
(WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars):
(WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
(WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
(WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollbarPaintersOnTheMainThread): Deleted.
* platform/ScrollbarThemeComposite.h:
* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(scrollbarPainterForScrollbar):
(-[WebScrollerImpDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
(-[WebScrollerImpDelegate scrollerImp:animateKnobAlphaTo:duration:]):
(-[WebScrollerImpDelegate scrollerImp:animateTrackAlphaTo:duration:]):
(-[WebScrollerImpDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
(-[WebScrollerImpDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
(WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
(WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
(WebCore::ScrollAnimatorMac::mouseIsDownInScrollbar):
(WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
(WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
(WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
(WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
(WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
(WebCore::ScrollAnimatorMac::verticalScrollbarLayerDidChange):
(WebCore::ScrollAnimatorMac::horizontalScrollbarLayerDidChange):
(WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
(WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
(WebCore::ScrollAnimatorMac::cancelAnimations):
(WebCore::ScrollAnimatorMac::updateScrollerStyle):
(WebCore::ScrollAnimatorMac::initialScrollbarPaintTimerFired):
(-[WebScrollbarPainterDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]): Deleted.
(-[WebScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]): Deleted.
(-[WebScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]): Deleted.
(-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]): Deleted.
(-[WebScrollbarPainterDelegate scrollerImp:animateExpansionTransitionWithDuration:]): Deleted.
* platform/mac/ScrollbarThemeMac.h:
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::scrollbarMap):
(+[WebScrollbarPrefsObserver appearancePrefsChanged:]):
(WebCore::ScrollbarThemeMac::registerScrollbar):
(WebCore::ScrollbarThemeMac::setNewPainterForScrollbar):
(WebCore::ScrollbarThemeMac::painterForScrollbar):
(WebCore::ScrollbarThemeMac::scrollbarThickness):
(WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
(WebCore::ScrollbarThemeMac::hasThumb):
(WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar):
(WebCore::scrollbarPainterPaint):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198078 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingStateFrameScrollingNode.h
Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm
Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h
Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm
Source/WebCore/platform/ScrollbarThemeComposite.h
Source/WebCore/platform/mac/ScrollAnimatorMac.h
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebCore/platform/mac/ScrollbarThemeMac.h
Source/WebCore/platform/mac/ScrollbarThemeMac.mm

index cdbbae3..0bce2a4 100644 (file)
@@ -1,3 +1,77 @@
+2016-03-12  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [Cocoa] Remove typedef from NSScrollerImp to ScrollbarPainter
+        https://bugs.webkit.org/show_bug.cgi?id=155379
+
+        Reviewed by Beth Dakin.
+
+        There's no reason to not call them what they are.
+
+        No new tests because there is no behavior change.
+
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
+        * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
+        (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
+        (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars):
+        (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
+        * page/scrolling/ScrollingStateFrameScrollingNode.h:
+        * page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
+        (WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars):
+        (WebCore::ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars): Deleted.
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
+        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
+        (WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollbarPaintersOnTheMainThread): Deleted.
+        * platform/ScrollbarThemeComposite.h:
+        * platform/mac/ScrollAnimatorMac.h:
+        * platform/mac/ScrollAnimatorMac.mm:
+        (scrollbarPainterForScrollbar):
+        (-[WebScrollerImpDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]):
+        (-[WebScrollerImpDelegate scrollerImp:animateKnobAlphaTo:duration:]):
+        (-[WebScrollerImpDelegate scrollerImp:animateTrackAlphaTo:duration:]):
+        (-[WebScrollerImpDelegate scrollerImp:animateUIStateTransitionWithDuration:]):
+        (-[WebScrollerImpDelegate scrollerImp:animateExpansionTransitionWithDuration:]):
+        (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
+        (WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):
+        (WebCore::ScrollAnimatorMac::mouseEnteredScrollbar):
+        (WebCore::ScrollAnimatorMac::mouseExitedScrollbar):
+        (WebCore::ScrollAnimatorMac::mouseIsDownInScrollbar):
+        (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
+        (WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
+        (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
+        (WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
+        (WebCore::ScrollAnimatorMac::invalidateScrollbarPartLayers):
+        (WebCore::ScrollAnimatorMac::verticalScrollbarLayerDidChange):
+        (WebCore::ScrollAnimatorMac::horizontalScrollbarLayerDidChange):
+        (WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
+        (WebCore::ScrollAnimatorMac::notifyContentAreaScrolled):
+        (WebCore::ScrollAnimatorMac::cancelAnimations):
+        (WebCore::ScrollAnimatorMac::updateScrollerStyle):
+        (WebCore::ScrollAnimatorMac::initialScrollbarPaintTimerFired):
+        (-[WebScrollbarPainterDelegate setUpAlphaAnimation:scrollerPainter:part:animateAlphaTo:duration:]): Deleted.
+        (-[WebScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]): Deleted.
+        (-[WebScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]): Deleted.
+        (-[WebScrollbarPainterDelegate scrollerImp:animateUIStateTransitionWithDuration:]): Deleted.
+        (-[WebScrollbarPainterDelegate scrollerImp:animateExpansionTransitionWithDuration:]): Deleted.
+        * platform/mac/ScrollbarThemeMac.h:
+        * platform/mac/ScrollbarThemeMac.mm:
+        (WebCore::scrollbarMap):
+        (+[WebScrollbarPrefsObserver appearancePrefsChanged:]):
+        (WebCore::ScrollbarThemeMac::registerScrollbar):
+        (WebCore::ScrollbarThemeMac::setNewPainterForScrollbar):
+        (WebCore::ScrollbarThemeMac::painterForScrollbar):
+        (WebCore::ScrollbarThemeMac::scrollbarThickness):
+        (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
+        (WebCore::ScrollbarThemeMac::hasThumb):
+        (WebCore::ScrollbarThemeMac::setPaintCharacteristicsForScrollbar):
+        (WebCore::scrollbarPainterPaint):
+
 2016-03-12  Dean Jackson  <dino@apple.com>
 
         REGRESSION (r188647): Teamtreehouse website sidebar buttons are not rendered
index b25a471..4810631 100644 (file)
@@ -127,7 +127,7 @@ void AsyncScrollingCoordinator::frameViewLayoutUpdated(FrameView& frameView)
 
     Scrollbar* verticalScrollbar = frameView.verticalScrollbar();
     Scrollbar* horizontalScrollbar = frameView.horizontalScrollbar();
-    node->setScrollbarPaintersFromScrollbars(verticalScrollbar, horizontalScrollbar);
+    node->setScrollerImpsFromScrollbars(verticalScrollbar, horizontalScrollbar);
     
     node->setFrameScaleFactor(frameView.frame().frameScaleFactor());
     node->setHeaderHeight(frameView.headerHeight());
index 8503936..065706a 100644 (file)
@@ -46,8 +46,8 @@ ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode(ScrollingStat
 ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode(const ScrollingStateFrameScrollingNode& stateNode, ScrollingStateTree& adoptiveTree)
     : ScrollingStateScrollingNode(stateNode, adoptiveTree)
 #if PLATFORM(MAC)
-    , m_verticalScrollbarPainter(stateNode.verticalScrollbarPainter())
-    , m_horizontalScrollbarPainter(stateNode.horizontalScrollbarPainter())
+    , m_verticalScrollerImp(stateNode.verticalScrollerImp())
+    , m_horizontalScrollerImp(stateNode.horizontalScrollerImp())
 #endif
     , m_nonFastScrollableRegion(stateNode.nonFastScrollableRegion())
     , m_requestedScrollPosition(stateNode.requestedScrollPosition())
@@ -216,7 +216,7 @@ void ScrollingStateFrameScrollingNode::setFixedElementsLayoutRelativeToFrame(boo
 }
 
 #if !PLATFORM(MAC)
-void ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars(Scrollbar*, Scrollbar*)
+void ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars(Scrollbar*, Scrollbar*)
 {
 }
 #endif
index 459b67c..3959b15 100644 (file)
@@ -114,10 +114,10 @@ public:
     WEBCORE_EXPORT void setFixedElementsLayoutRelativeToFrame(bool);
 
 #if PLATFORM(MAC)
-    ScrollbarPainter verticalScrollbarPainter() const { return m_verticalScrollbarPainter.get(); }
-    ScrollbarPainter horizontalScrollbarPainter() const { return m_horizontalScrollbarPainter.get(); }
+    NSScrollerImp *verticalScrollerImp() const { return m_verticalScrollerImp.get(); }
+    NSScrollerImp *horizontalScrollerImp() const { return m_horizontalScrollerImp.get(); }
 #endif
-    void setScrollbarPaintersFromScrollbars(Scrollbar* verticalScrollbar, Scrollbar* horizontalScrollbar);
+    void setScrollerImpsFromScrollbars(Scrollbar* verticalScrollbar, Scrollbar* horizontalScrollbar);
 
     void dumpProperties(TextStream&, int indent) const override;
 
@@ -133,8 +133,8 @@ private:
     LayerRepresentation m_footerLayer;
 
 #if PLATFORM(MAC)
-    RetainPtr<ScrollbarPainter> m_verticalScrollbarPainter;
-    RetainPtr<ScrollbarPainter> m_horizontalScrollbarPainter;
+    RetainPtr<NSScrollerImp> m_verticalScrollerImp;
+    RetainPtr<NSScrollerImp> m_horizontalScrollerImp;
 #endif
 
     Region m_nonFastScrollableRegion;
index a5eb91a..2fddf23 100644 (file)
 
 namespace WebCore {
     
-void ScrollingStateFrameScrollingNode::setScrollbarPaintersFromScrollbars(Scrollbar* verticalScrollbar, Scrollbar* horizontalScrollbar)
+void ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars(Scrollbar* verticalScrollbar, Scrollbar* horizontalScrollbar)
 {
     ScrollbarTheme& scrollbarTheme = ScrollbarTheme::theme();
     if (scrollbarTheme.isMockTheme())
         return;
     ScrollbarThemeMac& macTheme = static_cast<ScrollbarThemeMac&>(scrollbarTheme);
 
-    ScrollbarPainter verticalPainter = verticalScrollbar && verticalScrollbar->supportsUpdateOnSecondaryThread()
+    NSScrollerImp *verticalPainter = verticalScrollbar && verticalScrollbar->supportsUpdateOnSecondaryThread()
         ? macTheme.painterForScrollbar(*verticalScrollbar) : nullptr;
-    ScrollbarPainter horizontalPainter = horizontalScrollbar && horizontalScrollbar->supportsUpdateOnSecondaryThread()
+    NSScrollerImp *horizontalPainter = horizontalScrollbar && horizontalScrollbar->supportsUpdateOnSecondaryThread()
         ? macTheme.painterForScrollbar(*horizontalScrollbar) : nullptr;
 
-    if (m_verticalScrollbarPainter == verticalPainter && m_horizontalScrollbarPainter == horizontalPainter)
+    if (m_verticalScrollerImp == verticalPainter && m_horizontalScrollerImp == horizontalPainter)
         return;
 
-    m_verticalScrollbarPainter = verticalPainter;
-    m_horizontalScrollbarPainter = horizontalPainter;
+    m_verticalScrollerImp = verticalPainter;
+    m_horizontalScrollerImp = horizontalPainter;
 
     setPropertyChanged(PainterForScrollbar);
 }
index 322c1be..65b8d6f 100644 (file)
@@ -45,7 +45,7 @@ public:
 private:
     ScrollingTreeFrameScrollingNodeMac(ScrollingTree&, ScrollingNodeID);
 
-    void releaseReferencesToScrollbarPaintersOnTheMainThread();
+    void releaseReferencesToScrollerImpsOnTheMainThread();
 
     // ScrollingTreeNode member functions.
     void updateBeforeChildren(const ScrollingStateNode&) override;
@@ -103,8 +103,8 @@ private:
     RetainPtr<CALayer> m_contentShadowLayer;
     RetainPtr<CALayer> m_headerLayer;
     RetainPtr<CALayer> m_footerLayer;
-    RetainPtr<ScrollbarPainter> m_verticalScrollbarPainter;
-    RetainPtr<ScrollbarPainter> m_horizontalScrollbarPainter;
+    RetainPtr<NSScrollerImp> m_verticalScrollerImp;
+    RetainPtr<NSScrollerImp> m_horizontalScrollerImp;
     FloatPoint m_probableMainThreadScrollPosition;
     bool m_lastScrollHadUnfilledPixels { false };
     bool m_hadFirstUpdate { false };
index 9feee03..bd81854 100644 (file)
@@ -60,26 +60,26 @@ Ref<ScrollingTreeFrameScrollingNode> ScrollingTreeFrameScrollingNodeMac::create(
 ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
     : ScrollingTreeFrameScrollingNode(scrollingTree, nodeID)
     , m_scrollController(*this)
-    , m_verticalScrollbarPainter(nullptr)
-    , m_horizontalScrollbarPainter(nullptr)
+    , m_verticalScrollerImp(nullptr)
+    , m_horizontalScrollerImp(nullptr)
 {
 }
 
 ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac()
 {
-    releaseReferencesToScrollbarPaintersOnTheMainThread();
+    releaseReferencesToScrollerImpsOnTheMainThread();
 }
 
-void ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollbarPaintersOnTheMainThread()
+void ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread()
 {
-    if (m_verticalScrollbarPainter || m_horizontalScrollbarPainter) {
+    if (m_verticalScrollerImp || m_horizontalScrollerImp) {
         // FIXME: This is a workaround in place for the time being since NSScrollerImps cannot be deallocated
         // on a non-main thread. rdar://problem/24535055
-        ScrollbarPainter retainedVerticalScrollbarPainter = m_verticalScrollbarPainter.leakRef();
-        ScrollbarPainter retainedHorizontalScrollbarPainter = m_horizontalScrollbarPainter.leakRef();
-        WTF::callOnMainThread([retainedVerticalScrollbarPainter, retainedHorizontalScrollbarPainter] {
-            [retainedVerticalScrollbarPainter release];
-            [retainedHorizontalScrollbarPainter release];
+        NSScrollerImp *retainedVerticalScrollerImp = m_verticalScrollerImp.leakRef();
+        NSScrollerImp *retainedHorizontalScrollerImp = m_horizontalScrollerImp.leakRef();
+        WTF::callOnMainThread([retainedVerticalScrollerImp, retainedHorizontalScrollerImp] {
+            [retainedVerticalScrollerImp release];
+            [retainedHorizontalScrollerImp release];
         });
     }
 }
@@ -123,9 +123,9 @@ void ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren(const ScrollingSta
         m_footerLayer = scrollingStateNode.footerLayer();
 
     if (scrollingStateNode.hasChangedProperty(ScrollingStateFrameScrollingNode::PainterForScrollbar)) {
-        releaseReferencesToScrollbarPaintersOnTheMainThread();
-        m_verticalScrollbarPainter = scrollingStateNode.verticalScrollbarPainter();
-        m_horizontalScrollbarPainter = scrollingStateNode.horizontalScrollbarPainter();
+        releaseReferencesToScrollerImpsOnTheMainThread();
+        m_verticalScrollerImp = scrollingStateNode.verticalScrollerImp();
+        m_horizontalScrollerImp = scrollingStateNode.horizontalScrollerImp();
     }
 
     bool logScrollingMode = !m_hadFirstUpdate;
@@ -191,12 +191,12 @@ void ScrollingTreeFrameScrollingNodeMac::handleWheelEvent(const PlatformWheelEve
         return;
 
     if (wheelEvent.momentumPhase() == PlatformWheelEventPhaseBegan) {
-        [m_verticalScrollbarPainter setUsePresentationValue:YES];
-        [m_horizontalScrollbarPainter setUsePresentationValue:YES];
+        [m_verticalScrollerImp setUsePresentationValue:YES];
+        [m_horizontalScrollerImp setUsePresentationValue:YES];
     }
     if (wheelEvent.momentumPhase() == PlatformWheelEventPhaseEnded || wheelEvent.momentumPhase() == PlatformWheelEventPhaseCancelled) {
-        [m_verticalScrollbarPainter setUsePresentationValue:NO];
-        [m_horizontalScrollbarPainter setUsePresentationValue:NO];
+        [m_verticalScrollerImp setUsePresentationValue:NO];
+        [m_horizontalScrollerImp setUsePresentationValue:NO];
     }
 
 #if ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)
@@ -442,22 +442,22 @@ void ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition(const FloatPoint
         }
     }
 
-    if (m_verticalScrollbarPainter || m_horizontalScrollbarPainter) {
+    if (m_verticalScrollerImp || m_horizontalScrollerImp) {
         [CATransaction begin];
         [CATransaction lock];
 
-        if ([m_verticalScrollbarPainter shouldUsePresentationValue]) {
+        if ([m_verticalScrollerImp shouldUsePresentationValue]) {
             float presentationValue;
             float overhangAmount;
             ScrollableArea::computeScrollbarValueAndOverhang(position.y(), totalContentsSize().height(), viewportRect.height(), presentationValue, overhangAmount);
-            [m_verticalScrollbarPainter setPresentationValue:presentationValue];
+            [m_verticalScrollerImp setPresentationValue:presentationValue];
         }
 
-        if ([m_horizontalScrollbarPainter shouldUsePresentationValue]) {
+        if ([m_horizontalScrollerImp shouldUsePresentationValue]) {
             float presentationValue;
             float overhangAmount;
             ScrollableArea::computeScrollbarValueAndOverhang(position.x(), totalContentsSize().width(), viewportRect.width(), presentationValue, overhangAmount);
-            [m_horizontalScrollbarPainter setPresentationValue:presentationValue];
+            [m_horizontalScrollerImp setPresentationValue:presentationValue];
         }
         [CATransaction unlock];
         [CATransaction commit];
index 65d989f..8ea6910 100644 (file)
@@ -30,9 +30,6 @@
 
 #if PLATFORM(COCOA)
 OBJC_CLASS NSScrollerImp;
-typedef NSScrollerImp *ScrollbarPainter;
-#else
-typedef void* ScrollbarPainter;
 #endif
 
 namespace WebCore {
index 3a04885..de62fe1 100644 (file)
 #include <wtf/RetainPtr.h>
 
 OBJC_CLASS WebScrollAnimationHelperDelegate;
-OBJC_CLASS WebScrollbarPainterControllerDelegate;
-OBJC_CLASS WebScrollbarPainterDelegate;
+OBJC_CLASS WebScrollerImpPairDelegate;
+OBJC_CLASS WebScrollerImpDelegate;
 
-typedef id ScrollbarPainterController;
+typedef id ScrollerImpPair;
 
 namespace WebCore {
 
@@ -69,10 +69,10 @@ private:
     RetainPtr<id> m_scrollAnimationHelper;
     RetainPtr<WebScrollAnimationHelperDelegate> m_scrollAnimationHelperDelegate;
 
-    RetainPtr<ScrollbarPainterController> m_scrollbarPainterController;
-    RetainPtr<WebScrollbarPainterControllerDelegate> m_scrollbarPainterControllerDelegate;
-    RetainPtr<WebScrollbarPainterDelegate> m_horizontalScrollbarPainterDelegate;
-    RetainPtr<WebScrollbarPainterDelegate> m_verticalScrollbarPainterDelegate;
+    RetainPtr<ScrollerImpPair> m_scrollbarPainterController;
+    RetainPtr<WebScrollerImpPairDelegate> m_scrollbarPainterControllerDelegate;
+    RetainPtr<WebScrollerImpDelegate> m_horizontalScrollerImpDelegate;
+    RetainPtr<WebScrollerImpDelegate> m_verticalScrollerImpDelegate;
 
     void initialScrollbarPaintTimerFired();
     Timer m_initialScrollbarPaintTimer;
index b5b4100..75d6916 100644 (file)
@@ -51,7 +51,7 @@ static ScrollbarThemeMac* macScrollbarTheme()
     return !scrollbarTheme.isMockTheme() ? static_cast<ScrollbarThemeMac*>(&scrollbarTheme) : nullptr;
 }
 
-static ScrollbarPainter scrollbarPainterForScrollbar(Scrollbar& scrollbar)
+static NSScrollerImp *scrollbarPainterForScrollbar(Scrollbar& scrollbar)
 {
     if (ScrollbarThemeMac* scrollbarTheme = macScrollbarTheme())
         return scrollbarTheme->painterForScrollbar(scrollbar);
@@ -163,14 +163,14 @@ static NSSize abs(NSSize size)
 
 @end
 
-@interface WebScrollbarPainterControllerDelegate : NSObject <NSScrollerImpPairDelegate>
+@interface WebScrollerImpPairDelegate : NSObject <NSScrollerImpPairDelegate>
 {
     ScrollableArea* _scrollableArea;
 }
 - (id)initWithScrollableArea:(ScrollableArea*)scrollableArea;
 @end
 
-@implementation WebScrollbarPainterControllerDelegate
+@implementation WebScrollerImpPairDelegate
 
 - (id)initWithScrollableArea:(ScrollableArea*)scrollableArea
 {
@@ -277,7 +277,7 @@ enum FeatureToAnimate {
 @interface WebScrollbarPartAnimation : NSAnimation
 {
     Scrollbar* _scrollbar;
-    RetainPtr<ScrollbarPainter> _scrollbarPainter;
+    RetainPtr<NSScrollerImp> _scrollbarPainter;
     FeatureToAnimate _featureToAnimate;
     CGFloat _startValue;
     CGFloat _endValue;
@@ -363,7 +363,7 @@ enum FeatureToAnimate {
 
 @end
 
-@interface WebScrollbarPainterDelegate : NSObject<NSAnimationDelegate, NSScrollerImpDelegate>
+@interface WebScrollerImpDelegate : NSObject<NSAnimationDelegate, NSScrollerImpDelegate>
 {
     WebCore::Scrollbar* _scrollbar;
 
@@ -376,7 +376,7 @@ enum FeatureToAnimate {
 - (void)cancelAnimations;
 @end
 
-@implementation WebScrollbarPainterDelegate
+@implementation WebScrollerImpDelegate
 
 - (id)initWithScrollbar:(WebCore::Scrollbar*)scrollbar
 {
@@ -456,7 +456,7 @@ enum FeatureToAnimate {
     return _scrollbar->supportsUpdateOnSecondaryThread();
 }
 
-- (void)setUpAlphaAnimation:(RetainPtr<WebScrollbarPartAnimation>&)scrollbarPartAnimation scrollerPainter:(ScrollbarPainter)scrollerPainter part:(WebCore::ScrollbarPart)part animateAlphaTo:(CGFloat)newAlpha duration:(NSTimeInterval)duration
+- (void)setUpAlphaAnimation:(RetainPtr<WebScrollbarPartAnimation>&)scrollbarPartAnimation scrollerPainter:(NSScrollerImp *)scrollerPainter part:(WebCore::ScrollbarPart)part animateAlphaTo:(CGFloat)newAlpha duration:(NSTimeInterval)duration
 {
     // If the user has scrolled the page, then the scrollbars must be animated here.
     // This overrides the early returns.
@@ -505,7 +505,7 @@ enum FeatureToAnimate {
 
     ASSERT(scrollerImp == scrollbarPainterForScrollbar(*_scrollbar));
 
-    ScrollbarPainter scrollerPainter = (ScrollbarPainter)scrollerImp;
+    NSScrollerImp *scrollerPainter = (NSScrollerImp *)scrollerImp;
     if (![self scrollAnimator]->scrollbarsCanBeActive()) {
         [scrollerImp setKnobAlpha:0];
         _scrollbar->invalidate();
@@ -514,7 +514,7 @@ enum FeatureToAnimate {
 
     // If we are fading the scrollbar away, that is a good indication that we are no longer going to
     // be moving it around on the scrolling thread. Calling [scrollerPainter setUsePresentationValue:NO]
-    // will pass that information on to the ScrollbarPainter API.
+    // will pass that information on to the NSScrollerImp API.
     if (newKnobAlpha == 0 && _scrollbar->supportsUpdateOnSecondaryThread())
         [scrollerPainter setUsePresentationValue:NO];
 
@@ -528,7 +528,7 @@ enum FeatureToAnimate {
 
     ASSERT(scrollerImp == scrollbarPainterForScrollbar(*_scrollbar));
 
-    ScrollbarPainter scrollerPainter = (ScrollbarPainter)scrollerImp;
+    NSScrollerImp *scrollerPainter = (NSScrollerImp *)scrollerImp;
     [self setUpAlphaAnimation:_trackAlphaAnimation scrollerPainter:scrollerPainter part:WebCore::BackTrackPart animateAlphaTo:newTrackAlpha duration:duration];
 }
 
@@ -539,7 +539,7 @@ enum FeatureToAnimate {
 
     ASSERT(scrollerImp == scrollbarPainterForScrollbar(*_scrollbar));
 
-    ScrollbarPainter scrollbarPainter = (ScrollbarPainter)scrollerImp;
+    NSScrollerImp *scrollbarPainter = (NSScrollerImp *)scrollerImp;
 
     // UIStateTransition always animates to 1. In case an animation is in progress this avoids a hard transition.
     [scrollbarPainter setUiStateTransitionProgress:1 - [scrollerImp uiStateTransitionProgress]];
@@ -570,7 +570,7 @@ enum FeatureToAnimate {
 
     ASSERT(scrollerImp == scrollbarPainterForScrollbar(*_scrollbar));
 
-    ScrollbarPainter scrollbarPainter = (ScrollbarPainter)scrollerImp;
+    NSScrollerImp *scrollbarPainter = (NSScrollerImp *)scrollerImp;
 
     // ExpansionTransition always animates to 1. In case an animation is in progress this avoids a hard transition.
     [scrollbarPainter setExpansionTransitionProgress:1 - [scrollerImp expansionTransitionProgress]];
@@ -626,7 +626,7 @@ ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea& scrollableArea)
     m_scrollAnimationHelperDelegate = adoptNS([[WebScrollAnimationHelperDelegate alloc] initWithScrollAnimator:this]);
     m_scrollAnimationHelper = adoptNS([[NSClassFromString(@"NSScrollAnimationHelper") alloc] initWithDelegate:m_scrollAnimationHelperDelegate.get()]);
 
-    m_scrollbarPainterControllerDelegate = adoptNS([[WebScrollbarPainterControllerDelegate alloc] initWithScrollableArea:&scrollableArea]);
+    m_scrollbarPainterControllerDelegate = adoptNS([[WebScrollerImpPairDelegate alloc] initWithScrollableArea:&scrollableArea]);
     m_scrollbarPainterController = adoptNS([[NSScrollerImpPair alloc] init]);
     [m_scrollbarPainterController setDelegate:m_scrollbarPainterControllerDelegate.get()];
     [m_scrollbarPainterController setScrollerStyle:recommendedScrollerStyle()];
@@ -637,8 +637,8 @@ ScrollAnimatorMac::~ScrollAnimatorMac()
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     [m_scrollbarPainterControllerDelegate invalidate];
     [m_scrollbarPainterController setDelegate:nil];
-    [m_horizontalScrollbarPainterDelegate invalidate];
-    [m_verticalScrollbarPainterDelegate invalidate];
+    [m_horizontalScrollerImpDelegate invalidate];
+    [m_verticalScrollerImpDelegate invalidate];
     [m_scrollAnimationHelperDelegate invalidate];
     END_BLOCK_OBJC_EXCEPTIONS;
 }
@@ -815,7 +815,7 @@ void ScrollAnimatorMac::mouseEnteredScrollbar(Scrollbar* scrollbar) const
     if ([m_scrollbarPainterController overlayScrollerStateIsLocked])
         return;
 
-    if (ScrollbarPainter painter = scrollbarPainterForScrollbar(*scrollbar))
+    if (NSScrollerImp *painter = scrollbarPainterForScrollbar(*scrollbar))
         [painter mouseEnteredScroller];
 }
 
@@ -828,7 +828,7 @@ void ScrollAnimatorMac::mouseExitedScrollbar(Scrollbar* scrollbar) const
     if ([m_scrollbarPainterController overlayScrollerStateIsLocked])
         return;
 
-    if (ScrollbarPainter painter = scrollbarPainterForScrollbar(*scrollbar))
+    if (NSScrollerImp *painter = scrollbarPainterForScrollbar(*scrollbar))
         [painter mouseExitedScroller];
 }
 
@@ -837,7 +837,7 @@ void ScrollAnimatorMac::mouseIsDownInScrollbar(Scrollbar* scrollbar, bool mouseI
     if ([m_scrollbarPainterController overlayScrollerStateIsLocked])
         return;
 
-    if (ScrollbarPainter painter = scrollbarPainterForScrollbar(*scrollbar)) {
+    if (NSScrollerImp *painter = scrollbarPainterForScrollbar(*scrollbar)) {
         [painter setTracking:mouseIsDown];
         if (mouseIsDown)
             [m_scrollbarPainterController beginScrollGesture];
@@ -942,14 +942,14 @@ bool ScrollAnimatorMac::scrollbarsCanBeActive() const
 
 void ScrollAnimatorMac::didAddVerticalScrollbar(Scrollbar* scrollbar)
 {
-    ScrollbarPainter painter = scrollbarPainterForScrollbar(*scrollbar);
+    NSScrollerImp *painter = scrollbarPainterForScrollbar(*scrollbar);
     if (!painter)
         return;
 
-    ASSERT(!m_verticalScrollbarPainterDelegate);
-    m_verticalScrollbarPainterDelegate = adoptNS([[WebScrollbarPainterDelegate alloc] initWithScrollbar:scrollbar]);
+    ASSERT(!m_verticalScrollerImpDelegate);
+    m_verticalScrollerImpDelegate = adoptNS([[WebScrollerImpDelegate alloc] initWithScrollbar:scrollbar]);
 
-    [painter setDelegate:m_verticalScrollbarPainterDelegate.get()];
+    [painter setDelegate:m_verticalScrollerImpDelegate.get()];
     if (GraphicsLayer* layer = scrollbar->scrollableArea().layerForVerticalScrollbar())
         [painter setLayer:layer->platformLayer()];
 
@@ -960,13 +960,13 @@ void ScrollAnimatorMac::didAddVerticalScrollbar(Scrollbar* scrollbar)
 
 void ScrollAnimatorMac::willRemoveVerticalScrollbar(Scrollbar* scrollbar)
 {
-    ScrollbarPainter painter = scrollbarPainterForScrollbar(*scrollbar);
+    NSScrollerImp *painter = scrollbarPainterForScrollbar(*scrollbar);
     if (!painter)
         return;
 
-    ASSERT(m_verticalScrollbarPainterDelegate);
-    [m_verticalScrollbarPainterDelegate invalidate];
-    m_verticalScrollbarPainterDelegate = nullptr;
+    ASSERT(m_verticalScrollerImpDelegate);
+    [m_verticalScrollerImpDelegate invalidate];
+    m_verticalScrollerImpDelegate = nullptr;
 
     [painter setDelegate:nil];
     [m_scrollbarPainterController setVerticalScrollerImp:nil];
@@ -974,14 +974,14 @@ void ScrollAnimatorMac::willRemoveVerticalScrollbar(Scrollbar* scrollbar)
 
 void ScrollAnimatorMac::didAddHorizontalScrollbar(Scrollbar* scrollbar)
 {
-    ScrollbarPainter painter = scrollbarPainterForScrollbar(*scrollbar);
+    NSScrollerImp *painter = scrollbarPainterForScrollbar(*scrollbar);
     if (!painter)
         return;
 
-    ASSERT(!m_horizontalScrollbarPainterDelegate);
-    m_horizontalScrollbarPainterDelegate = adoptNS([[WebScrollbarPainterDelegate alloc] initWithScrollbar:scrollbar]);
+    ASSERT(!m_horizontalScrollerImpDelegate);
+    m_horizontalScrollerImpDelegate = adoptNS([[WebScrollerImpDelegate alloc] initWithScrollbar:scrollbar]);
 
-    [painter setDelegate:m_horizontalScrollbarPainterDelegate.get()];
+    [painter setDelegate:m_horizontalScrollerImpDelegate.get()];
     if (GraphicsLayer* layer = scrollbar->scrollableArea().layerForHorizontalScrollbar())
         [painter setLayer:layer->platformLayer()];
 
@@ -992,13 +992,13 @@ void ScrollAnimatorMac::didAddHorizontalScrollbar(Scrollbar* scrollbar)
 
 void ScrollAnimatorMac::willRemoveHorizontalScrollbar(Scrollbar* scrollbar)
 {
-    ScrollbarPainter painter = scrollbarPainterForScrollbar(*scrollbar);
+    NSScrollerImp *painter = scrollbarPainterForScrollbar(*scrollbar);
     if (!painter)
         return;
 
-    ASSERT(m_horizontalScrollbarPainterDelegate);
-    [m_horizontalScrollbarPainterDelegate invalidate];
-    m_horizontalScrollbarPainterDelegate = nullptr;
+    ASSERT(m_horizontalScrollerImpDelegate);
+    [m_horizontalScrollerImpDelegate invalidate];
+    m_horizontalScrollerImpDelegate = nullptr;
 
     [painter setDelegate:nil];
     [m_scrollbarPainterController setHorizontalScrollerImp:nil];
@@ -1006,7 +1006,7 @@ void ScrollAnimatorMac::willRemoveHorizontalScrollbar(Scrollbar* scrollbar)
 
 void ScrollAnimatorMac::invalidateScrollbarPartLayers(Scrollbar* scrollbar)
 {
-    ScrollbarPainter painter = scrollbarPainterForScrollbar(*scrollbar);
+    NSScrollerImp *painter = scrollbarPainterForScrollbar(*scrollbar);
     [painter setNeedsDisplay:YES];
 }
 
@@ -1017,7 +1017,7 @@ void ScrollAnimatorMac::verticalScrollbarLayerDidChange()
     if (!scrollbar)
         return;
 
-    ScrollbarPainter painter = scrollbarPainterForScrollbar(*scrollbar);
+    NSScrollerImp *painter = scrollbarPainterForScrollbar(*scrollbar);
     if (!painter)
         return;
 
@@ -1031,7 +1031,7 @@ void ScrollAnimatorMac::horizontalScrollbarLayerDidChange()
     if (!scrollbar)
         return;
 
-    ScrollbarPainter painter = scrollbarPainterForScrollbar(*scrollbar);
+    NSScrollerImp *painter = scrollbarPainterForScrollbar(*scrollbar);
     if (!painter)
         return;
 
@@ -1048,7 +1048,7 @@ bool ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting(Scrollbar* scroll
         return true;
 
     // Overlay scrollbars should participate in hit testing whenever they are at all visible.
-    ScrollbarPainter painter = scrollbarPainterForScrollbar(*scrollbar);
+    NSScrollerImp *painter = scrollbarPainterForScrollbar(*scrollbar);
     if (!painter)
         return false;
     return [painter knobAlpha] > 0;
@@ -1058,7 +1058,7 @@ void ScrollAnimatorMac::notifyContentAreaScrolled(const FloatSize& delta)
 {
     // This function is called when a page is going into the page cache, but the page
     // isn't really scrolling in that case. We should only pass the message on to the
-    // ScrollbarPainterController when we're really scrolling on an active page.
+    // ScrollerImpPair when we're really scrolling on an active page.
     if ([m_scrollbarPainterController overlayScrollerStateIsLocked])
         return;
 
@@ -1074,8 +1074,8 @@ void ScrollAnimatorMac::cancelAnimations()
 
     if (scrollbarPaintTimerIsActive())
         stopScrollbarPaintTimer();
-    [m_horizontalScrollbarPainterDelegate cancelAnimations];
-    [m_verticalScrollbarPainterDelegate cancelAnimations];
+    [m_horizontalScrollerImpDelegate cancelAnimations];
+    [m_verticalScrollerImpDelegate cancelAnimations];
 }
 
 void ScrollAnimatorMac::handleWheelEventPhase(PlatformWheelEventPhase phase)
@@ -1302,8 +1302,8 @@ void ScrollAnimatorMac::updateScrollerStyle()
     if (Scrollbar* verticalScrollbar = scrollableArea().verticalScrollbar()) {
         verticalScrollbar->invalidate();
 
-        ScrollbarPainter oldVerticalPainter = [m_scrollbarPainterController verticalScrollerImp];
-        ScrollbarPainter newVerticalPainter = [NSScrollerImp scrollerImpWithStyle:newStyle controlSize:(NSControlSize)verticalScrollbar->controlSize() horizontal:NO replacingScrollerImp:oldVerticalPainter];
+        NSScrollerImp *oldVerticalPainter = [m_scrollbarPainterController verticalScrollerImp];
+        NSScrollerImp *newVerticalPainter = [NSScrollerImp scrollerImpWithStyle:newStyle controlSize:(NSControlSize)verticalScrollbar->controlSize() horizontal:NO replacingScrollerImp:oldVerticalPainter];
 
         [m_scrollbarPainterController setVerticalScrollerImp:newVerticalPainter];
         macTheme->setNewPainterForScrollbar(*verticalScrollbar, newVerticalPainter);
@@ -1318,8 +1318,8 @@ void ScrollAnimatorMac::updateScrollerStyle()
     if (Scrollbar* horizontalScrollbar = scrollableArea().horizontalScrollbar()) {
         horizontalScrollbar->invalidate();
 
-        ScrollbarPainter oldHorizontalPainter = [m_scrollbarPainterController horizontalScrollerImp];
-        ScrollbarPainter newHorizontalPainter = [NSScrollerImp scrollerImpWithStyle:newStyle controlSize:(NSControlSize)horizontalScrollbar->controlSize() horizontal:YES replacingScrollerImp:oldHorizontalPainter];
+        NSScrollerImp *oldHorizontalPainter = [m_scrollbarPainterController horizontalScrollerImp];
+        NSScrollerImp *newHorizontalPainter = [NSScrollerImp scrollerImpWithStyle:newStyle controlSize:(NSControlSize)horizontalScrollbar->controlSize() horizontal:YES replacingScrollerImp:oldHorizontalPainter];
 
         [m_scrollbarPainterController setHorizontalScrollerImp:newHorizontalPainter];
         macTheme->setNewPainterForScrollbar(*horizontalScrollbar, newHorizontalPainter);
@@ -1355,7 +1355,7 @@ void ScrollAnimatorMac::stopScrollbarPaintTimer()
 
 void ScrollAnimatorMac::initialScrollbarPaintTimerFired()
 {
-    // To force the scrollbars to flash, we have to call hide first. Otherwise, the ScrollbarPainterController
+    // To force the scrollbars to flash, we have to call hide first. Otherwise, the ScrollerImpPair
     // might think that the scrollbars are already showing and bail early.
     [m_scrollbarPainterController hideOverlayScrollers];
     [m_scrollbarPainterController flashScrollers];
index 7d136e4..e992a15 100644 (file)
@@ -56,8 +56,8 @@ public:
     void registerScrollbar(Scrollbar&) override;
     void unregisterScrollbar(Scrollbar&) override;
 
-    void setNewPainterForScrollbar(Scrollbar&, ScrollbarPainter);
-    ScrollbarPainter painterForScrollbar(Scrollbar&);
+    void setNewPainterForScrollbar(Scrollbar&, NSScrollerImp *);
+    NSScrollerImp *painterForScrollbar(Scrollbar&);
 
     void setPaintCharacteristicsForScrollbar(Scrollbar&);
 
index 27a19b9..750ae94 100644 (file)
@@ -53,11 +53,11 @@ using namespace WebCore;
 
 namespace WebCore {
 
-typedef HashMap<Scrollbar*, RetainPtr<ScrollbarPainter>> ScrollbarPainterMap;
+typedef HashMap<Scrollbar*, RetainPtr<NSScrollerImp>> ScrollerImpMap;
 
-static ScrollbarPainterMap* scrollbarMap()
+static ScrollerImpMap* scrollbarMap()
 {
-    static ScrollbarPainterMap* map = new ScrollbarPainterMap;
+    static ScrollerImpMap* map = new ScrollerImpMap;
     return map;
 }
 
@@ -86,8 +86,8 @@ static ScrollbarPainterMap* scrollbarMap()
     static_cast<ScrollbarThemeMac&>(theme).preferencesChanged();
     if (scrollbarMap()->isEmpty())
         return;
-    ScrollbarPainterMap::iterator end = scrollbarMap()->end();
-    for (ScrollbarPainterMap::iterator it = scrollbarMap()->begin(); it != end; ++it) {
+    ScrollerImpMap::iterator end = scrollbarMap()->end();
+    for (ScrollerImpMap::iterator it = scrollbarMap()->begin(); it != end; ++it) {
         it->key->styleChanged();
         it->key->invalidate();
     }
@@ -158,7 +158,7 @@ void ScrollbarThemeMac::registerScrollbar(Scrollbar& scrollbar)
         return;
 
     bool isHorizontal = scrollbar.orientation() == HorizontalScrollbar;
-    ScrollbarPainter scrollbarPainter = [NSScrollerImp scrollerImpWithStyle:recommendedScrollerStyle() controlSize:scrollbarControlSizeToNSControlSize(scrollbar.controlSize()) horizontal:isHorizontal replacingScrollerImp:nil];
+    NSScrollerImp *scrollbarPainter = [NSScrollerImp scrollerImpWithStyle:recommendedScrollerStyle() controlSize:scrollbarControlSizeToNSControlSize(scrollbar.controlSize()) horizontal:isHorizontal replacingScrollerImp:nil];
     scrollbarMap()->add(&scrollbar, scrollbarPainter);
     updateEnabledState(scrollbar);
     updateScrollbarOverlayStyle(scrollbar);
@@ -169,14 +169,14 @@ void ScrollbarThemeMac::unregisterScrollbar(Scrollbar& scrollbar)
     scrollbarMap()->remove(&scrollbar);
 }
 
-void ScrollbarThemeMac::setNewPainterForScrollbar(Scrollbar& scrollbar, ScrollbarPainter newPainter)
+void ScrollbarThemeMac::setNewPainterForScrollbar(Scrollbar& scrollbar, NSScrollerImp *newPainter)
 {
     scrollbarMap()->set(&scrollbar, newPainter);
     updateEnabledState(scrollbar);
     updateScrollbarOverlayStyle(scrollbar);
 }
 
-ScrollbarPainter ScrollbarThemeMac::painterForScrollbar(Scrollbar& scrollbar)
+NSScrollerImp *ScrollbarThemeMac::painterForScrollbar(Scrollbar& scrollbar)
 {
     return scrollbarMap()->get(&scrollbar).get();
 }
@@ -221,7 +221,7 @@ void ScrollbarThemeMac::preferencesChanged()
 int ScrollbarThemeMac::scrollbarThickness(ScrollbarControlSize controlSize)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    ScrollbarPainter scrollbarPainter = [NSScrollerImp scrollerImpWithStyle:recommendedScrollerStyle() controlSize:scrollbarControlSizeToNSControlSize(controlSize) horizontal:NO replacingScrollerImp:nil];
+    NSScrollerImp *scrollbarPainter = [NSScrollerImp scrollerImpWithStyle:recommendedScrollerStyle() controlSize:scrollbarControlSizeToNSControlSize(controlSize) horizontal:NO replacingScrollerImp:nil];
     [scrollbarPainter setExpanded:YES];
     return [scrollbarPainter trackBoxWidth];
     END_BLOCK_OBJC_EXCEPTIONS;
@@ -240,7 +240,7 @@ void ScrollbarThemeMac::usesOverlayScrollbarsChanged()
 void ScrollbarThemeMac::updateScrollbarOverlayStyle(Scrollbar& scrollbar)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    ScrollbarPainter painter = painterForScrollbar(scrollbar);
+    NSScrollerImp *painter = painterForScrollbar(scrollbar);
     switch (scrollbar.scrollableArea().scrollbarOverlayStyle()) {
     case ScrollbarOverlayStyleDefault:
         [painter setKnobStyle:NSScrollerKnobStyleDefault];
@@ -282,7 +282,7 @@ bool ScrollbarThemeMac::hasThumb(Scrollbar& scrollbar)
 {
     int minLengthForThumb;
 
-    ScrollbarPainter painter = scrollbarMap()->get(&scrollbar).get();
+    NSScrollerImp *painter = scrollbarMap()->get(&scrollbar).get();
     minLengthForThumb = [painter knobMinLength] + [painter trackOverlapEndInset] + [painter knobOverlapEndInset]
         + 2 * ([painter trackEndInset] + [painter knobEndInset]);
 
@@ -489,7 +489,7 @@ void ScrollbarThemeMac::updateEnabledState(Scrollbar& scrollbar)
 void ScrollbarThemeMac::setPaintCharacteristicsForScrollbar(Scrollbar& scrollbar)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
-    ScrollbarPainter painter = painterForScrollbar(scrollbar);
+    NSScrollerImp *painter = painterForScrollbar(scrollbar);
 
     float value;
     float overhang;
@@ -506,7 +506,7 @@ void ScrollbarThemeMac::setPaintCharacteristicsForScrollbar(Scrollbar& scrollbar
     END_BLOCK_OBJC_EXCEPTIONS;
 }
 
-static void scrollbarPainterPaint(ScrollbarPainter scrollbarPainter, bool enabled)
+static void scrollbarPainterPaint(NSScrollerImp *scrollbarPainter, bool enabled)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     // Use rectForPart: here; it will take the expansion transition progress into account.