LibWeb: Use local coordinates for hit testing chrome

Without this fix, clicking a scrollbar nested within a scrolled box
would not register.
This commit is contained in:
Zaggy1024
2026-03-12 15:19:07 -05:00
committed by Gregory Bertilson
parent 54dab46298
commit 2c2ad598a0
Notes: github-actions[bot] 2026-03-17 09:04:05 +00:00
3 changed files with 61 additions and 3 deletions

View File

@@ -0,0 +1,57 @@
<!DOCTYPE html>
<style>
body {
margin: 0;
width: 300px;
height: 300px;
}
#outer {
width: 200px;
height: 150px;
overflow-y: scroll;
overflow-x: hidden;
}
#spacer {
height: 300px;
}
#inner {
width: 150px;
height: 100px;
overflow-y: scroll;
overflow-x: hidden;
}
#content {
height: 1000px;
}
#extra {
height: 200px;
}
</style>
<div id="outer">
<div id="spacer"></div>
<div id="inner">
<div id="content"></div>
</div>
<div id="extra"></div>
</div>
<script src="../include.js"></script>
<script>
outer.scrollTop = 300;
asyncTest(done => {
// Move the cursor above the inner scrollbar gutter and click to scroll down.
internals.mouseMove(147, 50);
internals.mouseDown(147, 80);
internals.mouseUp(147, 80);
requestAnimationFrame(() => {
println(`inner scrolled: ${inner.scrollTop > 0}`);
done();
});
});
</script>