Changeset 89066 in webkit


Ignore:
Timestamp:
Jun 16, 2011 2:20:52 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-16 Sailesh Agrawal <sail@chromium.org>

Reviewed by Mihai Parparita.

[Chromium] Update forked ScrollAnimatorChromiumMac.mm/h
https://bugs.webkit.org/show_bug.cgi?id=62779

Updated ScrollAnimatorChromiumMac.mm/h with the latest code in WebCore/platform/mac/ScrollAnimatorMac.mm/h

  • platform/chromium/ScrollAnimatorChromiumMac.h: (WebCore::ScrollAnimatorChromiumMac::setNeedsScrollerStyleUpdate): (WebCore::ScrollAnimatorChromiumMac::needsScrollerStyleUpdate):
  • platform/chromium/ScrollAnimatorChromiumMac.mm: (-[ScrollAnimationHelperDelegate _immediateScrollToPoint:]): (-[ScrollbarPainterControllerDelegate scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle:]): (WebCore::ScrollAnimatorChromiumMac::ScrollAnimatorChromiumMac): (WebCore::ScrollAnimatorChromiumMac::scroll): (WebCore::ScrollAnimatorChromiumMac::immediateScrollToPointForScrollAnimation): (WebCore::isScrollingLeftAndShouldNotRubberBand): (WebCore::isScrollingRightAndShouldNotRubberBand): (WebCore::ScrollAnimatorChromiumMac::handleWheelEvent): (WebCore::ScrollAnimatorChromiumMac::smoothScrollWithEvent): (WebCore::ScrollAnimatorChromiumMac::beginScrollGesture): (WebCore::ScrollAnimatorChromiumMac::snapRubberBand): (WebCore::ScrollAnimatorChromiumMac::snapRubberBandTimerFired): (WebCore::ScrollAnimatorChromiumMac::setIsActive): (WebCore::ScrollAnimatorChromiumMac::updateScrollerStyle):
  • platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.h:
  • platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.mm: (wkScrollbarPainterControllerStyle):
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r89065 r89066  
     12011-06-16  Sailesh Agrawal  <sail@chromium.org>
     2
     3        Reviewed by Mihai Parparita.
     4
     5        [Chromium] Update forked ScrollAnimatorChromiumMac.mm/h
     6        https://bugs.webkit.org/show_bug.cgi?id=62779
     7
     8        Updated ScrollAnimatorChromiumMac.mm/h with the latest code in WebCore/platform/mac/ScrollAnimatorMac.mm/h
     9
     10        * platform/chromium/ScrollAnimatorChromiumMac.h:
     11        (WebCore::ScrollAnimatorChromiumMac::setNeedsScrollerStyleUpdate):
     12        (WebCore::ScrollAnimatorChromiumMac::needsScrollerStyleUpdate):
     13        * platform/chromium/ScrollAnimatorChromiumMac.mm:
     14        (-[ScrollAnimationHelperDelegate _immediateScrollToPoint:]):
     15        (-[ScrollbarPainterControllerDelegate scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle:]):
     16        (WebCore::ScrollAnimatorChromiumMac::ScrollAnimatorChromiumMac):
     17        (WebCore::ScrollAnimatorChromiumMac::scroll):
     18        (WebCore::ScrollAnimatorChromiumMac::immediateScrollToPointForScrollAnimation):
     19        (WebCore::isScrollingLeftAndShouldNotRubberBand):
     20        (WebCore::isScrollingRightAndShouldNotRubberBand):
     21        (WebCore::ScrollAnimatorChromiumMac::handleWheelEvent):
     22        (WebCore::ScrollAnimatorChromiumMac::smoothScrollWithEvent):
     23        (WebCore::ScrollAnimatorChromiumMac::beginScrollGesture):
     24        (WebCore::ScrollAnimatorChromiumMac::snapRubberBand):
     25        (WebCore::ScrollAnimatorChromiumMac::snapRubberBandTimerFired):
     26        (WebCore::ScrollAnimatorChromiumMac::setIsActive):
     27        (WebCore::ScrollAnimatorChromiumMac::updateScrollerStyle):
     28        * platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.h:
     29        * platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.mm:
     30        (wkScrollbarPainterControllerStyle):
     31
    1322011-06-16  Sailesh Agrawal  <sail@chromium.org>
    233
  • trunk/Source/WebCore/platform/chromium/ScrollAnimatorChromiumMac.h

    r89016 r89066  
    7272    void immediateScrollByDeltaY(float deltaY);
    7373
     74    void immediateScrollToPointForScrollAnimation(const FloatPoint& newPosition);
     75
    7476    void setIsDrawingIntoLayer(bool b) { m_drawingIntoLayer = b; }
    7577    bool isDrawingIntoLayer() const { return m_drawingIntoLayer; }
     
    7779    bool haveScrolledSincePageLoad() const { return m_haveScrolledSincePageLoad; }
    7880
     81    virtual void setIsActive();
     82
    7983#if USE(WK_SCROLLBAR_PAINTER)
     84    void updateScrollerStyle();
     85
    8086    bool scrollbarPaintTimerIsActive() const;
    8187    void startScrollbarPaintTimer();
     
    116122    virtual void willRemoveHorizontalScrollbar(Scrollbar*);
    117123
     124    void setNeedsScrollerStyleUpdate(bool needsUpdate) { m_needsScrollerStyleUpdate = needsUpdate; }
     125    bool needsScrollerStyleUpdate() const { return m_needsScrollerStyleUpdate; }
     126
    118127    float adjustScrollXPositionIfNecessary(float) const;
    119128    float adjustScrollYPositionIfNecessary(float) const;
     
    133142    bool m_momentumScrollInProgress;
    134143    bool m_ignoreMomentumScrolls;
    135    
    136     CFTimeInterval m_lastMomemtumScrollTimestamp;
     144
     145    bool m_scrollerInitiallyPinnedOnLeft;
     146    bool m_scrollerInitiallyPinnedOnRight;
     147    int m_cumulativeHorizontalScroll;
     148    bool m_didCumulativeHorizontalScrollEverSwitchToOppositeDirectionOfPin;
     149
     150    CFTimeInterval m_lastMomentumScrollTimestamp;
    137151    FloatSize m_overflowScrollDelta;
    138152    FloatSize m_stretchScrollForce;
     
    148162    bool m_drawingIntoLayer;
    149163    bool m_haveScrolledSincePageLoad;
     164    bool m_needsScrollerStyleUpdate;
    150165    IntRect m_visibleScrollerThumbRect;
    151166};
  • trunk/Source/WebCore/platform/chromium/ScrollAnimatorChromiumMac.mm

    r89016 r89066  
    5757- (BOOL)_isAnimating;
    5858- (NSPoint)targetOrigin;
     59- (CGFloat)_progress;
    5960@end
    6061
     
    106107    if (!_animator)
    107108        return;
    108     _animator->immediateScrollToPoint(newPosition);
     109    _animator->immediateScrollToPointForScrollAnimation(newPosition);
    109110}
    110111
     
    243244        return;
    244245
    245     WKScrollbarPainterControllerRef painterController = (WKScrollbarPainterControllerRef)scrollerImpPair;
    246     WebCore::ScrollbarThemeChromiumMac* macTheme = (WebCore::ScrollbarThemeChromiumMac*)WebCore::ScrollbarTheme::nativeTheme();
    247 
    248     WKScrollbarPainterRef oldVerticalPainter = wkVerticalScrollbarPainterForController(painterController);
    249     if (oldVerticalPainter) {
    250         WebCore::Scrollbar* verticalScrollbar = _animator->scrollableArea()->verticalScrollbar();
    251         WKScrollbarPainterRef newVerticalPainter = wkMakeScrollbarReplacementPainter(oldVerticalPainter,
    252                                                                                      newRecommendedScrollerStyle,
    253                                                                                      verticalScrollbar->controlSize(),
    254                                                                                      false);
    255         macTheme->setNewPainterForScrollbar(verticalScrollbar, newVerticalPainter);
    256         wkSetPainterForPainterController(painterController, newVerticalPainter, false);
    257 
    258         // The different scrollbar styles have different thicknesses, so we must re-set the
    259         // frameRect to the new thickness, and the re-layout below will ensure the position
    260         // and length are properly updated.
    261         int thickness = macTheme->scrollbarThickness(verticalScrollbar->controlSize());
    262         verticalScrollbar->setFrameRect(WebCore::IntRect(0, 0, thickness, thickness));
    263     }
    264 
    265     WKScrollbarPainterRef oldHorizontalPainter = wkHorizontalScrollbarPainterForController(painterController);
    266     if (oldHorizontalPainter) {
    267         WebCore::Scrollbar* horizontalScrollbar = _animator->scrollableArea()->horizontalScrollbar();
    268         WKScrollbarPainterRef newHorizontalPainter = wkMakeScrollbarReplacementPainter(oldHorizontalPainter,
    269                                                                                        newRecommendedScrollerStyle,
    270                                                                                        horizontalScrollbar->controlSize(),
    271                                                                                        true);
    272         macTheme->setNewPainterForScrollbar(horizontalScrollbar, newHorizontalPainter);
    273         wkSetPainterForPainterController(painterController, newHorizontalPainter, true);
    274 
    275         // The different scrollbar styles have different thicknesses, so we must re-set the
    276         // frameRect to the new thickness, and the re-layout below will ensure the position
    277         // and length are properly updated.
    278         int thickness = macTheme->scrollbarThickness(horizontalScrollbar->controlSize());
    279         horizontalScrollbar->setFrameRect(WebCore::IntRect(0, 0, thickness, thickness));
    280     }
    281 
    282     wkSetScrollbarPainterControllerStyle(painterController, newRecommendedScrollerStyle);
    283 
    284     // The different scrollbar styles affect layout, so we must re-layout everything.
    285     _animator->scrollableArea()->scrollbarStyleChanged();
     246    wkSetScrollbarPainterControllerStyle((WKScrollbarPainterControllerRef)scrollerImpPair, newRecommendedScrollerStyle);
     247    _animator->updateScrollerStyle();
    286248}
    287249
     
    507469    , m_momentumScrollInProgress(false)
    508470    , m_ignoreMomentumScrolls(false)
    509     , m_lastMomemtumScrollTimestamp(0)
     471    , m_lastMomentumScrollTimestamp(0)
    510472    , m_startTime(0)
    511473    , m_snapRubberBandTimer(this, &ScrollAnimatorChromiumMac::snapRubberBandTimerFired)
     
    513475    , m_drawingIntoLayer(false)
    514476    , m_haveScrolledSincePageLoad(false)
     477    , m_needsScrollerStyleUpdate(false)
    515478{
    516479    m_scrollAnimationHelperDelegate.adoptNS([[ScrollAnimationHelperDelegate alloc] initWithScrollAnimator:this]);
     
    557520        NSPoint targetOrigin = [m_scrollAnimationHelper.get() targetOrigin];
    558521        newPoint = orientation == HorizontalScrollbar ? NSMakePoint(newPos, targetOrigin.y) : NSMakePoint(targetOrigin.x, newPos);
    559     } else
     522    } else {
    560523        newPoint = orientation == HorizontalScrollbar ? NSMakePoint(newPos, m_currentPosY) : NSMakePoint(m_currentPosX, newPos);
    561 
     524        m_scrollableArea->didStartAnimatedScroll();
     525    }
    562526    [m_scrollAnimationHelper.get() scrollToPoint:newPoint];
    563527    return true;
     
    629593    m_currentPosY = newPosY;
    630594    notityPositionChanged();
     595}
     596
     597void ScrollAnimatorChromiumMac::immediateScrollToPointForScrollAnimation(const FloatPoint& newPosition)
     598{
     599    ASSERT(m_scrollAnimationHelper);
     600    CGFloat progress = [m_scrollAnimationHelper.get() _progress];
     601   
     602    immediateScrollToPoint(newPosition);
     603
     604    if (progress >= 1.0)
     605        m_scrollableArea->didCompleteAnimatedScroll();
    631606}
    632607
     
    793768    }
    794769    return multiplier;
     770}
     771
     772static inline bool isScrollingLeftAndShouldNotRubberBand(PlatformWheelEvent& wheelEvent, ScrollableArea* scrollableArea)
     773{
     774    return wheelEvent.deltaX() > 0 && !scrollableArea->shouldRubberBandInDirection(ScrollLeft);
     775}
     776
     777static inline bool isScrollingRightAndShouldNotRubberBand(PlatformWheelEvent& wheelEvent, ScrollableArea* scrollableArea)
     778{
     779    return wheelEvent.deltaX() < 0 && !scrollableArea->shouldRubberBandInDirection(ScrollRight);
    795780}
    796781
     
    818803            return;
    819804        }
     805       
     806        if (m_scrollableArea->horizontalScrollbar()) {
     807            // If there is a scrollbar, we aggregate the wheel events to get an
     808            // overall trend of the scroll. If the direction of the scroll is ever
     809            // in the opposite direction of the pin location, then we switch the
     810            // boolean, and rubber band. That is, if we were pinned to the left,
     811            // and we ended up scrolling to the right, we rubber band.
     812            m_cumulativeHorizontalScroll += wheelEvent.deltaX();
     813            if (m_scrollerInitiallyPinnedOnLeft && m_cumulativeHorizontalScroll < 0)
     814                m_didCumulativeHorizontalScrollEverSwitchToOppositeDirectionOfPin = true;
     815            if (m_scrollerInitiallyPinnedOnRight && m_cumulativeHorizontalScroll > 0)
     816                m_didCumulativeHorizontalScrollEverSwitchToOppositeDirectionOfPin = true;
     817        }
     818
     819        // After a gesture begins, we go through:
     820        // 1+ PlatformWheelEventPhaseNone
     821        // 0+ PlatformWheelEventPhaseChanged
     822        // 1 PlatformWheelEventPhaseEnded if there was at least one changed event
     823        if (wheelEvent.momentumPhase() == PlatformWheelEventPhaseNone && !m_didCumulativeHorizontalScrollEverSwitchToOppositeDirectionOfPin) {
     824            if ((isScrollingLeftAndShouldNotRubberBand(wheelEvent, m_scrollableArea) &&
     825                m_scrollerInitiallyPinnedOnLeft &&
     826                m_scrollableArea->isHorizontalScrollerPinnedToMinimumPosition()) ||
     827                (isScrollingRightAndShouldNotRubberBand(wheelEvent, m_scrollableArea) &&
     828                m_scrollerInitiallyPinnedOnRight &&
     829                m_scrollableArea->isHorizontalScrollerPinnedToMaximumPosition())) {
     830                ScrollAnimator::handleWheelEvent(wheelEvent);
     831                return;
     832            }
     833        }
     834    }
     835
     836    bool isMomentumScrollEvent = (wheelEvent.momentumPhase() != PlatformWheelEventPhaseNone);
     837    if (m_ignoreMomentumScrolls && (isMomentumScrollEvent || m_snapRubberBandTimer.isActive())) {
     838        if (wheelEvent.momentumPhase() == PlatformWheelEventPhaseEnded) {
     839            m_ignoreMomentumScrolls = false;
     840            wheelEvent.accept();
     841        }
     842        return;
    820843    }
    821844
    822845    wheelEvent.accept();
    823 
    824     bool isMometumScrollEvent = (wheelEvent.momentumPhase() != PlatformWheelEventPhaseNone);
    825     if (m_ignoreMomentumScrolls && (isMometumScrollEvent || m_snapRubberBandTimer.isActive())) {
    826         if (wheelEvent.momentumPhase() == PlatformWheelEventPhaseEnded)
    827             m_ignoreMomentumScrolls = false;
    828         return;
    829     }
    830 
    831846    smoothScrollWithEvent(wheelEvent);
    832847}
     
    912927    m_overflowScrollDelta = FloatSize();
    913928
    914     float eventCoallescedDeltaX = -wheelEvent.deltaX();
    915     float eventCoallescedDeltaY = -wheelEvent.deltaY();
    916 
    917     deltaX += eventCoallescedDeltaX;
    918     deltaY += eventCoallescedDeltaY;
     929    float eventCoalescedDeltaX = -wheelEvent.deltaX();
     930    float eventCoalescedDeltaY = -wheelEvent.deltaY();
     931
     932    deltaX += eventCoalescedDeltaX;
     933    deltaY += eventCoalescedDeltaY;
    919934
    920935    // Slightly prefer scrolling vertically by applying the = case to deltaY
     
    939954        m_momentumScrollInProgress = true;
    940955
    941     CFTimeInterval timeDelta = wheelEvent.timestamp() - m_lastMomemtumScrollTimestamp;
     956    CFTimeInterval timeDelta = wheelEvent.timestamp() - m_lastMomentumScrollTimestamp;
    942957    if (m_inScrollGesture || m_momentumScrollInProgress) {
    943         if (m_lastMomemtumScrollTimestamp && timeDelta > 0 && timeDelta < scrollVelocityZeroingTimeout) {
    944             m_momentumVelocity.setWidth(eventCoallescedDeltaX / (float)timeDelta);
    945             m_momentumVelocity.setHeight(eventCoallescedDeltaY / (float)timeDelta);
    946             m_lastMomemtumScrollTimestamp = wheelEvent.timestamp();
     958        if (m_lastMomentumScrollTimestamp && timeDelta > 0 && timeDelta < scrollVelocityZeroingTimeout) {
     959            m_momentumVelocity.setWidth(eventCoalescedDeltaX / (float)timeDelta);
     960            m_momentumVelocity.setHeight(eventCoalescedDeltaY / (float)timeDelta);
     961            m_lastMomentumScrollTimestamp = wheelEvent.timestamp();
    947962        } else {
    948             m_lastMomemtumScrollTimestamp = wheelEvent.timestamp();
     963            m_lastMomentumScrollTimestamp = wheelEvent.timestamp();
    949964            m_momentumVelocity = FloatSize();
    950965        }
     
    10001015            if (!allowsHorizontalStretching()) {
    10011016                deltaX = 0;
    1002                 eventCoallescedDeltaX = 0;
     1017                eventCoalescedDeltaX = 0;
    10031018            } else if ((deltaX != 0) && !isHorizontallyStretched && !pinnedInDirection(deltaX, 0)) {
    10041019                deltaX *= scrollWheelMultiplier();
     
    10131028            if (!allowsVerticalStretching()) {
    10141029                deltaY = 0;
    1015                 eventCoallescedDeltaY = 0;
     1030                eventCoalescedDeltaY = 0;
    10161031            } else if ((deltaY != 0) && !isVerticallyStretched && !pinnedInDirection(0, deltaY)) {
    10171032                deltaY *= scrollWheelMultiplier();
     
    10271042       
    10281043            if (m_momentumScrollInProgress) {
    1029                 if ((pinnedInDirection(eventCoallescedDeltaX, eventCoallescedDeltaY) || (fabsf(eventCoallescedDeltaX) + fabsf(eventCoallescedDeltaY) <= 0)) && m_lastMomemtumScrollTimestamp) {
     1044                if ((pinnedInDirection(eventCoalescedDeltaX, eventCoalescedDeltaY) || (fabsf(eventCoalescedDeltaX) + fabsf(eventCoalescedDeltaY) <= 0)) && m_lastMomentumScrollTimestamp) {
    10301045                    m_ignoreMomentumScrolls = true;
    10311046                    m_momentumScrollInProgress = false;
     
    10521067        m_momentumScrollInProgress = false;
    10531068        m_ignoreMomentumScrolls = false;
    1054         m_lastMomemtumScrollTimestamp = 0;
     1069        m_lastMomentumScrollTimestamp = 0;
    10551070    }
    10561071}
     
    10641079    m_momentumScrollInProgress = false;
    10651080    m_ignoreMomentumScrolls = false;
    1066     m_lastMomemtumScrollTimestamp = 0;
     1081    m_lastMomentumScrollTimestamp = 0;
    10671082    m_momentumVelocity = FloatSize();
    1068 
     1083    m_scrollerInitiallyPinnedOnLeft = m_scrollableArea->isHorizontalScrollerPinnedToMinimumPosition();
     1084    m_scrollerInitiallyPinnedOnRight = m_scrollableArea->isHorizontalScrollerPinnedToMaximumPosition();
     1085    m_cumulativeHorizontalScroll = 0;
     1086    m_didCumulativeHorizontalScrollEverSwitchToOppositeDirectionOfPin = false;
     1087   
    10691088    IntSize stretchAmount = m_scrollableArea->overhangAmount();
    10701089    m_stretchScrollForce.setWidth(reboundDeltaForElasticDelta(stretchAmount.width()));
     
    10861105void ScrollAnimatorChromiumMac::snapRubberBand()
    10871106{
    1088     CFTimeInterval timeDelta = [[NSProcessInfo processInfo] systemUptime] - m_lastMomemtumScrollTimestamp;
    1089     if (m_lastMomemtumScrollTimestamp && timeDelta >= scrollVelocityZeroingTimeout)
     1107    CFTimeInterval timeDelta = [[NSProcessInfo processInfo] systemUptime] - m_lastMomentumScrollTimestamp;
     1108    if (m_lastMomentumScrollTimestamp && timeDelta >= scrollVelocityZeroingTimeout)
    10901109        m_momentumVelocity = FloatSize();
    10911110
     
    11341153                return;
    11351154            }
     1155
     1156            m_scrollableArea->didStartRubberBand(roundedIntSize(m_startStretch));
    11361157
    11371158            m_origOrigin = (m_scrollableArea->visibleContentRect().location() + m_scrollableArea->scrollOrigin()) - m_startStretch;
     
    11871208#endif
    11881209
     1210void ScrollAnimatorChromiumMac::setIsActive()
     1211{
     1212    if (isScrollbarOverlayAPIAvailable()) {
     1213        if (needsScrollerStyleUpdate())
     1214            updateScrollerStyle();
     1215    }
     1216}
     1217
    11891218#if USE(WK_SCROLLBAR_PAINTER)
     1219void ScrollAnimatorChromiumMac::updateScrollerStyle()
     1220{
     1221    if (!scrollableArea()->isOnActivePage()) {
     1222        setNeedsScrollerStyleUpdate(true);
     1223        return;
     1224    }
     1225
     1226    ScrollbarThemeChromiumMac* macTheme = (ScrollbarThemeChromiumMac*)ScrollbarTheme::nativeTheme();
     1227    int newStyle = wkScrollbarPainterControllerStyle(m_scrollbarPainterController.get());
     1228
     1229    if (Scrollbar* verticalScrollbar = scrollableArea()->verticalScrollbar()) {
     1230        verticalScrollbar->invalidate();
     1231
     1232        WKScrollbarPainterRef oldVerticalPainter = wkVerticalScrollbarPainterForController(m_scrollbarPainterController.get());
     1233        WKScrollbarPainterRef newVerticalPainter = wkMakeScrollbarReplacementPainter(oldVerticalPainter,
     1234                                                                                     newStyle,
     1235                                                                                     verticalScrollbar->controlSize(),
     1236                                                                                     false);
     1237        macTheme->setNewPainterForScrollbar(verticalScrollbar, newVerticalPainter);
     1238        wkSetPainterForPainterController(m_scrollbarPainterController.get(), newVerticalPainter, false);
     1239
     1240        // The different scrollbar styles have different thicknesses, so we must re-set the
     1241        // frameRect to the new thickness, and the re-layout below will ensure the position
     1242        // and length are properly updated.
     1243        int thickness = macTheme->scrollbarThickness(verticalScrollbar->controlSize());
     1244        verticalScrollbar->setFrameRect(IntRect(0, 0, thickness, thickness));
     1245    }
     1246
     1247    if (Scrollbar* horizontalScrollbar = scrollableArea()->horizontalScrollbar()) {
     1248        horizontalScrollbar->invalidate();
     1249
     1250        WKScrollbarPainterRef oldHorizontalPainter = wkHorizontalScrollbarPainterForController(m_scrollbarPainterController.get());
     1251        WKScrollbarPainterRef newHorizontalPainter = wkMakeScrollbarReplacementPainter(oldHorizontalPainter,
     1252                                                                                       newStyle,
     1253                                                                                       horizontalScrollbar->controlSize(),
     1254                                                                                       true);
     1255        macTheme->setNewPainterForScrollbar(horizontalScrollbar, newHorizontalPainter);
     1256        wkSetPainterForPainterController(m_scrollbarPainterController.get(), newHorizontalPainter, true);
     1257
     1258        // The different scrollbar styles have different thicknesses, so we must re-set the
     1259        // frameRect to the new thickness, and the re-layout below will ensure the position
     1260        // and length are properly updated.
     1261        int thickness = macTheme->scrollbarThickness(horizontalScrollbar->controlSize());
     1262        horizontalScrollbar->setFrameRect(IntRect(0, 0, thickness, thickness));
     1263    }
     1264
     1265    // If needsScrollerStyleUpdate() is true, then the page is restoring from the page cache, and
     1266    // a relayout will happen on its own. Otherwise, we must initiate a re-layout ourselves.
     1267    if (!needsScrollerStyleUpdate())
     1268        scrollableArea()->scrollbarStyleChanged();
     1269
     1270    setNeedsScrollerStyleUpdate(false);
     1271}
     1272
    11901273void ScrollAnimatorChromiumMac::startScrollbarPaintTimer()
    11911274{
  • trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.h

    r89016 r89066  
    9696WKScrollbarPainterRef wkVerticalScrollbarPainterForController(WKScrollbarPainterControllerRef);
    9797WKScrollbarPainterRef wkHorizontalScrollbarPainterForController(WKScrollbarPainterControllerRef);
     98NSScrollerStyle wkScrollbarPainterControllerStyle(WKScrollbarPainterControllerRef);
    9899
    99100#endif // USE(WK_SCROLLBAR_PAINTER)
  • trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.mm

    r89065 r89066  
    209209}
    210210
     211NSScrollerStyle wkScrollbarPainterControllerStyle(WKScrollbarPainterControllerRef controller)
     212{
     213    return [controller scrollerStyle];
     214}
     215
    211216WKScrollbarPainterRef wkMakeScrollbarReplacementPainter(WKScrollbarPainterRef oldPainter, int newStyle, int controlSize, bool isHorizontal)
    212217{
Note: See TracChangeset for help on using the changeset viewer.