1
0
Fork 0
firefox/testing/web-platform/tests/dom/events/scrolling/scrollend-fires-to-text-input.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

32 lines
1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<style>
#inputscroller {
width: 100px;
height: 50px;
}
</style>
<input type="text" id="inputscroller"
value="qwertyuiopasddfghjklzxcvbnmqwertyuiopasddfghjklzxcvbnmqwer">
<script>
promise_test(async() => {
const inputscroller = document.getElementById("inputscroller");
assert_equals(inputscroller.scrollLeft, 0,
"text input field is not initially scrolled.");
const scrollend_promise = new Promise((resolve) => {
inputscroller.addEventListener("scrollend", resolve);
});
inputscroller.scrollLeft = 10;
await scrollend_promise;
assert_equals(inputscroller.scrollLeft, 10,
"text input field is scrolled by the correct amount");
}, "scrolled input field should receive scrollend.");
</script>
</body>
</html>