diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-11-25 08:07:02 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-25 08:07:02 -0500 |
commit | a562808ebb0a7b30a570a0302c1f7e69e00a3b4a (patch) | |
tree | 4e1ccd3bd391b75e4c9840b7eeb40a6252f9a852 /components/layout_2020/lib.rs | |
parent | ea3249550467bd9f5a1de8271ed4fcaa70a7cdda (diff) | |
parent | 85b2a4dc6466cc2136f0caa5867803dcee253c8a (diff) | |
download | servo-a562808ebb0a7b30a570a0302c1f7e69e00a3b4a.tar.gz servo-a562808ebb0a7b30a570a0302c1f7e69e00a3b4a.zip |
Auto merge of #24822 - servo:fontcontext, r=SimonSapin
Start implementing text in layout 2020
Diffstat (limited to 'components/layout_2020/lib.rs')
-rw-r--r-- | components/layout_2020/lib.rs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/components/layout_2020/lib.rs b/components/layout_2020/lib.rs index 052cb4b0540..c0892553f35 100644 --- a/components/layout_2020/lib.rs +++ b/components/layout_2020/lib.rs @@ -7,6 +7,7 @@ #![allow(unused_imports)] #![allow(unused_variables)] #![deny(unsafe_code)] +#![feature(exact_size_is_empty)] #[macro_use] extern crate serde; @@ -33,6 +34,7 @@ pub mod wrapper; pub use flow::{BoxTreeRoot, FragmentTreeRoot}; +use crate::context::LayoutContext; use crate::dom_traversal::{Contents, NodeExt}; use crate::flow::{BlockFormattingContext, FlowChildren}; use crate::geom::flow_relative::Vec2; @@ -87,13 +89,19 @@ impl IndependentFormattingContext { fn layout<'a>( &'a self, + layout_context: &LayoutContext, containing_block: &ContainingBlock, tree_rank: usize, absolutely_positioned_fragments: &mut Vec<AbsolutelyPositionedFragment<'a>>, ) -> FlowChildren { match self.as_replaced() { Ok(replaced) => match *replaced {}, - Err(ifc) => ifc.layout(containing_block, tree_rank, absolutely_positioned_fragments), + Err(ifc) => ifc.layout( + layout_context, + containing_block, + tree_rank, + absolutely_positioned_fragments, + ), } } } @@ -101,14 +109,18 @@ impl IndependentFormattingContext { impl<'a> NonReplacedIFC<'a> { fn layout( &self, + layout_context: &LayoutContext, containing_block: &ContainingBlock, tree_rank: usize, absolutely_positioned_fragments: &mut Vec<AbsolutelyPositionedFragment<'a>>, ) -> FlowChildren { match self { - NonReplacedIFC::Flow(bfc) => { - bfc.layout(containing_block, tree_rank, absolutely_positioned_fragments) - }, + NonReplacedIFC::Flow(bfc) => bfc.layout( + layout_context, + containing_block, + tree_rank, + absolutely_positioned_fragments, + ), } } } |