aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/flexbox/construct.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout_2020/flexbox/construct.rs')
-rw-r--r--components/layout_2020/flexbox/construct.rs41
1 files changed, 27 insertions, 14 deletions
diff --git a/components/layout_2020/flexbox/construct.rs b/components/layout_2020/flexbox/construct.rs
index 3f4f7aab734..22215651395 100644
--- a/components/layout_2020/flexbox/construct.rs
+++ b/components/layout_2020/flexbox/construct.rs
@@ -12,7 +12,11 @@ use crate::cell::ArcRefCell;
use crate::context::LayoutContext;
use crate::dom::{BoxSlot, LayoutBox, NodeExt};
use crate::dom_traversal::{Contents, NodeAndStyleInfo, NonReplacedContents, TraversalHandler};
-use crate::formatting_contexts::IndependentFormattingContext;
+use crate::flow::BlockFormattingContext;
+use crate::formatting_contexts::{
+ IndependentFormattingContext, NonReplacedFormattingContext,
+ NonReplacedFormattingContextContents,
+};
use crate::positioned::AbsolutelyPositionedBox;
use crate::style_ext::DisplayGeneratingBox;
@@ -143,20 +147,29 @@ where
let mut children = std::mem::take(&mut self.jobs)
.into_par_iter()
.map(|job| match job {
- FlexLevelJob::TextRuns(runs) => ArcRefCell::new(FlexLevelBox::FlexItem(
- IndependentFormattingContext::construct_for_text_runs(
- &self
- .info
- .new_replacing_style(anonymous_style.clone().unwrap()),
- runs.into_iter().map(|run| crate::flow::inline::TextRun {
- base_fragment_info: (&run.info).into(),
- text: run.text.into(),
- parent_style: run.info.style,
- has_uncollapsible_content: false,
- }),
+ FlexLevelJob::TextRuns(runs) => ArcRefCell::new(FlexLevelBox::FlexItem({
+ let runs = runs.into_iter().map(|run| crate::flow::text_run::TextRun {
+ base_fragment_info: (&run.info).into(),
+ text: run.text.into(),
+ parent_style: run.info.style,
+ has_uncollapsible_content: false,
+ shaped_text: None,
+ });
+ let bfc = BlockFormattingContext::construct_for_text_runs(
+ runs,
+ self.context,
self.text_decoration_line,
- ),
- )),
+ );
+ let info = &self
+ .info
+ .new_replacing_style(anonymous_style.clone().unwrap());
+ IndependentFormattingContext::NonReplaced(NonReplacedFormattingContext {
+ base_fragment_info: info.into(),
+ style: info.style.clone(),
+ content_sizes: None,
+ contents: NonReplacedFormattingContextContents::Flow(bfc),
+ })
+ })),
FlexLevelJob::Element {
info,
display,