mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 07:33:20 +00:00
LibWeb: Hit test StackingContext's children before testing visibility
If a node that establishes a StackingContext has `pointer-events: none`, hit testing should first proceed with hit testing the SC's children before deciding to bail. We were checking for `pointer-events` too early, causing large parts of certain websites to be noninteractive. Fixes #6017.
This commit is contained in:
parent
8bbb3429b4
commit
054b4dace0
Notes:
github-actions[bot]
2025-08-28 23:26:04 +00:00
Author: https://github.com/gmta
Commit: 054b4dace0
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6021
3 changed files with 19 additions and 11 deletions
|
@ -384,9 +384,6 @@ void StackingContext::paint(DisplayListRecordingContext& context) const
|
|||
|
||||
TraversalDecision StackingContext::hit_test(CSSPixelPoint position, HitTestType type, Function<TraversalDecision(HitTestResult)> const& callback) const
|
||||
{
|
||||
if (!paintable_box().visible_for_hit_testing())
|
||||
return TraversalDecision::Continue;
|
||||
|
||||
auto const inverse_transform = affine_transform_matrix().inverse().value_or({});
|
||||
auto const transform_origin = paintable_box().transform_origin();
|
||||
// NOTE: This CSSPixels -> Float -> CSSPixels conversion is because we can't AffineTransform::map() a CSSPixelPoint.
|
||||
|
@ -455,6 +452,9 @@ TraversalDecision StackingContext::hit_test(CSSPixelPoint position, HitTestType
|
|||
return TraversalDecision::Break;
|
||||
}
|
||||
|
||||
if (!paintable_box().visible_for_hit_testing())
|
||||
return TraversalDecision::Continue;
|
||||
|
||||
auto const enclosing_scroll_offset = paintable_box().cumulative_offset_of_enclosing_scroll_frame();
|
||||
auto const raw_position_adjusted_by_scroll_offset = position.translated(-enclosing_scroll_offset);
|
||||
// NOTE: This CSSPixels -> Float -> CSSPixels conversion is because we can't AffineTransform::map() a CSSPixelPoint.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue