mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 04:25:13 +00:00
LibWeb: Make hit testing better for blocks with inline children
If we don't hit one of the inline children, we should still report that we've hit the block itself.
This commit is contained in:
parent
9e6e731a78
commit
03ec57b271
Notes:
sideshowbarker
2024-07-19 08:13:12 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/03ec57b2713
1 changed files with 4 additions and 1 deletions
|
@ -359,7 +359,10 @@ HitTestResult LayoutBlock::hit_test(const Gfx::Point& position) const
|
|||
}
|
||||
}
|
||||
}
|
||||
return {};
|
||||
|
||||
// FIXME: This should be smarter about the text position if we're hitting a block
|
||||
// that has text inside it, but `position` is to the right of the text box.
|
||||
return { rect().contains(position.x(), position.y()) ? this : nullptr };
|
||||
}
|
||||
|
||||
NonnullRefPtr<StyleProperties> LayoutBlock::style_for_anonymous_block() const
|
||||
|
|
Loading…
Add table
Reference in a new issue