aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flow/inline.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/flow/inline.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/flow/inline.rs')
-rw-r--r--components/layout_2020/flow/inline.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/components/layout_2020/flow/inline.rs b/components/layout_2020/flow/inline.rs
index f3d0e45e3b7..47d9deacfbf 100644
--- a/components/layout_2020/flow/inline.rs
+++ b/components/layout_2020/flow/inline.rs
@@ -20,6 +20,7 @@ use crate::sizing::ContentSizes;
use crate::style_ext::{ComputedValuesExt, Display, DisplayGeneratingBox, DisplayOutside};
use crate::ContainingBlock;
use app_units::Au;
+use atomic_refcell::AtomicRef;
use gfx::text::text_run::GlyphRun;
use servo_arc::Arc;
use style::properties::ComputedValues;
@@ -39,7 +40,7 @@ pub(crate) struct InlineFormattingContext {
pub(crate) enum InlineLevelBox {
InlineBox(InlineBox),
TextRun(TextRun),
- OutOfFlowAbsolutelyPositionedBox(Arc<AbsolutelyPositionedBox>),
+ OutOfFlowAbsolutelyPositionedBox(ArcRefCell<AbsolutelyPositionedBox>),
OutOfFlowFloatBox(FloatBox),
Atomic(IndependentFormattingContext),
}
@@ -283,8 +284,9 @@ impl InlineFormattingContext {
InlineLevelBox::TextRun(run) => run.layout(layout_context, &mut ifc),
InlineLevelBox::Atomic(a) => layout_atomic(layout_context, &mut ifc, a),
InlineLevelBox::OutOfFlowAbsolutelyPositionedBox(box_) => {
+ let style = AtomicRef::map(box_.borrow(), |box_| &box_.contents.style);
let initial_start_corner =
- match Display::from(box_.contents.style.get_box().original_display) {
+ match Display::from(style.get_box().original_display) {
Display::GeneratingBox(DisplayGeneratingBox::OutsideInside {
outside,
inside: _,
@@ -313,7 +315,7 @@ impl InlineFormattingContext {
Fragment::AbsoluteOrFixedPositioned(
AbsoluteOrFixedPositionedFragment {
hoisted_fragment,
- position: box_.contents.style.clone_position(),
+ position: style.clone_position(),
},
),
);