Scroll snapping doesn't trigger when scrolling a scroll snap container by dragging the scrollbar.
*** Bug 203968 has been marked as a duplicate of this bug. ***
Created attachment 421186 [details]
Created attachment 421297 [details]
Comment on attachment 421297 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=421297&action=review
> + if (previouslyPressedPart == ThumbPart)
> + m_scrollableArea.doPostThumbDragSnapping(m_orientation);
It's also possible to make scrollbars scroll by clicking in the track area. Doesn't that need to snap too? This feels like a too-specific place for this code.
(In reply to Simon Fraser (smfr) from comment #4)
> Comment on attachment 421297 [details]
> View in context:
> > Source/WebCore/platform/Scrollbar.cpp:374
> > + if (previouslyPressedPart == ThumbPart)
> > + m_scrollableArea.doPostThumbDragSnapping(m_orientation);
> It's also possible to make scrollbars scroll by clicking in the track area.
> Doesn't that need to snap too? This feels like a too-specific place for this
It looks like snapping is happening properly when clicking on the gutter. There are two things that can happen when the scrollbar gutter is clicked:
1. The theme specifies that the event should cause the thumb to center on the clicked location. In this case, there is a call to setPressedPart(ThumbPart). During the mouseUp event, this will result in snapping due to the new code this patch adds, since it triggers when the pressed part is the thumb.
2. If the theme does not specify thumb centering, this works like a paging operation. In this case Scrollbar::autoscrollPressedPart is called. This method does paging via ScrollableArea::scroll(...), which already properly handles scroll snapping.
I've done two things in the new version of the patch:
1. I have renamed ScrollableArea::doPostDragSnapping to ScrollableArea::doPostThumbMoveSnapping since it doesn't just trigger during dragging.
2. I have added a test to verify that snapping happens during a typical gutter click.
Created attachment 421798 [details]
Created attachment 421809 [details]
Committed r273690: <https://commits.webkit.org/r273690>
All reviewed patches have been landed. Closing bug and clearing flags on attachment 421809 [details].