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.
This commit is contained in:
Anthony Ramine 2020-06-09 13:44:43 +02:00
parent e044d8582c
commit e975d24c4b
7 changed files with 65 additions and 53 deletions

View file

@ -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 {