Allow dumping the fragment tree in layout_2020

This is done when the dump-flow-tree debug option is passed.
This commit is contained in:
Martin Robinson 2020-01-13 13:00:26 +01:00
parent c6192dc286
commit ea8c635344
4 changed files with 100 additions and 5 deletions

View file

@ -17,6 +17,7 @@ use crate::replaced::ReplacedContent;
use crate::sizing::ContentSizesRequest;
use crate::style_ext::{Display, DisplayGeneratingBox, DisplayInside};
use crate::DefiniteContainingBlock;
use gfx_traits::print_tree::PrintTree;
use script_layout_interface::wrapper_traits::LayoutNode;
use servo_arc::Arc;
use style::properties::ComputedValues;
@ -154,4 +155,11 @@ impl FragmentTreeRoot {
fragment.build_display_list(builder, &containing_block)
}
}
pub fn print(&self) {
let mut print_tree = PrintTree::new("Fragment Tree".to_string());
for fragment in &self.0 {
fragment.print(&mut print_tree);
}
}
}