Automatic update from web-platform-tests Merge css-scroll-snap & css-scroll-snap-2 WPTs WPTs for otoher specifications are not differentiated according to level, making css-scroll-snap-2 an exception. This patch undoes this exception by moving the css-scroll-snap-2 tests into the css-scroll-snap directory. Change-Id: I98684a181839bdfa88c2f0dc37f3d7f30be799ee Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6240294 Auto-Submit: David Awogbemila <awogbemila@chromium.org> Commit-Queue: Philip Rogers <pdr@chromium.org> Reviewed-by: Robert Flack <flackr@chromium.org> Reviewed-by: Philip Rogers <pdr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1417379} -- wpt-commits: 9ffad976d289e6b6f429ccf01fcea9ba571873db wpt-pr: 50572
64 lines
1.6 KiB
HTML
64 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title> CSS Scroll Snap 2 Test: scroll-initial-target*</title>
|
|
<link rel="help" href="https://drafts.csswg.org/css-scroll-snap-2/#scroll-initial-target">
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<style>
|
|
.spacer {
|
|
width: 200vw;
|
|
height: 200vh;
|
|
}
|
|
|
|
.box {
|
|
position: absolute;
|
|
width: 60vw;
|
|
height: 60vh;
|
|
}
|
|
|
|
.top_left {
|
|
top: 0px;
|
|
left: 0px;
|
|
background-color: red;
|
|
}
|
|
|
|
.center {
|
|
top: 60vh;
|
|
left: 60vw;
|
|
background-color: purple;
|
|
scroll-initial-target: nearest;
|
|
}
|
|
|
|
.bottom_right {
|
|
top: 120vh;
|
|
left: 120vw;
|
|
background-color: yellow;
|
|
}
|
|
</style>
|
|
<div class="spacer"></div>
|
|
<div class="top_left box" id="top_left_box"></div>
|
|
<div class="center box" id="centerbox"></div>
|
|
<div class="bottom_right box"></div>
|
|
<script>
|
|
test((t) => {
|
|
let scroller = document.scrollingElement;
|
|
let top_left_box = document.getElementById("top_left_box");
|
|
|
|
const expected_scroll_top = top_left_box.getBoundingClientRect().height;
|
|
const expected_scroll_left = top_left_box.getBoundingClientRect().width;
|
|
|
|
assert_approx_equals(scroller.scrollTop, expected_scroll_top, 1,
|
|
"scroll-initial-target sets initial vertical scroll position");
|
|
assert_approx_equals(scroller.scrollLeft, expected_scroll_left, 1,
|
|
"scroll-initial-target sets initial horizontal scroll position");
|
|
});
|
|
</script>
|
|
</body>
|
|
|