| Summary: | Allow history swipe in scroller with overscroll-behavior | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Nikos Mouchtaris <nmouchtaris> | ||||||||
| Component: | New Bugs | Assignee: | Nikos Mouchtaris <nmouchtaris> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | cmarcelo, ews-watchlist, fred.wang, jamesr, luiz, simon.fraser, tonikitoo, webkit-bug-importer | ||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||
| Version: | WebKit Nightly Build | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=240183 | ||||||||||
| Bug Depends on: | |||||||||||
| Bug Blocks: | 235847 | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Nikos Mouchtaris
2022-01-28 19:08:02 PST
Created attachment 453149 [details]
wip
Created attachment 454525 [details]
Patch
Comment on attachment 454525 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=454525&action=review > Source/WebCore/ChangeLog:3 > + Add test for swipe navigation with overscroll-behavior The title should be about the code change, not about adding the test. > Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp:439 > + ScrollPropagationInfo propagation; > + if (horizontalOverscrollBehaviorPreventsPropagation() || verticalOverscrollBehaviorPreventsPropagation()) { > + if (horizontalOverscrollBehaviorPreventsPropagation() && !delta.height() && delta.width()) { > + propagation.shouldBlockScrollPropagation = true; > + propagation.isHandled = false; > + return propagation; > + } > + > + if ((horizontalOverscrollBehaviorPreventsPropagation() && verticalOverscrollBehaviorPreventsPropagation()) > + || (horizontalOverscrollBehaviorPreventsPropagation() && !delta.height()) > + || (verticalOverscrollBehaviorPreventsPropagation() && !delta.width())) { > + propagation.shouldBlockScrollPropagation = true; > + propagation.isHandled = true; > + } > + } > + return propagation; This is a little hard to follow. Maybe an early return if neither access prevents propagation? > Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h:44 > + bool shouldBlockScrollPropagation = false; > + bool isHandled = false; Normally we use C++ initializer style: bool shouldBlockScrollPropagation { false }; > LayoutTests/scrollingcoordinator/mac/latching/horizontal-overflow-back-swipe-overscroll-behavior.html:56 > + eventSender.monitorWheelEvents(); > + eventSender.mouseMoveTo(x, y); > + eventSender.mouseScrollByWithWheelAndMomentumPhases(1, 0, "began", "none"); > + eventSender.mouseScrollByWithWheelAndMomentumPhases(10, 0, "changed", "none"); > + eventSender.mouseScrollByWithWheelAndMomentumPhases(10, 0, "changed", "none"); > + await UIHelper.animationFrame(); > + eventSender.mouseScrollByWithWheelAndMomentumPhases(10, 0, "changed", "none"); > + eventSender.mouseScrollByWithWheelAndMomentumPhases(0, 0, "ended", "none"); > + return UIHelper.waitForScrollCompletion(); I prefer the await UIHelper.mouseWheelSequence(wheelEventSquence); technique; see if that works without the intermediate UIHelper.animationFrame(). Created attachment 455022 [details]
Patch
Committed r291497 (248609@main): <https://commits.webkit.org/248609@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 455022 [details]. |