Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 5 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-overflow/column-scroll-marker-003.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<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>
<style>
#container {
overflow: hidden;
columns: 3;
column-fill: auto;
gap: 0;
orphans: 1;
widows: 1;
height: 100px;
border: 15px solid;
line-height: 20px;
scroll-marker-group: before;
background: yellow;
}
#container::scroll-marker-group {
display: flex;
justify-content: space-between;
height: 50px;
background: cyan;
}
#container::column::scroll-marker {
display: flex;
justify-content: center;
align-items: center;
width: 50px;
height: 50px;
background: hotpink;
content: "*";
}
</style>
<div style="width:450px;">
<div id="container">
First column<br>
<br>
<br>
<br>
<br>
Second column<br>
<br>
<br>
<br>
<br>
Third column<br>
<br>
<br>
<br>
<br>
Fourth column<br>
<br>
<br>
<br>
<br>
Fifth column<br>
</div>
</div>
<script>
function sendClick(x) {
return new test_driver.Actions()
.pointerMove(x, 10)
.pointerDown()
.pointerUp()
.send();
}
promise_test(async t => {
await sendClick(110);
assert_equals(container.scrollLeft, 0);
}, "Scroll second column into view");
promise_test(async t => {
await sendClick(210);
assert_equals(container.scrollLeft, 0);
}, "Scroll third column into view");
promise_test(async t => {
await sendClick(310);
assert_equals(container.scrollLeft, 140);
}, "Scroll fourth column into view");
promise_test(async t => {
await sendClick(410);
assert_equals(container.scrollLeft, 280);
}, "Scroll fifth column into view");
promise_test(async t => {
await sendClick(310);
assert_equals(container.scrollLeft, 280);
}, "Scroll fourth column into view again");
promise_test(async t => {
await sendClick(210);
assert_equals(container.scrollLeft, 280);
}, "Scroll third column into view again");
promise_test(async t => {
await sendClick(110);
assert_equals(container.scrollLeft, 140);
}, "Scroll second column into view again");
promise_test(async t => {
await sendClick(10);
assert_equals(container.scrollLeft, 0);
}, "Scroll first column into view");
</script>