Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 8 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/css-overflow/column-scroll-marker-010.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Multicol in scrollable with ::column::scroll-marker</title>
<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>
#scrollable {
overflow: hidden;
height: 100px;
border: 15px solid;
line-height: 20px;
scroll-marker-group: before;
background: yellow;
}
#multicol {
columns: 3;
column-fill: auto;
gap: 0;
orphans: 1;
widows: 1;
width: 420px;
height: 100px;
margin-left: 100px;
margin-top: 50px;
}
#scrollable::scroll-marker-group {
display: flex;
justify-content: space-between;
height: 50px;
background: cyan;
}
#multicol::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="scrollable">
<div id="multicol">
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>
</div>
<script>
function sendClick(x) {
return new test_driver.Actions()
.pointerMove(x, 10)
.pointerDown()
.pointerUp()
.send();
}
test(()=> {
assert_equals(scrollable.scrollLeft, 0);
assert_equals(scrollable.scrollTop, 0);
}, "Initial scroll position");
promise_test(async t => {
await sendClick(110);
assert_equals(scrollable.scrollLeft, 0);
assert_equals(scrollable.scrollTop, 50);
}, "Scroll second column into view");
promise_test(async t => {
await sendClick(210);
assert_equals(scrollable.scrollLeft, 100);
assert_equals(scrollable.scrollTop, 50);
}, "Scroll third column into view");
promise_test(async t => {
await sendClick(310);
assert_equals(scrollable.scrollLeft, 240);
assert_equals(scrollable.scrollTop, 50);
}, "Scroll fourth column into view");
promise_test(async t => {
await sendClick(410);
assert_equals(scrollable.scrollLeft, 380);
assert_equals(scrollable.scrollTop, 50);
}, "Scroll fifth column into view");
promise_test(async t => {
await sendClick(310);
assert_equals(scrollable.scrollLeft, 380);
assert_equals(scrollable.scrollTop, 50);
}, "Scroll fourth column into view again");
promise_test(async t => {
await sendClick(210);
assert_equals(scrollable.scrollLeft, 380);
assert_equals(scrollable.scrollTop, 50);
}, "Scroll third column into view again");
promise_test(async t => {
await sendClick(110);
assert_equals(scrollable.scrollLeft, 240);
assert_equals(scrollable.scrollTop, 50);
}, "Scroll second column into view again");
promise_test(async t => {
await sendClick(10);
assert_equals(scrollable.scrollLeft, 100);
assert_equals(scrollable.scrollTop, 50);
}, "Scroll first column into view");
</script>