Skip to content

Commit

Permalink
Bug 1864470 [wpt PR 43117] - Avoid spec ambiguity in scroll-target-sn…
Browse files Browse the repository at this point in the history
…ap-* tests., a=testonly

Automatic update from web-platform-tests
Avoid spec ambiguity in scroll-target-snap-* tests.

Chrome prioritizes ScrollIntoViewOptions over scroll-snap-align, but the
specs need clarification on this point:

w3c/csswg-drafts#9576

In the meantime, have the tests use scroll-snap-align: start instead of
center, so that it matches the default ScrollIntoViewOptions.

Bug: 1325845
Change-Id: Ibd40a187cc86b9286ff9e2c7a67ed59d7233185b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5025233
Reviewed-by: Robert Flack <flackrchromium.org>
Commit-Queue: Steve Kobes <skobeschromium.org>
Cr-Commit-Position: refs/heads/main{#1223689}

--

wpt-commits: ff3d3e29464e87581edc6eea7037485e424097d7
wpt-pr: 43117

UltraBlame original commit: e0272cfd4f73823e45cff178a76e6e89e379c848
  • Loading branch information
marco-c committed Nov 30, 2023
1 parent cd312ad commit ea251d7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@
.container > div {
height: 1em;
}
#target { scroll-margin: 1em 0 0;
scroll-snap-align: center; } /* set up a snap position */
/* Note: we use "start" for #target to avoid spec ambiguity where
* scroll-snap-align conflicts with default ScrollIntoViewOptions.
* See https://github.com/w3c/csswg-drafts/issues/9576.
*/
#target { scroll-margin: 2em 0 0;
scroll-snap-align: start; } /* set up a snap position */
#stripe { background: green; } /* color part of the snap area */
.fail { color: red; } /* make failing more obvious */

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
div {
height: 1em;
}
#target { scroll-margin: 1em 0 0;
scroll-snap-align: center; } /* set up a snap position */
/* Note: we use "start" for #target to avoid spec ambiguity where
* scroll-snap-align conflicts with default ScrollIntoViewOptions.
* See https://github.com/w3c/csswg-drafts/issues/9576.
*/
#target { scroll-margin: 2em 0 0;
scroll-snap-align: start; } /* set up a snap position */
#stripe { background: green; } /* color part of the snap area */
.fail { color: red; } /* make failing more obvious */

Expand Down

0 comments on commit ea251d7

Please sign in to comment.