aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flexbox.rs
diff options
context:
space:
mode:
authorbors-servo <servo-ops@mozilla.com>2020-06-10 01:33:34 -0400
committerGitHub <noreply@github.com>2020-06-10 01:33:34 -0400
commit554af02ab44f6dc96b8ebc570cdb01708a5a44bb (patch)
treeea05dd40bbf09a2c2e9c15c62933a7c1732d8cad /components/layout_2020/flexbox.rs
parent1a561242cfca27b51d31bf63509cbc95044b69d4 (diff)
parente975d24c4bb705f7897edde83f61725655399e8f (diff)
downloadservo-554af02ab44f6dc96b8ebc570cdb01708a5a44bb.tar.gz
servo-554af02ab44f6dc96b8ebc570cdb01708a5a44bb.zip
Auto merge of #26833 - servo:layout-2020-arcrefcell-abspos, r=SimonSapin
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/flexbox.rs')
-rw-r--r--components/layout_2020/flexbox.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/components/layout_2020/flexbox.rs b/components/layout_2020/flexbox.rs
index c0d852ff47c..32ea3340ff7 100644
--- a/components/layout_2020/flexbox.rs
+++ b/components/layout_2020/flexbox.rs
@@ -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(