aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flow/construct.rs
diff options
context:
space:
mode:
authorAnthony Ramine <nox@nox.paris>2020-06-09 13:44:43 +0200
committerAnthony Ramine <nox@nox.paris>2020-06-09 15:13:18 +0200
commite975d24c4bb705f7897edde83f61725655399e8f (patch)
tree24785850cbc7a7bf9f635b01986ed875f241e530 /components/layout_2020/flow/construct.rs
parente044d8582c854d29479fe4235058962dd07ecb64 (diff)
downloadservo-e975d24c4bb705f7897edde83f61725655399e8f.tar.gz
servo-e975d24c4bb705f7897edde83f61725655399e8f.zip
Store abspos boxes in a RefCell too
We want to mutate them when lazily computing their content sizes, but they are behind an Arc for the hoisting infra, so it also needs its own layer of inner mutability.
Diffstat (limited to 'components/layout_2020/flow/construct.rs')
-rw-r--r--components/layout_2020/flow/construct.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/components/layout_2020/flow/construct.rs b/components/layout_2020/flow/construct.rs
index 4219bc7bf47..bd2d0bce23d 100644
--- a/components/layout_2020/flow/construct.rs
+++ b/components/layout_2020/flow/construct.rs
@@ -571,9 +571,14 @@ where
kind,
});
} else {
- let box_ = ArcRefCell::new(InlineLevelBox::OutOfFlowAbsolutelyPositionedBox(Arc::new(
- AbsolutelyPositionedBox::construct(self.context, info, display_inside, contents),
- )));
+ let box_ = ArcRefCell::new(InlineLevelBox::OutOfFlowAbsolutelyPositionedBox(
+ ArcRefCell::new(AbsolutelyPositionedBox::construct(
+ self.context,
+ info,
+ display_inside,
+ contents,
+ )),
+ ));
self.current_inline_level_boxes().push(box_.clone());
box_slot.set(LayoutBox::InlineLevel(box_))
}
@@ -722,10 +727,11 @@ where
display_inside,
contents,
} => {
- let block_level_box =
- ArcRefCell::new(BlockLevelBox::OutOfFlowAbsolutelyPositionedBox(Arc::new(
+ let block_level_box = ArcRefCell::new(
+ BlockLevelBox::OutOfFlowAbsolutelyPositionedBox(ArcRefCell::new(
AbsolutelyPositionedBox::construct(context, info, display_inside, contents),
- )));
+ )),
+ );
(block_level_box, ContainsFloats::No)
},
BlockLevelCreator::OutOfFlowFloatBox {