mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 08:17:35 +00:00
LibWeb: Fix hit testing for fixed position nodes
Subtract the scroll offset translation from the position when checking for intersection between boxes within fixed position nodes.
This commit is contained in:
parent
e64a8751d1
commit
3c6fdde466
1 changed files with 5 additions and 0 deletions
|
@ -482,6 +482,11 @@ Optional<HitTestResult> StackingContext::hit_test(CSSPixelPoint position, HitTes
|
|||
};
|
||||
auto transformed_position = affine_transform_matrix().inverse().value_or({}).map(offset_position).to_type<CSSPixels>() + transform_origin;
|
||||
|
||||
if (paintable_box().layout_box().is_fixed_position()) {
|
||||
auto scroll_offset = paintable_box().document().browsing_context()->viewport_scroll_offset();
|
||||
transformed_position.translate_by(-scroll_offset);
|
||||
}
|
||||
|
||||
// FIXME: Support more overflow variations.
|
||||
if (paintable_box().computed_values().overflow_x() == CSS::Overflow::Hidden && paintable_box().computed_values().overflow_y() == CSS::Overflow::Hidden) {
|
||||
if (!paintable_box().absolute_border_box_rect().contains(transformed_position.x(), transformed_position.y()))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue