mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +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.
21 lines
553 B
HTML
21 lines
553 B
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<style>
|
|
div {
|
|
font-size: 10px;
|
|
}
|
|
</style>
|
|
<div contenteditable="true">a<br><br><div id="b">b</div></div>
|
|
<script>
|
|
test(() => {
|
|
var bDiv = document.querySelector('div#b');
|
|
var bBounds = bDiv.getBoundingClientRect();
|
|
|
|
// Drag a selection from inside the #b div to just above it.
|
|
internals.mouseDown(bBounds.x + 2, bBounds.y + 5);
|
|
internals.mouseMove(bBounds.x + 2, bBounds.y - 5);
|
|
|
|
println('PASS (did not crash)');
|
|
});
|
|
</script>
|