Changeset 180902 in webkit


Ignore:
Timestamp:
Mar 2, 2015 3:49:24 PM (9 years ago)
Author:
Brent Fulgham
Message:

Move scroll animating functions from ScrollAnimator to ScrollController
https://bugs.webkit.org/show_bug.cgi?id=142102
<rdar://problem/20007161>

Reviewed by Simon Fraser.

No change in functionality.

Do some refactoring of the various scrolling classes:

  1. Consolidate animation times to RunLoop::Timer instead of a combination of WebCore::Timer and CFRunLoopTimers. Do this for Scroll Snap Point and Rubberband animations.
  2. Move ScrollController from platform/mac to platform/cocoa to enable sharing with iOS.
  3. Move code from ScrollAnimator{Mac} -> ScrollController.
  4. Rename scrollOffsetInAxis -> scrollOffsetOnAxis
  5. Rename immediateScrollInAxis -> immediateScrollOnAxis
  • WebCore.xcodeproj/project.pbxproj: Move ScrollController to 'platform/cocoa'
  • page/mac/EventHandlerMac.mm: Make sure the scroll controller is notified of end-of-scroll

events, just as is done for the "event not handled" case in EventHandler.cpp.
(WebCore::EventHandler::platformCompleteWheelEvent):

  • page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Remove timer and some delegate

methods, now that ScrollController is controlling this state.

  • page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:

(WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): We no longer
need to clean up the CFRunLoopTimer.
(WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Add temporary stub needed
until Bug 141973 is completed.).
(WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Ditto.
(WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Deleted.

  • platform/ScrollAnimator.cpp:

(WebCore::ScrollAnimator::ScrollAnimator):
(WebCore::ScrollAnimator::processWheelEventForScrollSnap): Just call the ScrollController method.
(WebCore::ScrollAnimator::handleWheelEvent): Ditto.
(WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Ditto.
(WebCore::ScrollAnimator::scrollOffsetOnAxis): Renamed from scrollOffsetInAxis.
(WebCore::ScrollAnimator::scrollOffsetInAxis): Deleted.
(WebCore::ScrollAnimator::immediateScrollOnAxis): Renamed from immediateScrollInAxis.
(WebCore::ScrollAnimator::immediateScrollInAxis): Deleted.
(WebCore::ScrollAnimator::startScrollSnapTimer): Deleted.
(WebCore::ScrollAnimator::stopScrollSnapTimer): Deleted.
(WebCore::ScrollAnimator::horizontalScrollSnapTimerFired): Deleted.
(WebCore::ScrollAnimator::verticalScrollSnapTimerFired): Deleted.

  • platform/ScrollAnimator.h:
  • platform/cocoa/ScrollController.h: Copied from platform/mac/ScrollController.h.
  • platform/cocoa/ScrollController.mm: Copied from platform/mac/ScrollController.mm.

(WebCore::ScrollController::ScrollController): Update to initialize new timers.
(WebCore::ScrollController::handleWheelEvent): Update to handle Scroll Snap Point events.
(WebCore::ScrollController::startSnapRubberbandTimer): Added.
(WebCore::ScrollController::stopSnapRubberbandTimer): Manage animation timers locally, do not
require client to maintain timers.
(WebCore::ScrollController::snapRubberBand): Ditto.
(WebCore::ScrollController::processWheelEventForScrollSnap): Added. (Moved from ScrollAnimatorMac)
(WebCore::ScrollController::updateScrollAnimatorsAndTimers): Ditto. Also updated to use RunLoop::Timer.
(WebCore::ScrollController::startScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
(WebCore::ScrollController::stopScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
(WebCore::ScrollController::horizontalScrollSnapTimerFired): Ditto.
(WebCore::ScrollController::verticalScrollSnapTimerFired): Ditto.
(WebCore::ScrollController::scrollOffsetOnAxis): Moved from ScrollAnimatorMac.
(WebCore::ScrollController::immediateScrollOnAxis): Ditto.

  • platform/mac/AxisScrollSnapAnimator.h: Rename methods from 'InAxis' to 'OnAxis'
  • platform/mac/AxisScrollSnapAnimator.mm: Ditto.
  • platform/mac/ScrollAnimatorMac.h:
  • platform/mac/ScrollAnimatorMac.mm:

(WebCore::ScrollAnimatorMac::ScrollAnimatorMac): Remove unused Rubberband timers (now that this is
controlled in the ScrollController)
(WebCore::ScrollAnimatorMac::startSnapRubberbandTimer): Deleted.
(WebCore::ScrollAnimatorMac::stopSnapRubberbandTimer): Deleted.
(WebCore::ScrollAnimatorMac::snapRubberBandTimerFired): Deleted.

  • platform/mac/ScrollController.h: Removed.
  • platform/mac/ScrollController.mm: Removed.
Location:
trunk/Source/WebCore
Files:
11 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r180901 r180902  
     12015-03-02  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Move scroll animating functions from ScrollAnimator to ScrollController
     4        https://bugs.webkit.org/show_bug.cgi?id=142102
     5        <rdar://problem/20007161>
     6
     7        Reviewed by Simon Fraser.
     8
     9        No change in functionality.
     10       
     11        Do some refactoring of the various scrolling classes:
     12        1. Consolidate animation times to RunLoop::Timer instead of a combination of WebCore::Timer
     13           and CFRunLoopTimers. Do this for Scroll Snap Point and Rubberband animations.
     14        2. Move ScrollController from platform/mac to platform/cocoa to enable sharing with iOS.
     15        3. Move code from ScrollAnimator{Mac} -> ScrollController.
     16        4. Rename scrollOffsetInAxis -> scrollOffsetOnAxis
     17        5. Rename immediateScrollInAxis -> immediateScrollOnAxis
     18
     19        * WebCore.xcodeproj/project.pbxproj: Move ScrollController to 'platform/cocoa'
     20        * page/mac/EventHandlerMac.mm: Make sure the scroll controller is notified of end-of-scroll
     21        events, just as is done for the "event not handled" case in EventHandler.cpp.
     22        (WebCore::EventHandler::platformCompleteWheelEvent):
     23        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: Remove timer and some delegate
     24        methods, now that ScrollController is controlling this state.
     25        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
     26        (WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): We no longer
     27        need to clean up the CFRunLoopTimer.
     28        (WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis): Add temporary stub needed
     29        until Bug 141973 is completed.).
     30        (WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Ditto.
     31        (WebCore::ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer): Deleted.
     32        (WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Deleted.
     33        * platform/ScrollAnimator.cpp:
     34        (WebCore::ScrollAnimator::ScrollAnimator):
     35        (WebCore::ScrollAnimator::processWheelEventForScrollSnap): Just call the ScrollController method.
     36        (WebCore::ScrollAnimator::handleWheelEvent): Ditto.
     37        (WebCore::ScrollAnimator::updateScrollAnimatorsAndTimers): Ditto.
     38        (WebCore::ScrollAnimator::scrollOffsetOnAxis): Renamed from scrollOffsetInAxis.
     39        (WebCore::ScrollAnimator::scrollOffsetInAxis): Deleted.
     40        (WebCore::ScrollAnimator::immediateScrollOnAxis): Renamed from immediateScrollInAxis.
     41        (WebCore::ScrollAnimator::immediateScrollInAxis): Deleted.
     42        (WebCore::ScrollAnimator::startScrollSnapTimer): Deleted.
     43        (WebCore::ScrollAnimator::stopScrollSnapTimer): Deleted.
     44        (WebCore::ScrollAnimator::horizontalScrollSnapTimerFired): Deleted.
     45        (WebCore::ScrollAnimator::verticalScrollSnapTimerFired): Deleted.
     46        * platform/ScrollAnimator.h:
     47        * platform/cocoa/ScrollController.h: Copied from platform/mac/ScrollController.h.
     48        * platform/cocoa/ScrollController.mm: Copied from platform/mac/ScrollController.mm.
     49        (WebCore::ScrollController::ScrollController): Update to initialize new timers.
     50        (WebCore::ScrollController::handleWheelEvent): Update to handle Scroll Snap Point events.
     51        (WebCore::ScrollController::startSnapRubberbandTimer): Added.
     52        (WebCore::ScrollController::stopSnapRubberbandTimer): Manage animation timers locally, do not
     53        require client to maintain timers.
     54        (WebCore::ScrollController::snapRubberBand): Ditto.
     55        (WebCore::ScrollController::processWheelEventForScrollSnap): Added. (Moved from ScrollAnimatorMac)
     56        (WebCore::ScrollController::updateScrollAnimatorsAndTimers): Ditto. Also updated to use RunLoop::Timer.
     57        (WebCore::ScrollController::startScrollSnapTimer): Ditto. Also updated to use RunLoop::Timer.
     58        (WebCore::ScrollController::stopScrollSnapTimer):  Ditto. Also updated to use RunLoop::Timer.
     59        (WebCore::ScrollController::horizontalScrollSnapTimerFired): Ditto.
     60        (WebCore::ScrollController::verticalScrollSnapTimerFired): Ditto.
     61        (WebCore::ScrollController::scrollOffsetOnAxis): Moved from ScrollAnimatorMac.
     62        (WebCore::ScrollController::immediateScrollOnAxis): Ditto.
     63        * platform/mac/AxisScrollSnapAnimator.h: Rename methods from 'InAxis' to 'OnAxis'
     64        * platform/mac/AxisScrollSnapAnimator.mm: Ditto.
     65        * platform/mac/ScrollAnimatorMac.h:
     66        * platform/mac/ScrollAnimatorMac.mm:
     67        (WebCore::ScrollAnimatorMac::ScrollAnimatorMac): Remove unused Rubberband timers (now that this is
     68        controlled in the ScrollController)
     69        (WebCore::ScrollAnimatorMac::startSnapRubberbandTimer): Deleted.
     70        (WebCore::ScrollAnimatorMac::stopSnapRubberbandTimer): Deleted.
     71        (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired): Deleted.
     72        * platform/mac/ScrollController.h: Removed.
     73        * platform/mac/ScrollController.mm: Removed.
     74
    1752015-03-02  Mark Lam  <mark.lam@apple.com>
    276
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r180798 r180902  
    787787                1A927FD41416A15B003A83C8 /* nptypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A927FD11416A15B003A83C8 /* nptypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
    788788                1A98956B0AA78F80005EF5EF /* URLCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A98956A0AA78F80005EF5EF /* URLCF.cpp */; };
    789                 1AA84F04143BA7BD0051D153 /* ScrollController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AA84F02143BA7BD0051D153 /* ScrollController.mm */; };
    790                 1AA84F05143BA7BD0051D153 /* ScrollController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA84F03143BA7BD0051D153 /* ScrollController.h */; settings = {ATTRIBUTES = (Private, ); }; };
    791789                1AA8799011CBE846003C664F /* PluginStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA8798F11CBE846003C664F /* PluginStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
    792790                1AAADDA314DB409F00AF64B3 /* ScrollingTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAADDA114DB409F00AF64B3 /* ScrollingTree.cpp */; };
     
    24462444                7A93868518DCC14500B8263D /* VTTScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A93868218DCC14500B8263D /* VTTScanner.cpp */; };
    24472445                7A93868618DCC14500B8263D /* VTTScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A93868318DCC14500B8263D /* VTTScanner.h */; };
     2446                7A9ADFF31AA1163800D2733C /* ScrollController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFFA4111AA1039D00F0125B /* ScrollController.h */; settings = {ATTRIBUTES = (Private, ); }; };
     2447                7A9ADFF41AA1163B00D2733C /* ScrollController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFA4121AA1039D00F0125B /* ScrollController.mm */; };
    24482448                7AA3A699194A64E7001CBD24 /* TileController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AA3A695194A64E7001CBD24 /* TileController.cpp */; };
    24492449                7AA3A69A194A64E7001CBD24 /* TileController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AA3A696194A64E7001CBD24 /* TileController.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    78107810                1A927FD11416A15B003A83C8 /* nptypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nptypes.h; sourceTree = "<group>"; };
    78117811                1A98956A0AA78F80005EF5EF /* URLCF.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = URLCF.cpp; sourceTree = "<group>"; };
    7812                 1AA84F02143BA7BD0051D153 /* ScrollController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollController.mm; sourceTree = "<group>"; };
    7813                 1AA84F03143BA7BD0051D153 /* ScrollController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollController.h; sourceTree = "<group>"; };
    78147812                1AA8798F11CBE846003C664F /* PluginStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginStrategy.h; sourceTree = "<group>"; };
    78157813                1AAADDA114DB409F00AF64B3 /* ScrollingTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTree.cpp; sourceTree = "<group>"; };
     
    96689666                7AF9B20A18CFB5F300C64BEF /* JSVTTRegionList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSVTTRegionList.cpp; sourceTree = "<group>"; };
    96699667                7AF9B20B18CFB5F300C64BEF /* JSVTTRegionList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSVTTRegionList.h; sourceTree = "<group>"; };
     9668                7AFFA4111AA1039D00F0125B /* ScrollController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollController.h; sourceTree = "<group>"; };
     9669                7AFFA4121AA1039D00F0125B /* ScrollController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollController.mm; sourceTree = "<group>"; };
    96709670                7C2BDD3B17C7F98B0038FF15 /* JSDOMGlobalObjectTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMGlobalObjectTask.cpp; sourceTree = "<group>"; };
    96719671                7C2BDD3C17C7F98B0038FF15 /* JSDOMGlobalObjectTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMGlobalObjectTask.h; sourceTree = "<group>"; };
     
    1658816588                                BC8B853C0E7C7F1100AB6984 /* ScrollbarThemeMac.h */,
    1658916589                                BCEF869E0E844E9D00A85CD5 /* ScrollbarThemeMac.mm */,
    16590                                 1AA84F03143BA7BD0051D153 /* ScrollController.h */,
    16591                                 1AA84F02143BA7BD0051D153 /* ScrollController.mm */,
    1659216590                                9353676A09AED88B00D35CD6 /* ScrollViewMac.mm */,
    1659316591                                077AF14118F4B1BB0001ED61 /* SerializedPlatformRepresentationMac.h */,
     
    1869918697                                1A0409DB1A4360B5009E47F3 /* MachSendRight.h */,
    1870018698                                ADB6B29718FB90240081963E /* MemoryPressureHandlerCocoa.mm */,
     18699                                7AFFA4111AA1039D00F0125B /* ScrollController.h */,
     18700                                7AFFA4121AA1039D00F0125B /* ScrollController.mm */,
    1870118701                                5D5975B119635F1100D00878 /* SystemVersion.h */,
    1870218702                                5D5975B219635F1100D00878 /* SystemVersion.mm */,
     
    2464924649                                A871D4580A127CBC00B12A68 /* HTMLParamElement.h in Headers */,
    2465024650                                93E2A307123E9DC0009FE12A /* HTMLParserIdioms.h in Headers */,
     24651                                7A9ADFF31AA1163800D2733C /* ScrollController.h in Headers */,
    2465124652                                973F418A169B95FF0006BF60 /* HTMLParserOptions.h in Headers */,
    2465224653                                977B3871122883E900B81FF8 /* HTMLParserScheduler.h in Headers */,
     
    2610226103                                0FE71406142170B800DB33BA /* ScrollbarThemeMock.h in Headers */,
    2610326104                                5D925B680F64D4DD00B847F0 /* ScrollBehavior.h in Headers */,
    26104                                 1AA84F05143BA7BD0051D153 /* ScrollController.h in Headers */,
    2610526105                                0F605AED15F94848004DF0C0 /* ScrollingConstraints.h in Headers */,
    2610626106                                1AF62EE814DA22A70041556C /* ScrollingCoordinator.h in Headers */,
     
    2749727497                                E1FE13641834351100892F13 /* CryptoDigestMac.cpp in Sources */,
    2749827498                                E157A8E418173A3A009F821D /* CryptoKey.cpp in Sources */,
     27499                                7A9ADFF41AA1163B00D2733C /* ScrollController.mm in Sources */,
    2749927500                                E125F84D1824289D00D84CD9 /* CryptoKeyAES.cpp in Sources */,
    2750027501                                E125F863182C303A00D84CD9 /* CryptoKeyDataOctetSequence.cpp in Sources */,
     
    2950929510                                0FE71405142170B800DB33BA /* ScrollbarThemeMock.cpp in Sources */,
    2951029511                                5D925B670F64D4DD00B847F0 /* ScrollBehavior.cpp in Sources */,
    29511                                 1AA84F04143BA7BD0051D153 /* ScrollController.mm in Sources */,
    2951229512                                0F605AEC15F94848004DF0C0 /* ScrollingConstraints.cpp in Sources */,
    2951329513                                1AF62EE714DA22A70041556C /* ScrollingCoordinator.cpp in Sources */,
  • trunk/Source/WebCore/page/mac/EventHandlerMac.mm

    r180426 r180902  
    962962    bool didHandleEvent = view ? view->wheelEvent(wheelEvent) : false;
    963963    m_isHandlingWheelEvent = false;
     964   
     965#if ENABLE(CSS_SCROLL_SNAP)
     966    if (scrollableArea)
     967        platformNotifySnapIfNecessary(wheelEvent, *scrollableArea);
     968#endif
     969
    964970    return didHandleEvent;
    965971}
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h

    r180447 r180902  
    6262    virtual void immediateScrollBy(const FloatSize&) override;
    6363    virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) override;
    64     virtual void startSnapRubberbandTimer() override;
    65     virtual void stopSnapRubberbandTimer() override;
    6664    virtual void adjustScrollPositionToBoundsIfNecessary() override;
    6765
     
    8179    bool isAlreadyPinnedInDirectionOfGesture(const PlatformWheelEvent&, ScrollEventAxis);
    8280
     81#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
     82    LayoutUnit scrollOffsetOnAxis(ScrollEventAxis) override;
     83    void immediateScrollOnAxis(ScrollEventAxis, float delta) override;
     84#endif
     85
    8386    void logExposedUnfilledArea();
    8487
    8588    ScrollController m_scrollController;
    86     RetainPtr<CFRunLoopTimerRef> m_snapRubberbandTimer;
    8789
    8890    RetainPtr<CALayer> m_scrollLayer;
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm

    r180447 r180902  
    6767ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac()
    6868{
    69     if (m_snapRubberbandTimer)
    70         CFRunLoopTimerInvalidate(m_snapRubberbandTimer.get());
    7169}
    7270
     
    297295}
    298296
    299 void ScrollingTreeFrameScrollingNodeMac::startSnapRubberbandTimer()
    300 {
    301     ASSERT(!m_snapRubberbandTimer);
    302 
    303     CFTimeInterval timerInterval = 1.0 / 60.0;
    304 
    305     m_snapRubberbandTimer = adoptCF(CFRunLoopTimerCreateWithHandler(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent() + timerInterval, timerInterval, 0, 0, ^(CFRunLoopTimerRef) {
    306         m_scrollController.snapRubberBandTimerFired();
    307     }));
    308     CFRunLoopAddTimer(CFRunLoopGetCurrent(), m_snapRubberbandTimer.get(), kCFRunLoopDefaultMode);
    309 }
    310 
    311 void ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer()
    312 {
    313     if (!m_snapRubberbandTimer)
    314         return;
    315 
    316     scrollingTree().setMainFrameIsRubberBanding(false);
    317 
    318     // Since the rubberband timer has stopped, totalContentsSizeForRubberBand can be synchronized with totalContentsSize.
    319     setTotalContentsSizeForRubberBand(totalContentsSize());
    320 
    321     CFRunLoopTimerInvalidate(m_snapRubberbandTimer.get());
    322     m_snapRubberbandTimer = nullptr;
    323 }
    324 
    325297void ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary()
    326298{
     
    541513}
    542514
     515#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
     516LayoutUnit ScrollingTreeFrameScrollingNodeMac::scrollOffsetOnAxis(ScrollEventAxis)
     517{
     518    // Temporary stub until http://webkit.org/b/141973.
     519    return 0;
     520}
     521
     522void ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis(ScrollEventAxis, float)
     523{
     524    // Temporary stub until http://webkit.org/b/141973.
     525}
     526#endif
     527
    543528} // namespace WebCore
    544529
  • trunk/Source/WebCore/platform/ScrollAnimator.cpp

    r180873 r180902  
    5050ScrollAnimator::ScrollAnimator(ScrollableArea& scrollableArea)
    5151    : m_scrollableArea(scrollableArea)
     52#if (ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)) && PLATFORM(MAC)
     53    , m_scrollController(this)
     54#endif
    5255    , m_currentPosX(0)
    5356    , m_currentPosY(0)
     
    8285
    8386#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
    84 void ScrollAnimator::processWheelEventForScrollSnap(const PlatformWheelEvent& wheelEvent)
     87bool ScrollAnimator::processWheelEventForScrollSnap(const PlatformWheelEvent& wheelEvent)
    8588{
    86     if (m_verticalScrollSnapAnimator)
    87         m_verticalScrollSnapAnimator->handleWheelEvent(wheelEvent);
    88     if (m_horizontalScrollSnapAnimator)
    89         m_horizontalScrollSnapAnimator->handleWheelEvent(wheelEvent);
     89    return m_scrollController.processWheelEventForScrollSnap(wheelEvent);
    9090}
    9191#endif
     
    9494{
    9595#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
    96     if (m_verticalScrollSnapAnimator) {
    97         m_verticalScrollSnapAnimator->handleWheelEvent(e);
    98         if (m_verticalScrollSnapAnimator->shouldOverrideWheelEvent(e))
    99             return false;
    100     }
    101     if (m_horizontalScrollSnapAnimator) {
    102         m_horizontalScrollSnapAnimator->handleWheelEvent(e);
    103         if (m_horizontalScrollSnapAnimator->shouldOverrideWheelEvent(e))
    104             return false;
    105     }
     96    m_scrollController.processWheelEventForScrollSnap(e);
    10697#endif
    10798#if PLATFORM(COCOA)
     
    184175void ScrollAnimator::updateScrollAnimatorsAndTimers()
    185176{
    186     // FIXME: Currently, scroll snap animators are recreated even though the snap offsets alone can be updated.
    187     if (m_scrollableArea.horizontalSnapOffsets()) {
    188         m_horizontalScrollSnapAnimator = std::make_unique<AxisScrollSnapAnimator>(this, m_scrollableArea.horizontalSnapOffsets(), ScrollEventAxis::Horizontal);
    189         m_horizontalScrollSnapTimer = std::make_unique<Timer>(*this, &ScrollAnimator::horizontalScrollSnapTimerFired);
    190     } else if (m_horizontalScrollSnapAnimator) {
    191         m_horizontalScrollSnapAnimator = nullptr;
    192         m_horizontalScrollSnapTimer = nullptr;
    193     }
    194     if (m_scrollableArea.verticalSnapOffsets()) {
    195         m_verticalScrollSnapAnimator = std::make_unique<AxisScrollSnapAnimator>(this, m_scrollableArea.verticalSnapOffsets(), ScrollEventAxis::Vertical);
    196         m_verticalScrollSnapTimer = std::make_unique<Timer>(*this, &ScrollAnimator::verticalScrollSnapTimerFired);
    197     } else if (m_verticalScrollSnapAnimator) {
    198         m_verticalScrollSnapAnimator = nullptr;
    199         m_verticalScrollSnapTimer = nullptr;
    200     }
     177    m_scrollController.updateScrollAnimatorsAndTimers(m_scrollableArea);
    201178}
    202179
    203 LayoutUnit ScrollAnimator::scrollOffsetInAxis(ScrollEventAxis axis)
     180LayoutUnit ScrollAnimator::scrollOffsetOnAxis(ScrollEventAxis axis)
    204181{
    205     FloatPoint currentPosition = this->currentPosition();
    206     return axis == ScrollEventAxis::Horizontal ? currentPosition.x() : currentPosition.y();
     182    return axis == ScrollEventAxis::Horizontal ? m_currentPosX : m_currentPosY;
    207183}
    208184
    209 void ScrollAnimator::immediateScrollInAxis(ScrollEventAxis axis, float delta)
     185void ScrollAnimator::immediateScrollOnAxis(ScrollEventAxis axis, float delta)
    210186{
    211187    FloatPoint currentPosition = this->currentPosition();
     
    215191        scrollToOffsetWithoutAnimation(FloatPoint(currentPosition.x(), currentPosition.y() + delta));
    216192}
    217 
    218 void ScrollAnimator::startScrollSnapTimer(ScrollEventAxis axis)
    219 {
    220     Timer* scrollSnapTimer = axis == ScrollEventAxis::Horizontal ? m_horizontalScrollSnapTimer.get() : m_verticalScrollSnapTimer.get();
    221     if (!scrollSnapTimer->isActive())
    222         scrollSnapTimer->startRepeating(1.0 / 60.0);
    223 }
    224 
    225 void ScrollAnimator::stopScrollSnapTimer(ScrollEventAxis axis)
    226 {
    227     Timer* scrollSnapTimer = axis == ScrollEventAxis::Horizontal ? m_horizontalScrollSnapTimer.get() : m_verticalScrollSnapTimer.get();
    228     if (scrollSnapTimer->isActive())
    229         scrollSnapTimer->stop();
    230 }
    231 
    232 void ScrollAnimator::horizontalScrollSnapTimerFired()
    233 {
    234     m_horizontalScrollSnapAnimator->scrollSnapAnimationUpdate();
    235 }
    236 
    237 void ScrollAnimator::verticalScrollSnapTimerFired()
    238 {
    239     m_verticalScrollSnapAnimator->scrollSnapAnimationUpdate();
    240 }
    241193#endif
    242194
  • trunk/Source/WebCore/platform/ScrollAnimator.h

    r180873 r180902  
    3434
    3535#include "FloatSize.h"
     36#include "LayoutUnit.h"
    3637#include "PlatformWheelEvent.h"
    3738#include "ScrollTypes.h"
     
    3940#include <wtf/Forward.h>
    4041
    41 #if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
    42 #include "AxisScrollSnapAnimator.h"
    43 #include "Timer.h"
     42#if (ENABLE(RUBBER_BANDING) || ENABLE(CSS_SCROLL_SNAP)) && PLATFORM(MAC)
     43#include "ScrollController.h"
    4444#endif
    4545
     
    5151class Scrollbar;
    5252
    53 #if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
    54 class ScrollAnimator : public AxisScrollSnapAnimatorClient {
     53#if (ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)) && PLATFORM(MAC)
     54class ScrollAnimator : private ScrollControllerClient {
    5555#else
    5656class ScrollAnimator {
     
    119119
    120120#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
    121     void processWheelEventForScrollSnap(const PlatformWheelEvent&);
     121    bool processWheelEventForScrollSnap(const PlatformWheelEvent&);
     122
    122123    void updateScrollAnimatorsAndTimers();
    123     virtual LayoutUnit scrollOffsetInAxis(ScrollEventAxis) override;
    124     virtual void immediateScrollInAxis(ScrollEventAxis, float delta) override;
    125     virtual void startScrollSnapTimer(ScrollEventAxis) override;
    126     virtual void stopScrollSnapTimer(ScrollEventAxis) override;
     124    LayoutUnit scrollOffsetOnAxis(ScrollEventAxis) override;
     125    void immediateScrollOnAxis(ScrollEventAxis, float delta) override;
    127126#endif
    128127
     
    130129    virtual void notifyPositionChanged(const FloatSize& delta);
    131130
    132 #if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
    133     // Trivial wrappers around the actual update loop in AxisScrollSnapAnimator, since WebCore Timer requires a Timer argument.
    134     void horizontalScrollSnapTimerFired();
    135     void verticalScrollSnapTimerFired();
     131    ScrollableArea& m_scrollableArea;
     132#if (ENABLE(CSS_SCROLL_SNAP) || ENABLE(RUBBER_BANDING)) && PLATFORM(MAC)
     133    ScrollController m_scrollController;
    136134#endif
    137 
    138     ScrollableArea& m_scrollableArea;
    139135    float m_currentPosX; // We avoid using a FloatPoint in order to reduce
    140136    float m_currentPosY; // subclass code complexity.
    141 #if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
    142     std::unique_ptr<AxisScrollSnapAnimator> m_horizontalScrollSnapAnimator;
    143     std::unique_ptr<Timer> m_horizontalScrollSnapTimer;
    144     // FIXME: Find a way to consolidate both timers into one variable.
    145     std::unique_ptr<AxisScrollSnapAnimator> m_verticalScrollSnapAnimator;
    146     std::unique_ptr<Timer> m_verticalScrollSnapTimer;
    147 #endif
    148137};
    149138
  • trunk/Source/WebCore/platform/cocoa/ScrollController.h

    r180702 r180902  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2011, 2014-2015 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3333#include "ScrollTypes.h"
    3434#include <wtf/Noncopyable.h>
     35#include <wtf/RunLoop.h>
     36
     37#if ENABLE(CSS_SCROLL_SNAP)
     38#include "AxisScrollSnapAnimator.h"
     39#endif
    3540
    3641namespace WebCore {
    3742
    3843class PlatformWheelEvent;
     44class ScrollableArea;
    3945
    4046class ScrollControllerClient {
     
    5662    virtual void immediateScrollBy(const FloatSize&) = 0;
    5763    virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) = 0;
    58     virtual void startSnapRubberbandTimer() = 0;
    59     virtual void stopSnapRubberbandTimer() = 0;
    6064
    6165    // If the current scroll position is within the overhang area, this function will cause
    6266    // the page to scroll to the nearest boundary point.
    6367    virtual void adjustScrollPositionToBoundsIfNecessary() = 0;
     68
     69#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
     70    virtual LayoutUnit scrollOffsetOnAxis(ScrollEventAxis) = 0;
     71    virtual void immediateScrollOnAxis(ScrollEventAxis, float delta) = 0;
     72#endif
    6473};
    6574
     75#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
     76class ScrollController : public AxisScrollSnapAnimatorClient {
     77#else
    6678class ScrollController {
     79#endif
    6780    WTF_MAKE_NONCOPYABLE(ScrollController);
    6881
     
    7184
    7285    bool handleWheelEvent(const PlatformWheelEvent&);
    73     void snapRubberBandTimerFired();
    7486
    7587    bool isRubberBandInProgress() const;
    7688
     89#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
     90    bool processWheelEventForScrollSnap(const PlatformWheelEvent&);
     91    void updateScrollAnimatorsAndTimers(const ScrollableArea&);
     92#endif
     93
    7794private:
     95    void startSnapRubberbandTimer();
    7896    void stopSnapRubberbandTimer();
    7997    void snapRubberBand();
     98    void snapRubberBandTimerFired();
    8099
    81100    bool shouldRubberBandInHorizontalDirection(const PlatformWheelEvent&);
    82101
     102#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
     103    void horizontalScrollSnapTimerFired();
     104    void verticalScrollSnapTimerFired();
     105    void startScrollSnapTimer(ScrollEventAxis);
     106    void stopScrollSnapTimer(ScrollEventAxis);
     107
     108    LayoutUnit scrollOffsetOnAxis(ScrollEventAxis) override;
     109    void immediateScrollOnAxis(ScrollEventAxis, float delta) override;
     110#endif
     111
    83112    ScrollControllerClient* m_client;
    84 
    85     bool m_inScrollGesture;
    86     bool m_momentumScrollInProgress;
    87     bool m_ignoreMomentumScrolls;
    88113   
    89114    CFTimeInterval m_lastMomentumScrollTimestamp;
     
    97122    FloatPoint m_origOrigin;
    98123    FloatSize m_origVelocity;
     124    RunLoop::Timer<ScrollController> m_snapRubberbandTimer;
     125   
     126#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
     127    // FIXME: Find a way to consolidate both timers into one variable.
     128    std::unique_ptr<AxisScrollSnapAnimator> m_horizontalScrollSnapAnimator;
     129    std::unique_ptr<AxisScrollSnapAnimator> m_verticalScrollSnapAnimator;
     130    RunLoop::Timer<ScrollController> m_horizontalScrollSnapTimer;
     131    RunLoop::Timer<ScrollController> m_verticalScrollSnapTimer;
     132#endif
    99133
     134    bool m_inScrollGesture;
     135    bool m_momentumScrollInProgress;
     136    bool m_ignoreMomentumScrolls;
    100137    bool m_snapRubberbandTimerIsActive;
    101138};
  • trunk/Source/WebCore/platform/cocoa/ScrollController.mm

    r180702 r180902  
    3232#include <sys/time.h>
    3333
     34#if ENABLE(CSS_SCROLL_SNAP)
     35#include "AxisScrollSnapAnimator.h"
     36#include "ScrollableArea.h"
     37#endif
     38
    3439#if ENABLE(RUBBER_BANDING)
    3540
     
    9297ScrollController::ScrollController(ScrollControllerClient* client)
    9398    : m_client(client)
     99    , m_lastMomentumScrollTimestamp(0)
     100    , m_startTime(0)
     101    , m_snapRubberbandTimer(RunLoop::current(), this, &ScrollController::snapRubberBandTimerFired)
     102#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
     103    , m_horizontalScrollSnapTimer(RunLoop::current(), this, &ScrollController::horizontalScrollSnapTimerFired)
     104    , m_verticalScrollSnapTimer(RunLoop::current(), this, &ScrollController::verticalScrollSnapTimerFired)
     105#endif
    94106    , m_inScrollGesture(false)
    95107    , m_momentumScrollInProgress(false)
    96108    , m_ignoreMomentumScrolls(false)
    97     , m_lastMomentumScrollTimestamp(0)
    98     , m_startTime(0)
    99109    , m_snapRubberbandTimerIsActive(false)
    100110{
     
    103113bool ScrollController::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
    104114{
     115#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
     116    if (!processWheelEventForScrollSnap(wheelEvent))
     117        return false;
     118#endif
    105119    if (wheelEvent.phase() == PlatformWheelEventPhaseBegan) {
    106120        // First, check if we should rubber-band at all.
     
    366380}
    367381
     382void ScrollController::startSnapRubberbandTimer()
     383{
     384    m_snapRubberbandTimer.startRepeating(1.0 / 60.0);
     385}
     386
    368387void ScrollController::stopSnapRubberbandTimer()
    369388{
    370     m_client->stopSnapRubberbandTimer();
     389    m_snapRubberbandTimer.stop();
    371390    m_snapRubberbandTimerIsActive = false;
    372391}
     
    388407    m_origVelocity = FloatSize();
    389408
    390     m_client->startSnapRubberbandTimer();
     409    startSnapRubberbandTimer();
    391410    m_snapRubberbandTimerIsActive = true;
    392411}
     
    402421}
    403422
     423#if ENABLE(CSS_SCROLL_SNAP) && PLATFORM(MAC)
     424bool ScrollController::processWheelEventForScrollSnap(const PlatformWheelEvent& wheelEvent)
     425{
     426    if (m_verticalScrollSnapAnimator) {
     427        m_verticalScrollSnapAnimator->handleWheelEvent(wheelEvent);
     428        if (m_verticalScrollSnapAnimator->shouldOverrideWheelEvent(wheelEvent))
     429            return false;
     430    }
     431    if (m_horizontalScrollSnapAnimator) {
     432        m_horizontalScrollSnapAnimator->handleWheelEvent(wheelEvent);
     433        if (m_horizontalScrollSnapAnimator->shouldOverrideWheelEvent(wheelEvent))
     434            return false;
     435    }
     436
     437    return true;
     438}
     439   
     440void ScrollController::updateScrollAnimatorsAndTimers(const ScrollableArea& scrollableArea)
     441{
     442    // FIXME: Currently, scroll snap animators are recreated even though the snap offsets alone can be updated.
     443    if (scrollableArea.horizontalSnapOffsets())
     444        m_horizontalScrollSnapAnimator = std::make_unique<AxisScrollSnapAnimator>(this, scrollableArea.horizontalSnapOffsets(), ScrollEventAxis::Horizontal);
     445    else if (m_horizontalScrollSnapAnimator)
     446        m_horizontalScrollSnapAnimator = nullptr;
     447
     448    if (scrollableArea.verticalSnapOffsets())
     449        m_verticalScrollSnapAnimator = std::make_unique<AxisScrollSnapAnimator>(this, scrollableArea.verticalSnapOffsets(), ScrollEventAxis::Vertical);
     450    else if (m_verticalScrollSnapAnimator)
     451        m_verticalScrollSnapAnimator = nullptr;
     452}
     453
     454void ScrollController::startScrollSnapTimer(ScrollEventAxis axis)
     455{
     456    RunLoop::Timer<ScrollController>& scrollSnapTimer = axis == ScrollEventAxis::Horizontal ? m_horizontalScrollSnapTimer : m_verticalScrollSnapTimer;
     457    if (!scrollSnapTimer.isActive())
     458        scrollSnapTimer.startRepeating(1.0 / 60.0);
     459}
     460
     461void ScrollController::stopScrollSnapTimer(ScrollEventAxis axis)
     462{
     463    RunLoop::Timer<ScrollController>& scrollSnapTimer = axis == ScrollEventAxis::Horizontal ? m_horizontalScrollSnapTimer : m_verticalScrollSnapTimer;
     464    scrollSnapTimer.stop();
     465}
     466   
     467void ScrollController::horizontalScrollSnapTimerFired()
     468{
     469    if (m_horizontalScrollSnapAnimator)
     470        m_horizontalScrollSnapAnimator->scrollSnapAnimationUpdate();
     471}
     472
     473void ScrollController::verticalScrollSnapTimerFired()
     474{
     475    if (m_verticalScrollSnapAnimator)
     476        m_verticalScrollSnapAnimator->scrollSnapAnimationUpdate();
     477}
     478
     479LayoutUnit ScrollController::scrollOffsetOnAxis(ScrollEventAxis axis)
     480{
     481    return m_client->scrollOffsetOnAxis(axis);
     482}
     483
     484void ScrollController::immediateScrollOnAxis(ScrollEventAxis axis, float delta)
     485{
     486    m_client->immediateScrollOnAxis(axis, delta);
     487}
     488#endif
     489
    404490} // namespace WebCore
    405491
  • trunk/Source/WebCore/platform/mac/AxisScrollSnapAnimator.h

    r173894 r180902  
    5858
    5959public:
    60     virtual LayoutUnit scrollOffsetInAxis(ScrollEventAxis) = 0;
    61     virtual void immediateScrollInAxis(ScrollEventAxis, float velocity) = 0;
     60    virtual LayoutUnit scrollOffsetOnAxis(ScrollEventAxis) = 0;
     61    virtual void immediateScrollOnAxis(ScrollEventAxis, float velocity) = 0;
    6262    virtual void startScrollSnapTimer(ScrollEventAxis) = 0;
    6363    virtual void stopScrollSnapTimer(ScrollEventAxis) = 0;
  • trunk/Source/WebCore/platform/mac/AxisScrollSnapAnimator.mm

    r179324 r180902  
    118118        endScrollSnapAnimation(ScrollSnapState::UserInteraction);
    119119        pushInitialWheelDelta(wheelDelta);
    120         m_beginTrackingWheelDeltaOffset = m_client->scrollOffsetInAxis(m_axis);
     120        m_beginTrackingWheelDeltaOffset = m_client->scrollOffsetOnAxis(m_axis);
    121121        break;
    122122
     
    154154    float delta = m_currentState == ScrollSnapState::Snapping ? computeSnapDelta() : computeGlideDelta();
    155155    if (delta)
    156         m_client->immediateScrollInAxis(m_axis, delta);
     156        m_client->immediateScrollOnAxis(m_axis, delta);
    157157    else
    158158        endScrollSnapAnimation(ScrollSnapState::DestinationReached);
     
    162162{
    163163    ASSERT(newState == ScrollSnapState::Gliding || newState == ScrollSnapState::Snapping);
    164     LayoutUnit offset = m_client->scrollOffsetInAxis(m_axis);
     164    LayoutUnit offset = m_client->scrollOffsetOnAxis(m_axis);
    165165    float initialWheelDelta = newState == ScrollSnapState::Gliding ? averageInitialWheelDelta() : 0;
    166166    LayoutUnit projectedScrollDestination = newState == ScrollSnapState::Gliding ? m_beginTrackingWheelDeltaOffset + LayoutUnit(projectedInertialScrollDistance(initialWheelDelta)) : offset;
     
    204204float AxisScrollSnapAnimator::computeSnapDelta() const
    205205{
    206     LayoutUnit offset = m_client->scrollOffsetInAxis(m_axis);
     206    LayoutUnit offset = m_client->scrollOffsetOnAxis(m_axis);
    207207    bool canComputeSnap =  (m_initialOffset <= offset && offset < m_targetOffset) || (m_targetOffset < offset && offset <= m_initialOffset);
    208208    if (m_currentState != ScrollSnapState::Snapping || !canComputeSnap)
     
    238238float AxisScrollSnapAnimator::computeGlideDelta() const
    239239{
    240     LayoutUnit offset = m_client->scrollOffsetInAxis(m_axis);
     240    LayoutUnit offset = m_client->scrollOffsetOnAxis(m_axis);
    241241    bool canComputeGlide = (m_initialOffset <= offset && offset < m_targetOffset) || (m_targetOffset < offset && offset <= m_initialOffset);
    242242    if (m_currentState != ScrollSnapState::Gliding || !canComputeGlide)
  • trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h

    r180474 r180902  
    3333#include "FloatSize.h"
    3434#include "ScrollAnimator.h"
    35 #include "ScrollController.h"
    3635#include "Timer.h"
    3736#include <wtf/RetainPtr.h>
     
    4342typedef id ScrollbarPainterController;
    4443
    45 #if !ENABLE(RUBBER_BANDING)
    46 class ScrollControllerClient { };
    47 #endif
    48 
    4944namespace WebCore {
    5045
    5146class Scrollbar;
    5247
    53 class ScrollAnimatorMac : public ScrollAnimator, private ScrollControllerClient {
     48class ScrollAnimatorMac : public ScrollAnimator {
    5449
    5550public:
     
    151146    virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) override;
    152147    virtual void immediateScrollBy(const FloatSize&) override;
    153     virtual void startSnapRubberbandTimer() override;
    154     virtual void stopSnapRubberbandTimer() override;
    155148    virtual void adjustScrollPositionToBoundsIfNecessary() override;
    156149
    157150    bool pinnedInDirection(float deltaX, float deltaY);
    158     void snapRubberBandTimerFired();
    159151
    160152    bool isAlreadyPinnedInDirectionOfGesture(const PlatformWheelEvent&, ScrollEventAxis);
    161 
    162     ScrollController m_scrollController;
    163     Timer m_snapRubberBandTimer;
    164153#endif
    165154
  • trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm

    r180873 r180902  
    644644    , m_initialScrollbarPaintTimer(*this, &ScrollAnimatorMac::initialScrollbarPaintTimerFired)
    645645    , m_sendContentAreaScrolledTimer(*this, &ScrollAnimatorMac::sendContentAreaScrolledTimerFired)
    646 #if ENABLE(RUBBER_BANDING)
    647     , m_scrollController(this)
    648     , m_snapRubberBandTimer(*this, &ScrollAnimatorMac::snapRubberBandTimerFired)
    649 #endif
    650646    , m_haveScrolledSincePageLoad(false)
    651647    , m_needsScrollerStyleUpdate(false)
     
    12711267    notifyPositionChanged(adjustedDelta);
    12721268}
    1273 
    1274 void ScrollAnimatorMac::startSnapRubberbandTimer()
    1275 {
    1276     m_snapRubberBandTimer.startRepeating(1.0 / 60.0);
    1277 }
    1278 
    1279 void ScrollAnimatorMac::stopSnapRubberbandTimer()
    1280 {
    1281     m_snapRubberBandTimer.stop();
    1282 }
    1283 
    1284 void ScrollAnimatorMac::snapRubberBandTimerFired()
    1285 {
    1286     m_scrollController.snapRubberBandTimerFired();
    1287 }
    12881269#endif
    12891270
Note: See TracChangeset for help on using the changeset viewer.