LibWeb: Honor pointer-events: none when hitting a PaintableBox

If the PaintableBox had children, but we didn't hit any of them, we
default to saying that you hit the PaintableBox itself.

However, if said PaintableBox has `pointer-events: none`, we should
say nothing was hit, so that the hit testing can continue.

This fixes an issue where Discord server icons were not clickable.
This commit is contained in:
Andreas Kling 2023-03-18 20:28:40 +01:00
parent 76e520884e
commit 245e3b9c3a
Notes: sideshowbarker 2024-07-16 22:45:00 +09:00

View file

@ -688,6 +688,10 @@ Optional<HitTestResult> PaintableBox::hit_test(CSSPixelPoint position, HitTestTy
continue;
return result;
}
if (!visible_for_hit_testing())
return {};
return HitTestResult { const_cast<PaintableBox&>(*this) };
}