aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flow/construct.rs
diff options
context:
space:
mode:
authorAnthony Ramine <nox@nox.paris>2020-06-15 13:35:46 +0200
committerAnthony Ramine <nox@nox.paris>2020-06-15 18:09:15 +0200
commit07d8c28d4aa8c2834bba0759321ae1363ba43d54 (patch)
tree76438384d90e0f6234a1b226e970a047c1af5094 /components/layout_2020/flow/construct.rs
parentd0a1066d2d4fee2ac307bb4ec11ac843a76a26f7 (diff)
downloadservo-07d8c28d4aa8c2834bba0759321ae1363ba43d54.tar.gz
servo-07d8c28d4aa8c2834bba0759321ae1363ba43d54.zip
Make outer_inline and outer_inline_and_percentages free functions
They now take a closure that will compute the content sizes on demand.
Diffstat (limited to 'components/layout_2020/flow/construct.rs')
-rw-r--r--components/layout_2020/flow/construct.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/components/layout_2020/flow/construct.rs b/components/layout_2020/flow/construct.rs
index f72bbf1ad13..666a39d2932 100644
--- a/components/layout_2020/flow/construct.rs
+++ b/components/layout_2020/flow/construct.rs
@@ -14,7 +14,7 @@ use crate::flow::{BlockContainer, BlockFormattingContext, BlockLevelBox};
use crate::formatting_contexts::IndependentFormattingContext;
use crate::fragments::Tag;
use crate::positioned::AbsolutelyPositionedBox;
-use crate::sizing::{BoxContentSizes, ContentSizes, ContentSizesRequest};
+use crate::sizing::{self, BoxContentSizes, ContentSizes, ContentSizesRequest};
use crate::style_ext::{ComputedValuesExt, DisplayGeneratingBox, DisplayInside, DisplayOutside};
use rayon::iter::{IntoParallelIterator, ParallelIterator};
use rayon_croissant::ParallelIteratorExt;
@@ -701,10 +701,11 @@ where
),
);
if let Some(to) = max_assign_in_flow_outer_content_sizes_to {
- to.max_assign(
- &box_content_sizes
- .outer_inline(&info.style, not_actually_containing_block_writing_mode),
- )
+ to.max_assign(&sizing::outer_inline(
+ &info.style,
+ not_actually_containing_block_writing_mode,
+ || box_content_sizes.expect_inline().clone(),
+ ))
}
let block_level_box = ArcRefCell::new(BlockLevelBox::SameFormattingContextBlock {
tag: Tag::from_node_and_style_info(info),
@@ -731,12 +732,11 @@ where
propagated_text_decoration_line,
);
if let Some(to) = max_assign_in_flow_outer_content_sizes_to {
- to.max_assign(
- &contents.content_sizes.outer_inline(
- &contents.style,
- not_actually_containing_block_writing_mode,
- ),
- )
+ to.max_assign(&sizing::outer_inline(
+ &contents.style,
+ not_actually_containing_block_writing_mode,
+ || contents.content_sizes.expect_inline().clone(),
+ ))
}
(
ArcRefCell::new(BlockLevelBox::Independent(contents)),