mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-08 12:56:23 +03:00
LibWeb: Always check paintable boxes children during hit-testing
Children of a paintable box are not guaranteed to be contained within its border box. Therefore, during hit-testing, we must always check them. Fixes https://github.com/SerenityOS/serenity/issues/23219
This commit is contained in:
parent
c1dbde72e9
commit
16f33aafda
Notes:
sideshowbarker
2024-07-17 03:16:02 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/16f33aafda Pull-request: https://github.com/SerenityOS/serenity/pull/23475 Issue: https://github.com/SerenityOS/serenity/issues/23219
@ -0,0 +1 @@
|
||||
Run Clicked!
|
@ -0,0 +1 @@
|
||||
here be bugsyou can't see me toggle open
|
@ -0,0 +1,28 @@
|
||||
<!DOCTYPE html><style>
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
* {
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
nav {
|
||||
position: absolute;
|
||||
height: 600px;
|
||||
}
|
||||
|
||||
nav > div {
|
||||
height: 100%;
|
||||
}
|
||||
</style><nav><div></div><button id="btn">Run</button></nav>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest(done => {
|
||||
btn.onclick = () => {
|
||||
println("Clicked!");
|
||||
done();
|
||||
};
|
||||
internals.click(20, 615);
|
||||
});
|
||||
</script>
|
@ -0,0 +1,16 @@
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
<details id="details"><summary><span>here be bugs</span></summary><span>you can't see me</span></details>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
asyncTest(done => {
|
||||
details.ontoggle = (event) => {
|
||||
println(`toggle ${event.newState}`);
|
||||
done();
|
||||
};
|
||||
internals.click(5, 5);
|
||||
});
|
||||
</script>
|
@ -861,9 +861,6 @@ TraversalDecision PaintableBox::hit_test(CSSPixelPoint position, HitTestType typ
|
||||
return stacking_context()->hit_test(position, type, callback);
|
||||
}
|
||||
|
||||
if (!absolute_border_box_rect().contains(position_adjusted_by_scroll_offset.x(), position_adjusted_by_scroll_offset.y()))
|
||||
return TraversalDecision::Continue;
|
||||
|
||||
for (auto const* child = last_child(); child; child = child->previous_sibling()) {
|
||||
auto z_index = child->computed_values().z_index();
|
||||
if (child->layout_node().is_positioned() && z_index.value_or(0) == 0)
|
||||
@ -872,6 +869,9 @@ TraversalDecision PaintableBox::hit_test(CSSPixelPoint position, HitTestType typ
|
||||
return TraversalDecision::Break;
|
||||
}
|
||||
|
||||
if (!absolute_border_box_rect().contains(position_adjusted_by_scroll_offset.x(), position_adjusted_by_scroll_offset.y()))
|
||||
return TraversalDecision::Continue;
|
||||
|
||||
if (!visible_for_hit_testing())
|
||||
return TraversalDecision::Continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user