mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:57:45 +00:00
LibWeb: Use clip rectangles assigned to paintables in hit-testing
This change makes hit-testing more consistent in the handling of hidden overflow by reusing the same clip-rectangles. Also, it fixes bugs where the box is visible for hit-testing even though it is clipped by the hidden overflow of the containing block.
This commit is contained in:
parent
d3b983b201
commit
16f1962f10
8 changed files with 64 additions and 28 deletions
|
@ -182,6 +182,9 @@ void InlinePaintable::for_each_fragment(Callback callback) const
|
|||
|
||||
Optional<HitTestResult> InlinePaintable::hit_test(CSSPixelPoint position, HitTestType type) const
|
||||
{
|
||||
if (m_clip_rect.has_value() && !m_clip_rect.value().contains(position))
|
||||
return {};
|
||||
|
||||
auto position_adjusted_by_scroll_offset = position;
|
||||
if (m_enclosing_scroll_frame_offset.has_value())
|
||||
position_adjusted_by_scroll_offset.translate_by(-m_enclosing_scroll_frame_offset.value());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue