Changeset 283465 in webkit
- Timestamp:
- Oct 3, 2021, 8:52:45 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/scrolling/mac/rubberband-axis-locking-expected.txt (added)
-
LayoutTests/fast/scrolling/mac/rubberband-axis-locking.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/mac/ScrollingEffectsController.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r283438 r283465 1 2021-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 1 11 2021-10-02 Youenn Fablet <youenn@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r283464 r283465 1 2021-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 1 21 2021-10-03 Antti Koivisto <antti@apple.com> 2 22 -
trunk/Source/WebCore/platform/mac/ScrollingEffectsController.mm
r283393 r283465 114 114 } 115 115 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 126 116 bool ScrollingEffectsController::handleWheelEvent(const PlatformWheelEvent& wheelEvent) 127 117 { … … 245 235 auto affectedSide = affectedSideOnDominantAxis(delta); 246 236 if (isVerticallyStretched) { 247 if (!isHorizontallyStretched && isHorizontalSide(affectedSide)&& m_client.isPinnedOnSide(*affectedSide)) {237 if (!isHorizontallyStretched && affectedSide && m_client.isPinnedOnSide(*affectedSide)) { 248 238 // Stretching only in the vertical. 249 239 if (delta.height() && (fabsf(delta.width() / delta.height()) < rubberbandDirectionLockStretchRatio)) … … 261 251 if (isHorizontallyStretched) { 262 252 // Stretching only in the horizontal. 263 if ( isVerticalSide(affectedSide)&& m_client.isPinnedOnSide(*affectedSide)) {253 if (affectedSide && m_client.isPinnedOnSide(*affectedSide)) { 264 254 if (delta.width() && (fabsf(delta.height() / delta.width()) < rubberbandDirectionLockStretchRatio)) 265 255 delta.setHeight(0);
Note:
See TracChangeset
for help on using the changeset viewer.