Bug 144710 - Scroll-snap point produces strange 'default' snap offset vector
Summary: Scroll-snap point produces strange 'default' snap offset vector
Status: RESOLVED INVALID
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:
Depends on:
Blocks:
 
Reported: 2015-05-06 14:25 PDT by Brent Fulgham
Modified: 2015-05-06 15:53 PDT (History)
2 users (show)

See Also:


Attachments
Screenshot showing horizontal scrollbar (5.64 KB, image/png)
2015-05-06 15:53 PDT, Brent Fulgham
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 2015-05-06 14:25:19 PDT
When we have scroll-snap point markup that specifies a horizontal snap range, but not a vertical, we get a default value of "{0, 15}".

Example:
  .horizontalGallery {
      width: 300px;
      height: 300px;
      overflow-y: hidden;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      -webkit-scroll-snap-points-x: repeat(100%);
      -webkit-scroll-snap-type: mandatory;
  }

This produces snap points as follows:
  horizontal = { 0, 300, 600, 900, 1200, 1500 }, vertical = { 0, 15 }

I would expect to see either no snap points, or snap points for the two scroll extrema (i.e., vertical = { 0, 1500 }
Comment 1 Brent Fulgham 2015-05-06 14:29:17 PDT
We enter the 'updateFromStyle' helper function in AxisScrollSnapOffsets.cpp with no vertical offset values. These are being set as the default positions:
1. We always append 0 when we have a scrollable area.
2. We always append the value of 'scroll{Width|Height}' - 'view{Width|Height}'

In the test case 'scroll-snap-coordinates-borders.html', we somehow have a scrollable area that is 15 pixels larger than the view area. Could this be due to scrollbars?
Comment 2 Brent Fulgham 2015-05-06 15:52:30 PDT
Measuring the pixels on a screenshot shows that the horizontal scrollbar is 15 pixels high, which is why we appear to have a vertical scrollable area of 15 pixels.

I think this is working correctly.
Comment 3 Brent Fulgham 2015-05-06 15:53:05 PDT
Created attachment 252534 [details]
Screenshot showing horizontal scrollbar