aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWu Yu Wei <wusyong9104@gmail.com>2022-04-17 16:18:32 +0800
committerWu Yu Wei <wusyong9104@gmail.com>2022-04-17 16:18:32 +0800
commitb978f83e529092999f997279007300cd47ce2369 (patch)
tree050e0712ecc20cdad2f79953dbf92c9c64d7bdf6
parenta80b962f56a39e497d2ec567f4603a5ccfe269e1 (diff)
downloadservo-b978f83e529092999f997279007300cd47ce2369.tar.gz
servo-b978f83e529092999f997279007300cd47ce2369.zip
Add trace logs when assigning inline/block sizes
-rw-r--r--components/layout/block.rs24
-rw-r--r--components/layout/multicol.rs14
-rw-r--r--components/layout/table.rs9
-rw-r--r--components/layout/table_caption.rs8
-rw-r--r--components/layout/table_cell.rs7
-rw-r--r--components/layout/table_rowgroup.rs7
-rw-r--r--components/layout/table_wrapper.rs7
7 files changed, 68 insertions, 8 deletions
diff --git a/components/layout/block.rs b/components/layout/block.rs
index 4b0999489ee..89342dd7c6b 100644
--- a/components/layout/block.rs
+++ b/components/layout/block.rs
@@ -1994,6 +1994,7 @@ impl BlockFlow {
"block"
}
);
+ trace!("BlockFlow before assigning: {:?}", &self);
self.base.floats = Floats::new(self.base.writing_mode);
@@ -2003,7 +2004,9 @@ impl BlockFlow {
// Now compute the real value.
self.propagate_and_compute_used_inline_size(shared_context);
- self.guess_inline_size_for_block_formatting_context_if_necessary()
+ self.guess_inline_size_for_block_formatting_context_if_necessary();
+
+ trace!("BlockFlow after assigning: {:?}", &self);
}
/// If this is the root flow, initialize values that would normally be set by the parent.
@@ -2304,25 +2307,32 @@ impl Flow for BlockFlow {
self.base.flags.contains(FlowFlags::MARGINS_CANNOT_COLLAPSE)
{
// Root element margins should never be collapsed according to CSS § 8.3.1.
+ debug!("{}", self.is_root());
debug!(
- "assign_block_size: assigning block_size for root flow {:?}",
+ "assign_block_size: assigning block_size for root flow {:#x?}",
self.base().debug_id()
);
- self.assign_block_size_block_base(
+ trace!("BlockFlow before assigning: {:?}", &self);
+ let flow = self.assign_block_size_block_base(
layout_context,
fragmentation_context,
MarginsMayCollapseFlag::MarginsMayNotCollapse,
- )
+ );
+ trace!("BlockFlow after assigning: {:?}", &self);
+ flow
} else {
debug!(
- "assign_block_size: assigning block_size for block {:?}",
+ "assign_block_size: assigning block_size for block {:#x?}",
self.base().debug_id()
);
- self.assign_block_size_block_base(
+ trace!("BlockFlow before assigning: {:?}", &self);
+ let flow = self.assign_block_size_block_base(
layout_context,
fragmentation_context,
MarginsMayCollapseFlag::MarginsMayCollapse,
- )
+ );
+ trace!("BlockFlow after assigning: {:?}", &self);
+ flow
}
}
diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs
index 4e1bfdf8d58..2e7890a8be5 100644
--- a/components/layout/multicol.rs
+++ b/components/layout/multicol.rs
@@ -84,6 +84,8 @@ impl Flow for MulticolFlow {
"assign_inline_sizes({}): assigning inline_size for flow",
"multicol"
);
+ trace!("MulticolFlow before assigning: {:?}", &self);
+
let shared_context = layout_context.shared_context();
self.block_flow.compute_inline_sizes(shared_context);
@@ -146,10 +148,13 @@ impl Flow for MulticolFlow {
column_width,
|_, _, _, _, _, _| {},
);
+
+ trace!("MulticolFlow after assigning: {:?}", &self);
}
fn assign_block_size(&mut self, ctx: &LayoutContext) {
debug!("assign_block_size: assigning block_size for multicol");
+ trace!("MulticolFlow before assigning: {:?}", &self);
let fragmentation_context = Some(FragmentationContext {
this_fragment_is_empty: true,
@@ -193,6 +198,8 @@ impl Flow for MulticolFlow {
None => break,
};
}
+
+ trace!("MulticolFlow after assigning: {:?}", &self);
}
fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
@@ -289,12 +296,19 @@ impl Flow for MulticolColumnFlow {
"assign_inline_sizes({}): assigning inline_size for flow",
"multicol column"
);
+ trace!("MulticolFlow before assigning: {:?}", &self);
+
self.block_flow.assign_inline_sizes(layout_context);
+ trace!("MulticolFlow after assigning: {:?}", &self);
}
fn assign_block_size(&mut self, ctx: &LayoutContext) {
debug!("assign_block_size: assigning block_size for multicol column");
+ trace!("MulticolFlow before assigning: {:?}", &self);
+
self.block_flow.assign_block_size(ctx);
+
+ trace!("MulticolFlow after assigning: {:?}", &self);
}
fn fragment(
diff --git a/components/layout/table.rs b/components/layout/table.rs
index 80f5ac43032..ca4097635f9 100644
--- a/components/layout/table.rs
+++ b/components/layout/table.rs
@@ -419,6 +419,7 @@ impl Flow for TableFlow {
"assign_inline_sizes({}): assigning inline_size for flow",
"table"
);
+ trace!("TableFlow before assigning: {:?}", &self);
let shared_context = layout_context.shared_context();
// The position was set to the containing block by the flow's parent.
@@ -544,13 +545,19 @@ impl Flow for TableFlow {
}
},
);
+
+ trace!("TableFlow after assigning: {:?}", &self);
}
fn assign_block_size(&mut self, lc: &LayoutContext) {
debug!("assign_block_size: assigning block_size for table");
+ trace!("TableFlow before assigning: {:?}", &self);
+
let vertical_spacing = self.spacing().vertical();
self.block_flow
- .assign_block_size_for_table_like_flow(vertical_spacing, lc)
+ .assign_block_size_for_table_like_flow(vertical_spacing, lc);
+
+ trace!("TableFlow after assigning: {:?}", &self);
}
fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
diff --git a/components/layout/table_caption.rs b/components/layout/table_caption.rs
index 470a1c2f489..770a0e41be8 100644
--- a/components/layout/table_caption.rs
+++ b/components/layout/table_caption.rs
@@ -57,12 +57,20 @@ impl Flow for TableCaptionFlow {
"assign_inline_sizes({}): assigning inline_size for flow",
"table_caption"
);
+ trace!("TableCaptionFlow before assigning: {:?}", &self);
+
self.block_flow.assign_inline_sizes(layout_context);
+
+ trace!("TableCaptionFlow after assigning: {:?}", &self);
}
fn assign_block_size(&mut self, layout_context: &LayoutContext) {
debug!("assign_block_size: assigning block_size for table_caption");
+ trace!("TableCaptionFlow before assigning: {:?}", &self);
+
self.block_flow.assign_block_size(layout_context);
+
+ trace!("TableCaptionFlow after assigning: {:?}", &self);
}
fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs
index b1fa1852650..3a70158be26 100644
--- a/components/layout/table_cell.rs
+++ b/components/layout/table_cell.rs
@@ -252,6 +252,7 @@ impl Flow for TableCellFlow {
"assign_inline_sizes({}): assigning inline_size for flow",
"table_cell"
);
+ trace!("TableCellFlow before assigning: {:?}", &self);
let shared_context = layout_context.shared_context();
// The position was set to the column inline-size by the parent flow, table row flow.
@@ -280,11 +281,17 @@ impl Flow for TableCellFlow {
content_inline_size,
|_, _, _, _, _, _| {},
);
+
+ trace!("TableCellFlow after assigning: {:?}", &self);
}
fn assign_block_size(&mut self, layout_context: &LayoutContext) {
debug!("assign_block_size: assigning block_size for table_cell");
+ trace!("TableCellFlow before assigning: {:?}", &self);
+
self.assign_block_size_table_cell_base(layout_context);
+
+ trace!("TableCellFlow after assigning: {:?}", &self);
}
fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs
index fd984fa4291..22a66b07a7d 100644
--- a/components/layout/table_rowgroup.rs
+++ b/components/layout/table_rowgroup.rs
@@ -138,6 +138,7 @@ impl Flow for TableRowGroupFlow {
"assign_inline_sizes({}): assigning inline_size for flow",
"table_rowgroup"
);
+ trace!("TableRowGroupFlow before assigning: {:?}", &self);
let shared_context = layout_context.shared_context();
// The position was set to the containing block by the flow's parent.
@@ -184,12 +185,18 @@ impl Flow for TableRowGroupFlow {
}
},
);
+
+ trace!("TableRowGroupFlow after assigning: {:?}", &self);
}
fn assign_block_size(&mut self, lc: &LayoutContext) {
debug!("assign_block_size: assigning block_size for table_rowgroup");
+ trace!("TableRowGroupFlow before assigning: {:?}", &self);
+
self.block_flow
.assign_block_size_for_table_like_flow(self.spacing.vertical(), lc);
+
+ trace!("TableRowGroupFlow after assigning: {:?}", &self);
}
fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs
index 30afb676056..92532f8f706 100644
--- a/components/layout/table_wrapper.rs
+++ b/components/layout/table_wrapper.rs
@@ -371,6 +371,7 @@ impl Flow for TableWrapperFlow {
"table_wrapper"
}
);
+ trace!("TableWrapperFlow before assigning: {:?}", &self);
let shared_context = layout_context.shared_context();
self.block_flow
@@ -454,16 +455,22 @@ impl Flow for TableWrapperFlow {
)
},
}
+
+ trace!("TableWrapperFlow after assigning: {:?}", &self);
}
fn assign_block_size(&mut self, layout_context: &LayoutContext) {
debug!("assign_block_size: assigning block_size for table_wrapper");
+ trace!("TableWrapperFlow before assigning: {:?}", &self);
+
let remaining = self.block_flow.assign_block_size_block_base(
layout_context,
None,
MarginsMayCollapseFlag::MarginsMayNotCollapse,
);
debug_assert!(remaining.is_none());
+
+ trace!("TableWrapperFlow after assigning: {:?}", &self);
}
fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {