aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Ramine <nox@nox.paris>2019-11-28 16:58:47 +0100
committerSimon Sapin <simon.sapin@exyr.org>2019-12-01 10:51:25 +0100
commit48a4a82a496fd0cc76ab21606618de5e408900b6 (patch)
tree7206f25574265eca7820db7706634cec2ce33379
parentecfb82260c76f707dad5acb1a7cc3326dabf699b (diff)
downloadservo-48a4a82a496fd0cc76ab21606618de5e408900b6.tar.gz
servo-48a4a82a496fd0cc76ab21606618de5e408900b6.zip
Make InlineLevelBox::Atomic store an IndependentFormattingContext
-rw-r--r--components/layout_2020/flow/construct.rs12
-rw-r--r--components/layout_2020/flow/inline.rs14
2 files changed, 13 insertions, 13 deletions
diff --git a/components/layout_2020/flow/construct.rs b/components/layout_2020/flow/construct.rs
index 07dd6f9765b..e7599bc843a 100644
--- a/components/layout_2020/flow/construct.rs
+++ b/components/layout_2020/flow/construct.rs
@@ -325,10 +325,14 @@ where
contents: Contents<Node>,
) -> Arc<InlineLevelBox> {
let box_ = match contents.try_into() {
- Err(replaced) => Arc::new(InlineLevelBox::Atomic {
- style: style.clone(),
- contents: replaced,
- }),
+ Err(replaced) => Arc::new(InlineLevelBox::Atomic(
+ IndependentFormattingContext::construct(
+ self.context,
+ style.clone(),
+ display_inside,
+ <Contents<Node>>::Replaced(replaced),
+ ),
+ )),
Ok(non_replaced) => match display_inside {
DisplayInside::Flow |
// TODO: Properly implement display: inline-block.
diff --git a/components/layout_2020/flow/inline.rs b/components/layout_2020/flow/inline.rs
index 5a48ac9a2ee..f944fdbedf2 100644
--- a/components/layout_2020/flow/inline.rs
+++ b/components/layout_2020/flow/inline.rs
@@ -5,12 +5,12 @@
use crate::context::LayoutContext;
use crate::flow::float::FloatBox;
use crate::flow::FlowLayout;
+use crate::formatting_contexts::IndependentFormattingContext;
use crate::fragments::{
AnonymousFragment, BoxFragment, CollapsedBlockMargins, Fragment, TextFragment,
};
use crate::geom::flow_relative::{Rect, Sides, Vec2};
use crate::positioned::{AbsolutelyPositionedBox, AbsolutelyPositionedFragment};
-use crate::replaced::ReplacedContent;
use crate::style_ext::{ComputedValuesExt, Display, DisplayGeneratingBox, DisplayOutside};
use crate::{relative_adjustement, ContainingBlock};
use servo_arc::Arc;
@@ -29,11 +29,7 @@ pub(crate) enum InlineLevelBox {
TextRun(TextRun),
OutOfFlowAbsolutelyPositionedBox(AbsolutelyPositionedBox),
OutOfFlowFloatBox(FloatBox),
- Atomic {
- style: Arc<ComputedValues>,
- // FIXME: this should be IndependentFormattingContext:
- contents: ReplacedContent,
- },
+ Atomic(IndependentFormattingContext),
}
#[derive(Debug)]
@@ -112,9 +108,9 @@ impl InlineFormattingContext {
ifc.partial_inline_boxes_stack.push(partial)
},
InlineLevelBox::TextRun(run) => run.layout(layout_context, &mut ifc),
- InlineLevelBox::Atomic { style: _, contents } => {
- // FIXME
- match *contents {}
+ InlineLevelBox::Atomic(_independent) => {
+ // TODO
+ continue;
},
InlineLevelBox::OutOfFlowAbsolutelyPositionedBox(box_) => {
let initial_start_corner =