Files
ladybird/Tests/LibWeb/Text/input/css/cursor-applied-when-cancelled.html
Timothy Flynn 96806a3f90 LibWeb: Update cursor and tooltip UI state regardless of event handlers
If a script on the page cancels a mousemove event, we would return early
and neglect to update the cursor. This is seen regularly on "Diablo Web"
where they set the cursor to "none" on the main canvas, and also cancel
mousemove events.
2025-12-03 12:23:56 +01:00

34 lines
732 B
HTML

<!DOCTYPE html>
<style>
#foo {
width: 100px;
height: 100px;
position: absolute;
top: 20px;
left: 20px;
cursor: grab;
background-color: red;
}
</style>
<div id="foo"></div>
<script src="../include.js"></script>
<script>
test(() => {
internals.movePointerTo(0, 0);
println(internals.currentCursor());
internals.movePointerTo(100, 100);
println(internals.currentCursor());
foo.addEventListener("mousemove", e => e.preventDefault());
internals.movePointerTo(0, 0);
println(internals.currentCursor());
internals.movePointerTo(100, 100);
println(internals.currentCursor());
});
</script>