Skip to content
Permalink
Browse files

Make InlineLevelBox::Atomic store an IndependentFormattingContext

  • Loading branch information
nox authored and SimonSapin committed Nov 28, 2019
1 parent ecfb822 commit 48a4a82a496fd0cc76ab21606618de5e408900b6
Showing with 13 additions and 13 deletions.
  1. +8 −4 components/layout_2020/flow/construct.rs
  2. +5 −9 components/layout_2020/flow/inline.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.
@@ -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 =

0 comments on commit 48a4a82

Please sign in to comment.
You can’t perform that action at this time.