Skip to content

layout: Consider transform for bounding box queries - #54044

Merged
servo-wpt-sync merged 1 commit into
web-platform-tests:masterfrom
servo:servo_export_37871
Jul 30, 2025
Merged

servo-wpt-sync merged 1 commit into
web-platform-tests:masterfrom
servo:servo_export_37871

Conversation

@servo-wpt-sync

Copy link
Copy Markdown
Collaborator

The recent changes that cached the Scroll Tree present an opportunity to calculate the queries that consider transform and scroll (dubbed as post composite queries) accurately.

This PR propose a solution for this calculation by noting the lowest scroll tree nodes that would affect a fragment. To do this, each fragment would store a new attribute spatial_tree_node -- scroll tree node id that we could use for the query. This referencing is considered because the scroll tree node construction is managed by the fragment itself. Therefore it would ease the managing the possibly stale reference and future query cache invalidation considering the development of incremental layout.

The bounding box query then could transform the bounding content rect of a fragment using the computed current transformation matrix.

Fixes: servo/servo#35768
Testing: Existing and new WPT

Reviewed in servo/servo#37871

@wpt-pr-bot wpt-pr-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Servo project.

@servo-wpt-sync
servo-wpt-sync merged commit 2cdcad3 into web-platform-tests:master Jul 30, 2025
@servo-wpt-sync
servo-wpt-sync deleted the servo_export_37871 branch July 30, 2025 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider scroll offset in getBoundingBox()

3 participants