Files
ladybird/Tests/LibWeb/Text/input/css/update-pseudo-elements-on-hover.html
Jelle Raaijmakers f55fe69d4d LibWeb: Rework Internals' mouse control
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.
2026-02-06 14:18:10 +00:00

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>