mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Improve readability of flow tree dump
Use the PrintTree utility to improve the readability of flow tree dumps. Blocks and fragments are now split over two dump levels, because otherwise they are impenetrable. Also start printing the restyle damage of fragments.
This commit is contained in:
parent
711f516d80
commit
8dd664a438
13 changed files with 149 additions and 61 deletions
|
@ -62,6 +62,7 @@ use style::values::computed::{LengthOrPercentage, LengthOrPercentageOrAuto};
|
|||
use util::geometry::MAX_RECT;
|
||||
use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode};
|
||||
use util::opts;
|
||||
use util::print_tree::PrintTree;
|
||||
|
||||
/// Information specific to floated blocks.
|
||||
#[derive(Clone, RustcEncodable)]
|
||||
|
@ -2035,15 +2036,18 @@ impl Flow for BlockFlow {
|
|||
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
||||
(*mutator)(&mut self.fragment)
|
||||
}
|
||||
|
||||
fn print_extra_flow_children(&self, print_tree: &mut PrintTree) {
|
||||
print_tree.add_item(format!("↑↑ Fragment for block: {:?}", self.fragment));
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for BlockFlow {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f,
|
||||
"{:?} - {:x}: frag={:?} ({:?})",
|
||||
"{:?}({:x}) {:?}",
|
||||
self.class(),
|
||||
self.base.debug_id(),
|
||||
self.fragment,
|
||||
self.base)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue