mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
e044d8582c
commit
e975d24c4b
7 changed files with 65 additions and 53 deletions
|
@ -15,7 +15,6 @@ use crate::sizing::{BoxContentSizes, ContentSizes, ContentSizesRequest};
|
|||
use crate::style_ext::DisplayGeneratingBox;
|
||||
use crate::ContainingBlock;
|
||||
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
||||
use servo_arc::Arc;
|
||||
use std::borrow::Cow;
|
||||
use style::values::computed::Length;
|
||||
use style::values::specified::text::TextDecorationLine;
|
||||
|
@ -31,7 +30,7 @@ pub(crate) struct FlexContainer {
|
|||
#[derive(Debug, Serialize)]
|
||||
pub(crate) enum FlexLevelBox {
|
||||
FlexItem(IndependentFormattingContext),
|
||||
OutOfFlowAbsolutelyPositionedBox(Arc<AbsolutelyPositionedBox>),
|
||||
OutOfFlowAbsolutelyPositionedBox(ArcRefCell<AbsolutelyPositionedBox>),
|
||||
}
|
||||
|
||||
impl FlexContainer {
|
||||
|
@ -192,14 +191,14 @@ where
|
|||
};
|
||||
let box_ = if info.style.get_box().position.is_absolutely_positioned() {
|
||||
// https://drafts.csswg.org/css-flexbox/#abspos-items
|
||||
ArcRefCell::new(FlexLevelBox::OutOfFlowAbsolutelyPositionedBox(Arc::new(
|
||||
AbsolutelyPositionedBox::construct(
|
||||
ArcRefCell::new(FlexLevelBox::OutOfFlowAbsolutelyPositionedBox(
|
||||
ArcRefCell::new(AbsolutelyPositionedBox::construct(
|
||||
self.context,
|
||||
&info,
|
||||
display_inside,
|
||||
contents,
|
||||
),
|
||||
)))
|
||||
)),
|
||||
))
|
||||
} else {
|
||||
ArcRefCell::new(FlexLevelBox::FlexItem(
|
||||
IndependentFormattingContext::construct(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue