aboutsummaryrefslogtreecommitdiffstats
path: root/components/shared/script_layout/lib.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2025-04-18 13:10:35 +0200
committerMartin Robinson <mrobinson@igalia.com>2025-04-21 11:02:18 +0200
commit73703e75ba17ca2b4f7999c62c1585360bda5ed6 (patch)
treeaf73392337d25ee5d86ea38f2ec19a65b1946c87 /components/shared/script_layout/lib.rs
parent5f1d1c6f9e962f5fc107d1bde2d047eade61631d (diff)
downloadservo-73703e75ba17ca2b4f7999c62c1585360bda5ed6.tar.gz
servo-73703e75ba17ca2b4f7999c62c1585360bda5ed6.zip
layout: Add a new `FragmentTree` pass to calculate containing block rectangles
When doing any kind of query, up until now, containing block rectangles were calculated by walking the `FragmentTree` until the node being queried was found. In order to make possible answering queries without walking the `FragmentTree`, `Fragment`s need to cache their cumulative containing block rectangles. This change adds a new `FragmentTree` pass (during construction) that takes care of calculating and caching these values. The new cached value is used during resolved style queries and also scrolling area queries (with the idea that all queries will eventually use them). In addition, extra `FragmentTree` walks used for cancelling animations for elements no longer in the `FragmentTree` are integrated into this new traversal. 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.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/components/shared/script_layout/lib.rs b/components/shared/script_layout/lib.rs
index 9b052642c32..69e577e139d 100644
--- a/components/shared/script_layout/lib.rs
+++ b/components/shared/script_layout/lib.rs
@@ -265,7 +265,7 @@ pub trait Layout {
animations: DocumentAnimationSet,
animation_timeline_value: f64,
) -> Option<ServoArc<Font>>;
- fn query_scrolling_area(&self, node: Option<OpaqueNode>) -> Rect<i32>;
+ fn query_scrolling_area(&self, node: Option<TrustedNodeAddress>) -> Rect<i32>;
fn query_text_indext(&self, node: OpaqueNode, point: Point2D<f32>) -> Option<usize>;
}