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
803 B
HTML
34 lines
803 B
HTML
<!doctype html>
|
|
<style>
|
|
.outer {
|
|
height: 100px;
|
|
}
|
|
.inner {
|
|
display: inline-block;
|
|
}
|
|
.inner::before {
|
|
content: "Hi";
|
|
background-color: red;
|
|
}
|
|
.outer:hover .inner::before {
|
|
content: "Long text";
|
|
background-color: lime;
|
|
}
|
|
</style>
|
|
<script src="../include.js"></script>
|
|
<div class="outer"><div class="inner"></div></div>
|
|
<script>
|
|
test(() => {
|
|
const inner = document.querySelector('.inner');
|
|
println('Not hovering: ' + inner.clientWidth);
|
|
|
|
// Move mouse over .outer
|
|
internals.mouseMove(80, 80);
|
|
println('Hovering: ' + inner.clientWidth);
|
|
|
|
// Move mouse away again
|
|
internals.mouseMove(200, 200);
|
|
println('Not hovering: ' + inner.clientWidth);
|
|
});
|
|
</script>
|