Do `snap-scope` with the snapped target point rather than the scroll's destination
Categories
(Core :: Layout: Scrolling and Overflow, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox102 | --- | fixed |
People
(Reporter: hiro, Assigned: hiro)
References
()
Details
Attachments
(6 files)
I did wrongly implement the snap-scope
feature by using the snapport on the destination.
From the spec text;
a scroll position cannot be considered a valid snap position if snapping to it would leave the contributing snap area entirely outside the snapport
I believe snapping to it
clearly means "snapping to the candidate snap point".
This incorrect implementation has made some wpt tests failure, scrollTo-scrollBY-snaps.html for example. And the incorrect implementation has been made some wpt pass in overflowing-snap-areas.html.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
The second best edge is used for snap-overflow
feature [1]. The
snap-overflow
is applied when the following conditions are met.
- A scroll snap target element is larger than the snapport (e.g. scrollport)
in an axis - The distance between the best edge and the second best edge (on the opposite
side of the best edge) is later than the snapport size in the axis
There was a problem in our implementation. For example, in below diagram, D is
the original destination of the given scroll operation, 1 is the best edge, 2 is
the second best in our original implementation and 3 is of of the other snap
points. In this case if there's an element larger than the distance between 1
and 3 and if the snapport size is larger than the distance between 1 and 2 but
smaller than the distance between 1 and 3, we should apply snap-overflow
.
2 1 D 3
|-|---|-----|
There are a couple of test cases in wpt for this condition, for example there's
one of them in oveflowing-snap-area.html [2]. That test case have been passed
incorrectly due to our incorrect snap-scope
implementation which will be fixed
a subsequent change in this commit series.
[1] https://drafts.csswg.org/css-scroll-snap-1/#snap-overflow
[2] https://searchfox.org/mozilla-central/rev/13d69189a8abfc5064fe44944550b9b6eb4544f5/testing/web-platform/tests/css/css-scroll-snap/overflowing-snap-areas.html#131-137
Depends on D144530
Assignee | ||
Comment 3•3 years ago
|
||
In the next change we will use the snap-area to implement snap-score
properly.
Depends on D144531
Assignee | ||
Comment 4•3 years ago
|
||
Depends on D144532
Assignee | ||
Comment 6•3 years ago
|
||
For references I am attaching a test case that Botond raised in a review comment.
Assignee | ||
Comment 7•3 years ago
|
||
Depends on D144533
Assignee | ||
Updated•3 years ago
|
Comment 9•3 years ago
|
||
bugherder |
Assignee | ||
Comment 10•3 years ago
|
||
Assignee | ||
Updated•3 years ago
|
Comment 11•3 years ago
|
||
Comment 13•3 years ago
|
||
bugherder |
Description
•