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:
parent
76e520884e
commit
245e3b9c3a
Notes:
sideshowbarker
2024-07-16 22:45:00 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/245e3b9c3a
1 changed files with 4 additions and 0 deletions
|
@ -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) };
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue