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
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue