mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
2020: run layout after box construction
This commit is contained in:
parent
dc8be8f282
commit
e38cc1a549
4 changed files with 16 additions and 6 deletions
|
@ -23,6 +23,7 @@ use style::values::computed::{Length, LengthOrAuto};
|
|||
use style_traits::CSSPixel;
|
||||
|
||||
pub struct BoxTreeRoot(BlockFormattingContext);
|
||||
pub struct FragmentTreeRoot(Vec<Fragment>);
|
||||
|
||||
impl BoxTreeRoot {
|
||||
pub fn construct<'dom>(
|
||||
|
@ -95,7 +96,7 @@ fn construct_for_root_element<'dom>(
|
|||
}
|
||||
|
||||
impl BoxTreeRoot {
|
||||
fn layout(&self, viewport: geom::Size<CSSPixel>) -> Vec<Fragment> {
|
||||
pub fn layout(&self, viewport: geom::Size<CSSPixel>) -> FragmentTreeRoot {
|
||||
let initial_containing_block_size = Vec2 {
|
||||
inline: Length::new(viewport.width),
|
||||
block: Length::new(viewport.height),
|
||||
|
@ -125,6 +126,6 @@ impl BoxTreeRoot {
|
|||
.par_iter()
|
||||
.map(|a| a.layout(&initial_containing_block)),
|
||||
);
|
||||
flow_children.fragments
|
||||
FragmentTreeRoot(flow_children.fragments)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue