mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
Instead of defining somewhat high level mouse actions, allow granular control of mouse clicks and mouse down/up/move events. We will want to simulate things like holding down a mouse button after double clicking and then dragging the mouse to another position in the future, and this enables that.
34 lines
716 B
HTML
34 lines
716 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.mouseMove(0, 0);
|
|
println(internals.currentCursor());
|
|
|
|
internals.mouseMove(100, 100);
|
|
println(internals.currentCursor());
|
|
|
|
foo.addEventListener("mousemove", e => e.preventDefault());
|
|
|
|
internals.mouseMove(0, 0);
|
|
println(internals.currentCursor());
|
|
|
|
internals.mouseMove(100, 100);
|
|
println(internals.currentCursor());
|
|
});
|
|
</script>
|