Files
ladybird/Tests/LibWeb/Text/input/UIEvents/pointer-events-none-scrollbar.html
Zaggy1024 9a39a8308b LibWeb: Prevent events on scrollbars when pointer-events is none
This prevents an assertion failure in EventHandler's mousemove and
mousedown handlers when hovering over a scrollbar with pointer-events
set to none.
2026-03-17 04:01:29 -05:00

38 lines
875 B
HTML

<!DOCTYPE html>
<style>
body {
margin: 0;
width: 200px;
height: 200px;
}
#scrollable {
width: 150px;
height: 100px;
overflow-y: scroll;
pointer-events: none;
}
#content {
height: 1000px;
}
</style>
<div id="scrollable">
<div id="content"></div>
</div>
<script src="../include.js"></script>
<script>
test(() => {
// Move over the scrollbar area, then click on it. With pointer-events: none,
// this should not crash and should not scroll.
internals.mouseMove(147, 50);
internals.mouseDown(147, 50);
internals.mouseUp(147, 50);
println(`scrollTop after click on scrollbar: ${scrollable.scrollTop}`);
// Wheel events should also not scroll the element.
internals.wheel(75, 50, 0, 100);
println(`scrollTop after wheel: ${scrollable.scrollTop}`);
});
</script>