| Index: third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm
|
| diff --git a/third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm b/third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm
|
| index 4e24d784b0aec535484986268dcbf54414ba0bb4..3828b0ea1d0e09f5f038895f0fcb38364d4644c2 100644
|
| --- a/third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm
|
| +++ b/third_party/WebKit/Source/platform/mac/ScrollAnimatorMac.mm
|
| @@ -433,9 +433,11 @@ private:
|
| break;
|
| case UIStateTransition:
|
| [_scrollbarPainter.get() setUiStateTransitionProgress:currentValue];
|
| + _scrollbar->setThumbNeedsRepaint(true);
|
| break;
|
| case ExpansionTransition:
|
| [_scrollbarPainter.get() setExpansionTransitionProgress:currentValue];
|
| + _scrollbar->setThumbNeedsRepaint(true);
|
| break;
|
| }
|
|
|
| @@ -460,6 +462,7 @@ private:
|
| RetainPtr<WebScrollbarPartAnimation> _trackAlphaAnimation;
|
| RetainPtr<WebScrollbarPartAnimation> _uiStateTransitionAnimation;
|
| RetainPtr<WebScrollbarPartAnimation> _expansionTransitionAnimation;
|
| + BOOL _hasExpandedSinceInvisible;
|
| }
|
| - (id)initWithScrollbar:(blink::Scrollbar*)scrollbar;
|
| - (void)updateVisibilityImmediately:(bool)show;
|
| @@ -642,6 +645,20 @@ private:
|
|
|
| - (void)scrollerImp:(id)scrollerImp overlayScrollerStateChangedTo:(NSUInteger)newOverlayScrollerState
|
| {
|
| + enum {
|
| + NSScrollerStateInvisible = 0,
|
| + NSScrollerStateKnob = 1,
|
| + NSScrollerStateExpanded = 2
|
| + };
|
| + // We do not receive notifications about the thumb un-expanding when the scrollbar fades away. Ensure
|
| + // that we re-paint the thumb the next time that we transition away from being invisible, so that
|
| + // the thumb doesn't stick in an expanded state.
|
| + if (newOverlayScrollerState == NSScrollerStateExpanded) {
|
| + _hasExpandedSinceInvisible = YES;
|
| + } else if (newOverlayScrollerState != NSScrollerStateInvisible && _hasExpandedSinceInvisible) {
|
| + _scrollbar->setThumbNeedsRepaint(true);
|
| + _hasExpandedSinceInvisible = NO;
|
| + }
|
| }
|
|
|
| - (void)invalidate
|
| @@ -799,10 +816,6 @@ void ScrollAnimatorMac::mouseMovedInContentArea() const
|
|
|
| void ScrollAnimatorMac::mouseEnteredScrollbar(Scrollbar* scrollbar) const
|
| {
|
| - // At this time, only legacy scrollbars needs to send notifications here.
|
| - if (ScrollbarThemeMacCommon::recommendedScrollerStyle() != NSScrollerStyleLegacy)
|
| - return;
|
| -
|
| if (!scrollableArea()->scrollbarsCanBeActive())
|
| return;
|
|
|
| @@ -816,10 +829,6 @@ void ScrollAnimatorMac::mouseEnteredScrollbar(Scrollbar* scrollbar) const
|
|
|
| void ScrollAnimatorMac::mouseExitedScrollbar(Scrollbar* scrollbar) const
|
| {
|
| - // At this time, only legacy scrollbars needs to send notifications here.
|
| - if (ScrollbarThemeMacCommon::recommendedScrollerStyle() != NSScrollerStyleLegacy)
|
| - return;
|
| -
|
| if (!scrollableArea()->scrollbarsCanBeActive())
|
| return;
|
|
|
| @@ -1077,6 +1086,8 @@ void ScrollAnimatorMac::updateScrollerStyle()
|
| NSScrollerStyle newStyle = [m_scrollbarPainterController.get() scrollerStyle];
|
|
|
| if (Scrollbar* verticalScrollbar = scrollableArea()->verticalScrollbar()) {
|
| + verticalScrollbar->setTrackBackgroudNeedsRepaint(true);
|
| + verticalScrollbar->setThumbNeedsRepaint(true);
|
| verticalScrollbar->setNeedsPaintInvalidation();
|
|
|
| ScrollbarPainter oldVerticalPainter = [m_scrollbarPainterController.get() verticalScrollerImp];
|
| @@ -1095,6 +1106,8 @@ void ScrollAnimatorMac::updateScrollerStyle()
|
| }
|
|
|
| if (Scrollbar* horizontalScrollbar = scrollableArea()->horizontalScrollbar()) {
|
| + horizontalScrollbar->setTrackBackgroudNeedsRepaint(true);
|
| + horizontalScrollbar->setThumbNeedsRepaint(true);
|
| horizontalScrollbar->setNeedsPaintInvalidation();
|
|
|
| ScrollbarPainter oldHorizontalPainter = [m_scrollbarPainterController.get() horizontalScrollerImp];
|
|
|