mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 10:07:15 +02:00
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:
committed by
Gregory Bertilson
parent
54dab46298
commit
2c2ad598a0
Notes:
github-actions[bot]
2026-03-17 09:04:05 +00:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/LadybirdBrowser/ladybird/commit/2c2ad598a09 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8392
@@ -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>
|
||||
Reference in New Issue
Block a user