⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 283355 in webkit


Ignore:
Timestamp:
Sep 30, 2021, 6:30:29 PM (5 years ago)
Author:
Simon Fraser
Message:

Rename snapRubberBand() to have a clearer name
https://bugs.webkit.org/show_bug.cgi?id=231051

Reviewed by Myles C. Maxfield.

It wasn't clear that snapRubberBand() started the timer, sometimes. Make that
more obvious.

  • platform/ScrollingEffectsController.h:
  • platform/mac/ScrollingEffectsController.mm:

(WebCore::ScrollingEffectsController::handleWheelEvent):
(WebCore::ScrollingEffectsController::updateRubberBandAnimatingState):
(WebCore::ScrollingEffectsController::stopRubberbanding):
(WebCore::ScrollingEffectsController::stopRubberbandAnimation):
(WebCore::ScrollingEffectsController::startRubberbandAnimationIfNecessary):
(WebCore::ScrollingEffectsController::stopSnapRubberbandAnimation): Deleted.
(WebCore::ScrollingEffectsController::snapRubberBand): Deleted.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r283354 r283355  
     12021-09-30  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Rename snapRubberBand() to have a clearer name
     4        https://bugs.webkit.org/show_bug.cgi?id=231051
     5
     6        Reviewed by Myles C. Maxfield.
     7
     8        It wasn't clear that snapRubberBand() started the timer, sometimes. Make that
     9        more obvious.
     10
     11        * platform/ScrollingEffectsController.h:
     12        * platform/mac/ScrollingEffectsController.mm:
     13        (WebCore::ScrollingEffectsController::handleWheelEvent):
     14        (WebCore::ScrollingEffectsController::updateRubberBandAnimatingState):
     15        (WebCore::ScrollingEffectsController::stopRubberbanding):
     16        (WebCore::ScrollingEffectsController::stopRubberbandAnimation):
     17        (WebCore::ScrollingEffectsController::startRubberbandAnimationIfNecessary):
     18        (WebCore::ScrollingEffectsController::stopSnapRubberbandAnimation): Deleted.
     19        (WebCore::ScrollingEffectsController::snapRubberBand): Deleted.
     20
    1212021-09-30  Cathie Chen  <cathiechen@igalia.com>
    222
  • trunk/Source/WebCore/platform/ScrollingEffectsController.h

    r283335 r283355  
    199199    void stopDeferringWheelEventTestCompletionDueToScrollSnapping();
    200200
     201    void startRubberbandAnimationIfNecessary();
    201202    void startRubberbandAnimation();
    202     void stopSnapRubberbandAnimation();
    203 
    204     void snapRubberBand();
     203    void stopRubberbandAnimation();
     204
    205205    bool shouldRubberBandOnSide(BoxSide) const;
    206206    bool isRubberBandInProgressInternal() const;
  • trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm

    r283335 r283355  
    152152        m_unappliedOverscrollDelta = { };
    153153
    154         stopSnapRubberbandAnimation();
     154        stopRubberbandAnimation();
    155155        updateRubberBandingState();
    156156        return true;
     
    159159    if (wheelEvent.phase() == PlatformWheelEventPhase::Ended) {
    160160        // FIXME: This triggers the rubberband timer even when we don't start rubberbanding.
    161         snapRubberBand();
     161        startRubberbandAnimationIfNecessary();
    162162        updateRubberBandingState();
    163163        return true;
     
    301301                    m_ignoreMomentumScrolls = true;
    302302                    m_momentumScrollInProgress = false;
    303                     snapRubberBand();
     303                    startRubberbandAnimationIfNecessary();
    304304                }
    305305            }
     
    359359        if (m_startStretch.isZero()) {
    360360            m_startStretch = m_client.stretchAmount();
    361             if (m_startStretch == FloatSize()) {
     361            if (m_startStretch.isZero()) {
    362362                stopRubberbanding();
    363363                return;
     
    407407        m_startStretch = { };
    408408        if (!isRubberBandInProgressInternal())
    409             stopSnapRubberbandAnimation();
     409            stopRubberbandAnimation();
    410410    }
    411411
     
    441441void ScrollingEffectsController::stopRubberbanding()
    442442{
    443     stopSnapRubberbandAnimation();
     443    stopRubberbandAnimation();
    444444    m_stretchScrollForce = { };
    445445    m_startTime = { };
     
    458458}
    459459
    460 void ScrollingEffectsController::stopSnapRubberbandAnimation()
     460void ScrollingEffectsController::stopRubberbandAnimation()
    461461{
    462462    m_client.didStopRubberbandSnapAnimation();
     
    467467}
    468468
    469 void ScrollingEffectsController::snapRubberBand()
     469void ScrollingEffectsController::startRubberbandAnimationIfNecessary()
    470470{
    471471    auto timeDelta = WallTime::now() - m_lastMomentumScrollTimestamp;
Note: See TracChangeset for help on using the changeset viewer.