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

Changeset 283465 in webkit


Ignore:
Timestamp:
Oct 3, 2021, 8:52:45 AM (5 years ago)
Author:
Simon Fraser
Message:

REGRESSION (r283335): rubber-banding no longer locks to an axis
https://bugs.webkit.org/show_bug.cgi?id=231131

Reviewed by Tim Horton.

Source/WebCore:

r283335 introduced a bug where pulling down to rubber-band would result in sideways
motion even when the gesture was mostly vertical.

ScrollingEffectsController::modifyScrollDeltaForStretching() has some axis-locking behavior
that was broken by r283335, so restore the old behavior.

Test: fast/scrolling/mac/rubberband-axis-locking.html

  • platform/mac/ScrollingEffectsController.mm:

(WebCore::ScrollingEffectsController::modifyScrollDeltaForStretching):
(WebCore::isHorizontalSide): Deleted.
(WebCore::isVerticalSide): Deleted.

LayoutTests:

  • fast/scrolling/mac/rubberband-axis-locking-expected.txt: Added.
  • fast/scrolling/mac/rubberband-axis-locking.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r283438 r283465  
     12021-10-03  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r283335): rubber-banding no longer locks to an axis
     4        https://bugs.webkit.org/show_bug.cgi?id=231131
     5
     6        Reviewed by Tim Horton.
     7
     8        * fast/scrolling/mac/rubberband-axis-locking-expected.txt: Added.
     9        * fast/scrolling/mac/rubberband-axis-locking.html: Added.
     10
    1112021-10-02  Youenn Fablet  <youenn@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r283464 r283465  
     12021-10-03  Simon Fraser  <simon.fraser@apple.com>
     2
     3        REGRESSION (r283335): rubber-banding no longer locks to an axis
     4        https://bugs.webkit.org/show_bug.cgi?id=231131
     5
     6        Reviewed by Tim Horton.
     7
     8        r283335 introduced a bug where pulling down to rubber-band would result in sideways
     9        motion even when the gesture was mostly vertical.
     10
     11        ScrollingEffectsController::modifyScrollDeltaForStretching() has some axis-locking behavior
     12        that was broken by r283335, so restore the old behavior.
     13
     14        Test: fast/scrolling/mac/rubberband-axis-locking.html
     15
     16        * platform/mac/ScrollingEffectsController.mm:
     17        (WebCore::ScrollingEffectsController::modifyScrollDeltaForStretching):
     18        (WebCore::isHorizontalSide): Deleted.
     19        (WebCore::isVerticalSide): Deleted.
     20
    1212021-10-03  Antti Koivisto  <antti@apple.com>
    222
  • trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm

    r283393 r283465  
    114114}
    115115
    116 static bool isHorizontalSide(std::optional<BoxSide> side)
    117 {
    118     return side && (*side == BoxSide::Left || *side == BoxSide::Right);
    119 }
    120 
    121 static bool isVerticalSide(std::optional<BoxSide> side)
    122 {
    123     return side && (*side == BoxSide::Top || *side == BoxSide::Bottom);
    124 }
    125 
    126116bool ScrollingEffectsController::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
    127117{
     
    245235    auto affectedSide = affectedSideOnDominantAxis(delta);
    246236    if (isVerticallyStretched) {
    247         if (!isHorizontallyStretched && isHorizontalSide(affectedSide) && m_client.isPinnedOnSide(*affectedSide)) {
     237        if (!isHorizontallyStretched && affectedSide && m_client.isPinnedOnSide(*affectedSide)) {
    248238            // Stretching only in the vertical.
    249239            if (delta.height() && (fabsf(delta.width() / delta.height()) < rubberbandDirectionLockStretchRatio))
     
    261251    if (isHorizontallyStretched) {
    262252        // Stretching only in the horizontal.
    263         if (isVerticalSide(affectedSide) && m_client.isPinnedOnSide(*affectedSide)) {
     253        if (affectedSide && m_client.isPinnedOnSide(*affectedSide)) {
    264254            if (delta.width() && (fabsf(delta.height() / delta.width()) < rubberbandDirectionLockStretchRatio))
    265255                delta.setHeight(0);
Note: See TracChangeset for help on using the changeset viewer.