aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/layout_box_base.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2025-04-09 15:32:07 +0200
committerGitHub <noreply@github.com>2025-04-09 13:32:07 +0000
commit2d001e2c855caeaaa19a78ee01c9cd76d13ab476 (patch)
treef3ac3e56edd7c52a42180d1a6fc64e18e9dedd04 /components/layout_2020/layout_box_base.rs
parent15cac97adab041269c45c4baf400241b18f5f37d (diff)
downloadservo-2d001e2c855caeaaa19a78ee01c9cd76d13ab476.tar.gz
servo-2d001e2c855caeaaa19a78ee01c9cd76d13ab476.zip
layout: Enable using cached fragments when there is a BoxTree update point (#36404)
This starts to enable the fragment cache for all layout modes, except grid. The main tricky bit here is that update points are absolutes and these need to be laid out again in their containing blocks. We punt a little bit on this, by forcing ancestors of update points to rebuild their Fragments. This is just the first step. Testing: We do not currently have layout performance tests, but will try to run some tests manually later. Behavior is covered by the WPT. Co-authored-by: Oriol Brufau <obrufau@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Diffstat (limited to 'components/layout_2020/layout_box_base.rs')
-rw-r--r--components/layout_2020/layout_box_base.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/components/layout_2020/layout_box_base.rs b/components/layout_2020/layout_box_base.rs
index bb2d37698f1..885ff0d26d3 100644
--- a/components/layout_2020/layout_box_base.rs
+++ b/components/layout_2020/layout_box_base.rs
@@ -63,6 +63,10 @@ impl LayoutBoxBase {
*cache = Some((constraint_space.block_size, result));
result
}
+
+ pub(crate) fn invalidate_cached_fragment(&self) {
+ let _ = self.cached_layout_result.borrow_mut().take();
+ }
}
impl Debug for LayoutBoxBase {