mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibWeb: Adjust stacking context position by scroll offset in hit-testing
Fixes a bug when stacking contexts nested inside scrollable box are treated as fixed positioned during hit-testing.
This commit is contained in:
parent
1163ff21d7
commit
53ef0e2e88
Notes:
github-actions[bot]
2024-08-07 16:15:32 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 53ef0e2e88
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1000
3 changed files with 46 additions and 1 deletions
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../include.js"></script>
|
||||
<style>
|
||||
#scrollable-box {
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
border: 1px solid #000;
|
||||
overflow: auto;
|
||||
padding: 10px;
|
||||
}
|
||||
#inner-box {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
background-color: #f0f0f0;
|
||||
border: 1px solid #ccc;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
</style>
|
||||
<div id="scrollable-box">
|
||||
<section id="inner-box">
|
||||
<p>Establishes a stacking context.</p>
|
||||
</section>
|
||||
<div id="scroll-space-filler" style="height: 500px"></div>
|
||||
</div>
|
||||
<script>
|
||||
const scrollbox = document.getElementById("scrollable-box");
|
||||
scrollbox.scrollTop = 200;
|
||||
test(() => {
|
||||
printElement(internals.hitTest(50, 50).node);
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue