Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 2 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-overflow/scroll-marker-013.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>::scroll-marker in inline formatting context</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<link rel="stylesheet" type="text/css" href="/fonts/ahem.css">
<style>
#container {
font: 20px/20px Ahem;
overflow: auto;
width: 300px;
height: 100px;
scroll-marker-group: before;
background: yellow;
}
#container::scroll-marker-group {
display: block;
height: 20px;
background: cyan;
}
#container>* {
height: 100px;
}
#container>*::scroll-marker {
content: "x";
}
</style>
<div id="container">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<script>
function sendClick(x) {
return new test_driver.Actions()
.pointerMove(x, 10)
.pointerDown()
.pointerUp()
.send();
}
promise_test(async t => {
await sendClick(170);
assert_equals(container.scrollTop, 800);
}, "Scroll last item into view");
promise_test(async t => {
await sendClick(130);
assert_equals(container.scrollTop, 600);
}, "Scroll seventh item into view");
</script>