Bug 141001 - Scroll snap points do not work in the vertical direction
Summary: Scroll snap points do not work in the vertical direction
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-01-28 10:02 PST by Brent Fulgham
Modified: 2015-01-28 18:15 PST (History)
4 users (show)

See Also:


Attachments
Example of horizontal and vertical scroll snap points (2.72 KB, text/html)
2015-01-28 10:02 PST, Brent Fulgham
no flags Details
Patch (5.87 KB, patch)
2015-01-28 16:44 PST, Brent Fulgham
bdakin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2015-01-28 10:02:53 PST
Created attachment 245550 [details]
Example of horizontal and vertical scroll snap points

Scroll snap points work properly in the horizontal direction, but not in the vertical. See the attached example page. The top example works properly, but the bottom fails.
Comment 1 Brent Fulgham 2015-01-28 10:04:16 PST
The problem seems to be in EventHandler::defaultWheelEventHandler:

When scrolling in the horizontal direction, we do not mark the wheelEvent as 'default handled', which allows the event to bubble up and get handled by the snap logic.

When scrolling in the vertical direction, we do mark the event as 'default handled', which prevents us from bubbling the event up to the snap logic.
Comment 2 Radar WebKit Bug Importer 2015-01-28 10:04:37 PST
<rdar://problem/19632089>
Comment 3 Brent Fulgham 2015-01-28 10:21:26 PST
Actually, it looks like the difference might be in ScrollAnimatorMac::handleWheelEvent. We ask the ScrollAnimator to handle the wheel event directly in the vertical case, rather than passing it along to the scroll elasticity controller.
Comment 4 Brent Fulgham 2015-01-28 16:44:59 PST
Created attachment 245580 [details]
Patch
Comment 5 Beth Dakin 2015-01-28 16:51:53 PST
Comment on attachment 245580 [details]
Patch

R=me assuming this does not break rubber-banding in overflow areas and iframes.
Comment 6 Brent Fulgham 2015-01-28 18:15:45 PST
Committed r179324: <http://trac.webkit.org/changeset/179324>