Bug 142552 - scroll-snap-destination and scroll-snap-coordinate do not seem to work together properly
Summary: scroll-snap-destination and scroll-snap-coordinate do not seem to work togeth...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-03-10 17:24 PDT by Brent Fulgham
Modified: 2015-03-25 21:13 PDT (History)
2 users (show)

See Also:


Attachments
Example (manual) failing test case (3.73 KB, text/html)
2015-03-10 17:24 PDT, Brent Fulgham
no flags Details
Patch (6.97 KB, patch)
2015-03-22 19:13 PDT, Brent Fulgham
dino: 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-03-10 17:24:56 PDT
Created attachment 248372 [details]
Example (manual) failing test case

The "scroll-snap-destination" property is used to specify a location in the scrolling container's viewport that should be used for snapping. The "scroll-snap-coordinate" property is used to specify the coordinate in each of the child elements to align with the "scroll-snap-destination" location.

This does not seem to work properly at present.
Comment 1 Radar WebKit Bug Importer 2015-03-10 17:25:55 PDT
<rdar://problem/20114743>
Comment 2 Brent Fulgham 2015-03-22 19:13:33 PDT
Created attachment 249215 [details]
Patch
Comment 3 Brent Fulgham 2015-03-22 19:20:05 PDT
There were the following problems:

1. During testing I encountered at least one case where the CSSParser handed me a scroll-snap-destination with more than two components. I am no longer able to reproduce this, but I have added an assertion to try to catch this in the future.

2. We were not always putting a '0' offset snap point, which prevented us from snap scrolling to the beginning of the scroll container. This had the effect of creating a weird "drift" effect where WebKit tried to pull you away from the left edge of content towards the first snap point.

3. When using scroll-snap-destination/scroll-snap-coordinate markup, we were not generate per-element snap offsets to use as the basis for the "-destination" and "-coordinate" values to adjust.
Comment 4 Dean Jackson 2015-03-23 09:54:36 PDT
Comment on attachment 249215 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=249215&action=review

> Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp:103
> +            // Only add zero at the beginning

Nit: Missing full stop.
Comment 5 Brent Fulgham 2015-03-23 09:57:43 PDT
Committed r181855: <http://trac.webkit.org/changeset/181855>
Comment 6 Simon Fraser (smfr) 2015-03-25 21:13:54 PDT
Comment on attachment 249215 [details]
Patch

Why no tests?