mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +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.
25 lines
581 B
HTML
25 lines
581 B
HTML
<!DOCTYPE html>
|
|
<style>
|
|
#myShadowHost:hover {
|
|
background: green;
|
|
}
|
|
#myShadowHost {
|
|
position: absolute;
|
|
width: 100px;
|
|
height: 100px;
|
|
}
|
|
</style>
|
|
<body><div id="myShadowHost"><template shadowrootmode="open"><div>hover me</div></template></div></body>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
if (window.internals && window.internals.mouseMove)
|
|
internals.mouseMove(50, 50);
|
|
|
|
let s = getComputedStyle(myShadowHost);
|
|
println("hovered bg: " + s.backgroundColor);
|
|
|
|
myShadowHost.remove();
|
|
});
|
|
</script>
|