Basic wheel event handling is the last piece necessary for turning scroll snap on for GTK+ and WPE.
It seems this is useful for the Mac port as well. I have verified this by plugging in a non-momentum based mouse. Scroll snap doesn't seem to be working in this case.
Created attachment 421961 [details] Patch
Created attachment 422047 [details] Patch
Comment on attachment 422047 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=422047&action=review > Source/WebCore/platform/ScrollAnimator.cpp:214 > + ScrollBehavior behavior = ScrollBehavior::DoDirectionalSnapping; > + if (e.hasPreciseScrollingDeltas()) > + behavior = static_cast<ScrollBehavior>(behavior & ScrollBehavior::NeverAnimate); Don't you want an OptionSet<> here?
Created attachment 422686 [details] Patch
<rdar://problem/75213351>
Created attachment 422701 [details] Patch
(In reply to Simon Fraser (smfr) from comment #4) > Comment on attachment 422047 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=422047&action=review > > > Source/WebCore/platform/ScrollAnimator.cpp:214 > > + ScrollBehavior behavior = ScrollBehavior::DoDirectionalSnapping; > > + if (e.hasPreciseScrollingDeltas()) > > + behavior = static_cast<ScrollBehavior>(behavior & ScrollBehavior::NeverAnimate); > > Don't you want an OptionSet<> here? Oh nice. I wasn't aware of OptionSet<>. I've modified the patch to use that everywhere applicable.
Comment on attachment 422701 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=422701&action=review > Source/WebCore/platform/ScrollAnimator.cpp:181 > + if (processWheelEventForScrollSnap(e)) > + return false; Double indentation
Created attachment 423064 [details] Patch
commit-queue failed to commit attachment 423064 [details] to WebKit repository. To retry, please set cq+ flag again.
Created attachment 423099 [details] Patch
Committed r274381: <https://commits.webkit.org/r274381> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423099 [details].
Re-opened since this is blocked by bug 224080
Created attachment 425148 [details] Patch
Created attachment 426538 [details] Patch
Comment on attachment 426538 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426538&action=review > Source/WebCore/platform/ScrollAnimator.h:72 > + Default = 0, When we use OptionSet, we don’t need a named constant for 0.
Comment on attachment 426538 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426538&action=review > Source/WebCore/platform/ScrollAnimator.h:74 > + DoDirectionalSnapping = 1 << 1, > + NeverAnimate = 1 << 2, This should start with 1 << 0, not skip it and move on to to 1 << 1.
Comment on attachment 426538 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426538&action=review Looks fine. > Source/WebCore/platform/ScrollAnimator.cpp:182 > #if PLATFORM(MAC) > -bool ScrollAnimator::processWheelEventForScrollSnap(const PlatformWheelEvent& wheelEvent) > -{ > - return m_scrollController.processWheelEventForScrollSnap(wheelEvent); > -} > #endif Since we’re deleting this code, please delete the #if/#endif pair too!
Created attachment 426659 [details] Patch
https://bugs.webkit.org/show_bug.cgi?id=224643(In reply to Darin Adler from comment #18) > Comment on attachment 426538 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=426538&action=review > > > Source/WebCore/platform/ScrollAnimator.h:74 > > + DoDirectionalSnapping = 1 << 1, > > + NeverAnimate = 1 << 2, > > This should start with 1 << 0, not skip it and move on to to 1 << 1. Okay. I've removed Default from the enum and also have started it from 1 << 0. (In reply to Darin Adler from comment #19) > > Source/WebCore/platform/ScrollAnimator.cpp:182 > > #if PLATFORM(MAC) > > -bool ScrollAnimator::processWheelEventForScrollSnap(const PlatformWheelEvent& wheelEvent) > > -{ > > - return m_scrollController.processWheelEventForScrollSnap(wheelEvent); > > -} > > #endif > > Since we’re deleting this code, please delete the #if/#endif pair too! Oh geez! Thanks for pointing this out. I've fixed it now.
Committed r276353 (236831@main): <https://commits.webkit.org/236831@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 426659 [details].