LibWeb: Use the StackingContext tree for hit testing

This makes it possible to click links that are above other content due
to stacking context order (e.g via CSS z-index.)
This commit is contained in:
Andreas Kling 2020-07-01 19:02:28 +02:00
commit 392b055806
Notes: sideshowbarker 2024-07-19 05:14:22 +09:00
8 changed files with 36 additions and 1 deletions

View file

@ -106,6 +106,10 @@ HitTestResult LayoutNode::hit_test(const Gfx::IntPoint& position) const
{
HitTestResult result;
for_each_child([&](auto& child) {
// Skip over children that establish their own stacking context.
// The outer loop who called us will take care of those.
if (is<LayoutBox>(child) && to<LayoutBox>(child).stacking_context())
return;
auto child_result = child.hit_test(position);
if (child_result.layout_node)
result = child_result;