Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!doctype html>
<meta charset="utf-8">
<title>CSS Test: ::scroll-button(inline-end) activation scrolls the same amount with zoom is the same as without zoom</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>
<script src="/dom/events/scrolling/scroll_support.js"></script>
<style>
* {
margin: 0;
padding: 0;
}
#scroller {
width: 600px;
height: 300px;
overflow: auto;
scroll-marker-group: after;
white-space: nowrap;
}
#scroller div {
background: green;
display: inline-block;
width: 600px;
height: 270px;
}
#scroller :first-child {
background: purple;
}
#scroller::scroll-marker-group {
border: 3px solid black;
padding: 5px;
display: flex;
height: 20px;
width: 40px;
}
#scroller::scroll-button(inline-end) {
content: ">";
background: blue;
position: absolute;
top: 0;
display: flex;
height: 20px;
width: 20px;
}
#scroller div::scroll-marker {
content: "";
width: 10px;
height: 10px;
background-color: blue;
border-radius: 100%;
display: inline-block;
}
</style>
<div id="scroller">
<div></div>
<div></div>
<div></div>
</div>
<script>
promise_test(async t => {
await waitForCompositorReady();
let scroll_promise = waitForScrollEndFallbackToDelayWithoutScrollEvent(scroller);
let actions_promise = new test_driver.Actions()
.pointerMove(5, 5)
.pointerDown()
.pointerUp()
.send();
await actions_promise;
await scroll_promise;
let no_zoom_scroll_amount = scroller.scrollLeft;
scroller.scrollLeft = 0;
await waitForScrollEndFallbackToDelayWithoutScrollEvent(scroller);
assert_equals(scroller.scrollLeft, 0);
document.documentElement.style.zoom = 10;
scroll_promise = waitForScrollEndFallbackToDelayWithoutScrollEvent(scroller);
actions_promise = new test_driver.Actions()
.pointerMove(5, 5)
.pointerDown()
.pointerUp()
.send();
await actions_promise;
await scroll_promise;
assert_equals(scroller.scrollLeft, no_zoom_scroll_amount);
}, "::scroll-button(inline-end) activation should scroll the same amount with zoom is the same as without zoom");
</script>