aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/formatting_contexts.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2025-04-14 18:02:37 +0200
committerGitHub <noreply@github.com>2025-04-14 16:02:37 +0000
commitd46a17a487ce7799fc3d1e60fa093c628e62869a (patch)
tree3f01f16af26d81b6d93c3b0340acef48404fec79 /components/layout_2020/formatting_contexts.rs
parent440739090f85a6d5ba2e26978ad9c77771e7f4af (diff)
downloadservo-d46a17a487ce7799fc3d1e60fa093c628e62869a.tar.gz
servo-d46a17a487ce7799fc3d1e60fa093c628e62869a.zip
layout: Add a `LayoutBoxBase` to inline boxes (#36513)
`LayoutBoxBase` will soon contain laid out `Fragment`s of a box tree node in order to facilitate incremental layout and also layout queries. This is currently missing for inline boxes, so this change adds a `LayoutBoxBase` to them. Testing: This should not change any observable behavior, so existing WPT suites should suffice for testing. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Diffstat (limited to 'components/layout_2020/formatting_contexts.rs')
-rw-r--r--components/layout_2020/formatting_contexts.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/layout_2020/formatting_contexts.rs b/components/layout_2020/formatting_contexts.rs
index 94b1cb0523a..9877dcb287d 100644
--- a/components/layout_2020/formatting_contexts.rs
+++ b/components/layout_2020/formatting_contexts.rs
@@ -275,6 +275,7 @@ impl IndependentNonReplacedContents {
depends_on_block_constraints: bool,
) -> CacheableLayoutResult {
if let Some(cache) = base.cached_layout_result.borrow().as_ref() {
+ let cache = &**cache;
if cache.containing_block_for_children_size.inline ==
containing_block_for_children.size.inline &&
(cache.containing_block_for_children_size.block ==
@@ -305,11 +306,11 @@ impl IndependentNonReplacedContents {
depends_on_block_constraints,
);
- *base.cached_layout_result.borrow_mut() = Some(CacheableLayoutResultAndInputs {
+ *base.cached_layout_result.borrow_mut() = Some(Box::new(CacheableLayoutResultAndInputs {
result: result.clone(),
positioning_context: child_positioning_context.clone(),
containing_block_for_children_size: containing_block_for_children.size.clone(),
- });
+ }));
positioning_context.append(child_positioning_context);
result