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:
Martin Robinson 2015-11-20 17:14:16 -08:00
parent 711f516d80
commit 8dd664a438
13 changed files with 149 additions and 61 deletions

View file

@ -175,7 +175,7 @@ impl Debug for DebugWritingMode {
#[cfg(debug_assertions)]
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
self.mode.fmt(formatter)
write!(formatter, "{}", self.mode)
}
}
@ -502,13 +502,18 @@ pub struct LogicalMargin<T> {
impl<T: Debug> Debug for LogicalMargin<T> {
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
write!(formatter,
"LogicalMargin({:?}, inline: {:?}..{:?} block: {:?}..{:?})",
self.debug_writing_mode,
self.inline_start,
self.inline_end,
self.block_start,
self.block_end)
let writing_mode_string = if cfg!(debug_assertions) {
format!("{:?}, ", self.debug_writing_mode)
} else {
"".to_owned()
};
write!(formatter, "LogicalMargin({}i:{:?}..{:?} b:{:?}..{:?})",
writing_mode_string,
self.inline_start,
self.inline_end,
self.block_start,
self.block_end)
}
}
@ -788,9 +793,14 @@ pub struct LogicalRect<T> {
impl<T: Debug> Debug for LogicalRect<T> {
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
write!(formatter,
"LogicalRect({:?}, i{:?}×b{:?}, @ (i{:?},b{:?}))",
self.debug_writing_mode,
let writing_mode_string = if cfg!(debug_assertions) {
format!("{:?}, ", self.debug_writing_mode)
} else {
"".to_owned()
};
write!(formatter, "LogicalRect({}i{:?}×b{:?}, @ (i{:?},b{:?}))",
writing_mode_string,
self.size.inline,
self.size.block,
self.start.i,