| Summary: | scroll-snap-destination and scroll-snap-coordinate do not seem to work together properly | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Brent Fulgham <bfulgham> | ||||||
| Component: | Layout and Rendering | Assignee: | Brent Fulgham <bfulgham> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | bfulgham, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Attachments: |
|
||||||||
Created attachment 249215 [details]
Patch
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 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. Committed r181855: <http://trac.webkit.org/changeset/181855> Comment on attachment 249215 [details]
Patch
Why no tests?
|
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.