diff options
author | Martin Robinson <mrobinson@igalia.com> | 2025-04-18 16:19:24 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2025-04-22 16:37:03 +0200 |
commit | 57428bc5da0b73f6fc81510a1aa7816e720baf14 (patch) | |
tree | b1587a3e79a2984bea0e3a9f80ebc87830472c51 /components/shared/script_layout/lib.rs | |
parent | 73703e75ba17ca2b4f7999c62c1585360bda5ed6 (diff) | |
download | servo-57428bc5da0b73f6fc81510a1aa7816e720baf14.tar.gz servo-57428bc5da0b73f6fc81510a1aa7816e720baf14.zip |
layout: Implement node geometry queries against `BoxTree`'s `Fragment`
This is a followup to #36629, continuing to implement script-based
layout queries using the `Fragment`s attached to the `BoxTree`. In this
change, geometry queris (apart from parent offset) are calculated using
`Fragment`s hanging of the `BoxTree`.
In order to make this work, all `Fragment`s for inlines split by blocks,
need to be accessible in the `BoxTree`. This required some changes to
the way that box tree items were stored in DOM `BoxSlot`s. Now every
inline level item can have more than a single `BoxTree` item. These are
carefully collected by the `InlineFormattingContextBuilder` -- currently
a bit fragile, but with more documentation.
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/shared/script_layout/lib.rs')
-rw-r--r-- | components/shared/script_layout/lib.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/components/shared/script_layout/lib.rs b/components/shared/script_layout/lib.rs index 69e577e139d..6efbb2ae3eb 100644 --- a/components/shared/script_layout/lib.rs +++ b/components/shared/script_layout/lib.rs @@ -240,9 +240,9 @@ pub trait Layout { /// Set the scroll states of this layout after a compositor scroll. fn set_scroll_offsets(&mut self, scroll_states: &[ScrollState]); - fn query_content_box(&self, node: OpaqueNode) -> Option<Rect<Au>>; - fn query_content_boxes(&self, node: OpaqueNode) -> Vec<Rect<Au>>; - fn query_client_rect(&self, node: OpaqueNode) -> Rect<i32>; + fn query_content_box(&self, node: TrustedNodeAddress) -> Option<Rect<Au>>; + fn query_content_boxes(&self, node: TrustedNodeAddress) -> Vec<Rect<Au>>; + fn query_client_rect(&self, node: TrustedNodeAddress) -> Rect<i32>; fn query_element_inner_outer_text(&self, node: TrustedNodeAddress) -> String; fn query_nodes_from_point( &self, |