mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
The previous implementation had a bug: it composed all ancestor transforms but applied them around only the innermost element's transform origin. The correct behavior is to apply each transform around its own origin. AccumulatedVisualContext already tracks all visual transformations (transforms, scroll offsets, perspective) correctly for hit testing. This change adds a new transform_rect_to_viewport() method that performs the forward transformation (element coordinates to viewport coordinates), which is the inverse direction of transform_point_for_hit_test(). This fixes getBoundingClientRect() returning incorrect coordinates for elements inside transformed ancestors with non-default transform-origins.
5 lines
62 B
Plaintext
5 lines
62 B
Plaintext
x close to 50: true
|
|
y close to 150: true
|
|
width: 50
|
|
height: 50
|