LibWeb: Prevent hit testing from transforming position more than once

The transform of each paintable was being applied multiple times due to
the recursive nature of the hit testing methods. Previously it used
combined_css_transform to transform the position, and then it would pass
that position to children, which would then apply combined_css_transform
again, and so on.

PaintableBoxes are also not hit tested anymore when having a stacking
context. A similar check is done in PaintableWithLines, but it was
missing from PaintableBox. Without this check some elements can get
returned multiple times from a hit test.

StackingContexts with zero opacity will now also get hit tested, as it
should have been before.
This commit is contained in:
zac
2025-07-28 06:23:53 +10:00
committed by Jelle Raaijmakers
parent 2569ef0f40
commit 4070f5a7e0
Notes: github-actions[bot] 2025-08-27 07:15:40 +00:00
5 changed files with 210 additions and 33 deletions

View File

@@ -0,0 +1,10 @@
Harness status: OK
Found 5 tests
5 Pass
Pass hit testing of rectangle with 'translate' and 'rotate'
Pass hit testing of rectangle with 'transform'
Pass hit testing of rectangle with 'translate' and 'rotate' and 'scale' and 'transform'
Pass hit testing of square with 'rotate'
Pass hit testing of square with 'scale'