diff options
author | Anthony Ramine <nox@nox.paris> | 2019-09-19 09:40:17 +0200 |
---|---|---|
committer | Anthony Ramine <nox@nox.paris> | 2019-09-19 11:24:50 +0200 |
commit | c08cfbb5f32c81e51588322bc8106eff6776b978 (patch) | |
tree | f1a8c8baae37c5d4ce00ae17aff7ccb78b00b5cf /components/layout_2020/element_data.rs | |
parent | 745857066c7484b654aa6c32edc0c589fe184e2a (diff) | |
download | servo-c08cfbb5f32c81e51588322bc8106eff6776b978.tar.gz servo-c08cfbb5f32c81e51588322bc8106eff6776b978.zip |
Cheat the system and use an Arc in BoxSlot
Ideally we want to be able to borrow from the DOM during box construction
but that's not playing very well at the moment with the current bridge
between script and layout.
Diffstat (limited to 'components/layout_2020/element_data.rs')
-rw-r--r-- | components/layout_2020/element_data.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/components/layout_2020/element_data.rs b/components/layout_2020/element_data.rs index 17c27e1bfcd..fdf611a76c7 100644 --- a/components/layout_2020/element_data.rs +++ b/components/layout_2020/element_data.rs @@ -4,18 +4,19 @@ use crate::flow::inline::InlineLevelBox; use crate::flow::BlockLevelBox; +use atomic_refcell::AtomicRefCell; use servo_arc::Arc; #[derive(Default)] pub(crate) struct LayoutDataForElement { - pub(super) self_box: Option<LayoutBox>, + pub(super) self_box: Arc<AtomicRefCell<Option<LayoutBox>>>, pub(super) pseudo_elements: Option<Box<PseudoElementBoxes>>, } #[derive(Default)] pub(super) struct PseudoElementBoxes { - pub before: Option<LayoutBox>, - pub after: Option<LayoutBox>, + pub before: Arc<AtomicRefCell<Option<LayoutBox>>>, + pub after: Arc<AtomicRefCell<Option<LayoutBox>>>, } pub(super) enum LayoutBox { |