mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
pretty print tree
This commit is contained in:
parent
dfd8e85338
commit
43c94d3445
4 changed files with 42 additions and 15 deletions
|
@ -2191,7 +2191,7 @@ impl Flow for BlockFlow {
|
|||
}
|
||||
|
||||
fn print_extra_flow_children(&self, print_tree: &mut PrintTree) {
|
||||
print_tree.add_item(format!("↑↑ Fragment for block: {:?}", self.fragment));
|
||||
print_tree.add_item(format!("↑↑ Fragment for block:{:?}", self.fragment));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -925,26 +925,29 @@ impl fmt::Debug for BaseFlow {
|
|||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
let child_count = self.parallel.children_count.load(Ordering::SeqCst);
|
||||
let child_count_string = if child_count > 0 {
|
||||
format!(" children={}", child_count)
|
||||
format!("\nchildren={}", child_count)
|
||||
} else {
|
||||
"".to_owned()
|
||||
};
|
||||
|
||||
let absolute_descendants_string = if self.abs_descendants.len() > 0 {
|
||||
format!(" abs-descendents={}", self.abs_descendants.len())
|
||||
format!("\nabs-descendents={}", self.abs_descendants.len())
|
||||
} else {
|
||||
"".to_owned()
|
||||
};
|
||||
|
||||
let damage_string = if self.restyle_damage != RestyleDamage::empty() {
|
||||
format!(" damage={:?}", self.restyle_damage)
|
||||
format!("\ndamage={:?}", self.restyle_damage)
|
||||
} else {
|
||||
"".to_owned()
|
||||
};
|
||||
|
||||
write!(f,
|
||||
"sc={:?} pos={:?}, {}{} floatspec-in={:?}, floatspec-out={:?}, \
|
||||
overflow={:?}{}{}{}",
|
||||
"\nsc={:?}\
|
||||
\npos={:?}{}{}\
|
||||
\nfloatspec-in={:?}\
|
||||
\nfloatspec-out={:?}\
|
||||
\noverflow={:?}{}{}{}",
|
||||
self.stacking_context_id,
|
||||
self.position,
|
||||
if self.flags.contains(FlowFlags::FLOATS_LEFT) { "FL" } else { "" },
|
||||
|
|
|
@ -2958,24 +2958,24 @@ impl Fragment {
|
|||
impl fmt::Debug for Fragment {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
let border_padding_string = if !self.border_padding.is_zero() {
|
||||
format!(" border_padding={:?}", self.border_padding)
|
||||
format!("\nborder_padding={:?}", self.border_padding)
|
||||
} else {
|
||||
"".to_owned()
|
||||
};
|
||||
|
||||
let margin_string = if !self.margin.is_zero() {
|
||||
format!(" margin={:?}", self.margin)
|
||||
format!("\nmargin={:?}", self.margin)
|
||||
} else {
|
||||
"".to_owned()
|
||||
};
|
||||
|
||||
let damage_string = if self.restyle_damage != RestyleDamage::empty() {
|
||||
format!(" damage={:?}", self.restyle_damage)
|
||||
format!("\ndamage={:?}", self.restyle_damage)
|
||||
} else {
|
||||
"".to_owned()
|
||||
};
|
||||
|
||||
write!(f, "{}({}) [{:?}] border_box={:?}{}{}{}",
|
||||
write!(f, "\n{}({}) [{:?}]\nborder_box={:?}{}{}{}",
|
||||
self.specific.get_type(),
|
||||
self.debug_id,
|
||||
self.specific,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue