mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +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::geometry::MAX_RECT;
|
||||||
use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode};
|
use util::logical_geometry::{LogicalPoint, LogicalRect, LogicalSize, WritingMode};
|
||||||
use util::opts;
|
use util::opts;
|
||||||
|
use util::print_tree::PrintTree;
|
||||||
|
|
||||||
/// Information specific to floated blocks.
|
/// Information specific to floated blocks.
|
||||||
#[derive(Clone, RustcEncodable)]
|
#[derive(Clone, RustcEncodable)]
|
||||||
|
@ -2035,15 +2036,18 @@ impl Flow for BlockFlow {
|
||||||
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
||||||
(*mutator)(&mut self.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 {
|
impl fmt::Debug for BlockFlow {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f,
|
write!(f,
|
||||||
"{:?} - {:x}: frag={:?} ({:?})",
|
"{:?}({:x}) {:?}",
|
||||||
self.class(),
|
self.class(),
|
||||||
self.base.debug_id(),
|
self.base.debug_id(),
|
||||||
self.fragment,
|
|
||||||
self.base)
|
self.base)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,6 +58,7 @@ use table_rowgroup::TableRowGroupFlow;
|
||||||
use table_wrapper::TableWrapperFlow;
|
use table_wrapper::TableWrapperFlow;
|
||||||
use util::geometry::ZERO_RECT;
|
use util::geometry::ZERO_RECT;
|
||||||
use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
|
use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
|
||||||
|
use util::print_tree::PrintTree;
|
||||||
use wrapper::{PseudoElementType, ServoThreadSafeLayoutNode, ThreadSafeLayoutNode};
|
use wrapper::{PseudoElementType, ServoThreadSafeLayoutNode, ThreadSafeLayoutNode};
|
||||||
|
|
||||||
/// Virtual methods that make up a float context.
|
/// Virtual methods that make up a float context.
|
||||||
|
@ -362,6 +363,12 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static {
|
||||||
/// Attempts to perform incremental fixup of this flow by replacing its fragment's style with
|
/// Attempts to perform incremental fixup of this flow by replacing its fragment's style with
|
||||||
/// the new style. This can only succeed if the flow has exactly one fragment.
|
/// the new style. This can only succeed if the flow has exactly one fragment.
|
||||||
fn repair_style(&mut self, new_style: &Arc<ComputedValues>);
|
fn repair_style(&mut self, new_style: &Arc<ComputedValues>);
|
||||||
|
|
||||||
|
/// Print any extra children (such as fragments) contained in this Flow
|
||||||
|
/// for debugging purposes. Any items inserted into the tree will become
|
||||||
|
/// children of this flow.
|
||||||
|
fn print_extra_flow_children(&self, _: &mut PrintTree) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Base access
|
// Base access
|
||||||
|
@ -449,10 +456,10 @@ pub trait ImmutableFlowUtils {
|
||||||
fn is_inline_flow(self) -> bool;
|
fn is_inline_flow(self) -> bool;
|
||||||
|
|
||||||
/// Dumps the flow tree for debugging.
|
/// Dumps the flow tree for debugging.
|
||||||
fn dump(self);
|
fn print(self, title: String);
|
||||||
|
|
||||||
/// Dumps the flow tree for debugging, with a prefix to indicate that we're at the given level.
|
/// Dumps the flow tree for debugging into the given PrintTree.
|
||||||
fn dump_with_level(self, level: u32);
|
fn print_with_tree(self, print_tree: &mut PrintTree);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait MutableFlowUtils {
|
pub trait MutableFlowUtils {
|
||||||
|
@ -906,13 +913,32 @@ pub struct BaseFlow {
|
||||||
|
|
||||||
impl fmt::Debug for BaseFlow {
|
impl fmt::Debug for BaseFlow {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
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)
|
||||||
|
} else {
|
||||||
|
"".to_owned()
|
||||||
|
};
|
||||||
|
|
||||||
|
let absolute_descendants_string = if self.abs_descendants.len() > 0 {
|
||||||
|
format!(" abs-descendents={}", self.abs_descendants.len())
|
||||||
|
} else {
|
||||||
|
"".to_owned()
|
||||||
|
};
|
||||||
|
|
||||||
|
let damage_string = if self.restyle_damage != RestyleDamage::empty() {
|
||||||
|
format!(" damage={:?}", self.restyle_damage)
|
||||||
|
} else {
|
||||||
|
"".to_owned()
|
||||||
|
};
|
||||||
|
|
||||||
write!(f,
|
write!(f,
|
||||||
"@ {:?}, CC {}, ADC {}, Ovr {:?}, Dmg {:?}",
|
"pos={:?}, overflow={:?}{}{}{}",
|
||||||
self.position,
|
self.position,
|
||||||
self.parallel.children_count.load(Ordering::SeqCst),
|
|
||||||
self.abs_descendants.len(),
|
|
||||||
self.overflow,
|
self.overflow,
|
||||||
self.restyle_damage)
|
child_count_string,
|
||||||
|
absolute_descendants_string,
|
||||||
|
damage_string)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1278,22 +1304,19 @@ impl<'a> ImmutableFlowUtils for &'a Flow {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Dumps the flow tree for debugging.
|
/// Dumps the flow tree for debugging.
|
||||||
fn dump(self) {
|
fn print(self, title: String) {
|
||||||
self.dump_with_level(0)
|
let mut print_tree = PrintTree::new(title);
|
||||||
|
self.print_with_tree(&mut print_tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Dumps the flow tree for debugging, with a prefix to indicate that we're at the given level.
|
/// Dumps the flow tree for debugging into the given PrintTree.
|
||||||
fn dump_with_level(self, level: u32) {
|
fn print_with_tree(self, print_tree: &mut PrintTree) {
|
||||||
let mut indent = String::new();
|
print_tree.new_level(format!("{:?}", self));
|
||||||
for _ in 0..level {
|
self.print_extra_flow_children(print_tree);
|
||||||
indent.push_str("| ")
|
|
||||||
}
|
|
||||||
|
|
||||||
println!("{}+ {:?}", indent, self);
|
|
||||||
|
|
||||||
for kid in imm_child_iter(self) {
|
for kid in imm_child_iter(self) {
|
||||||
kid.dump_with_level(level + 1)
|
kid.print_with_tree(print_tree);
|
||||||
}
|
}
|
||||||
|
print_tree.end_level();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -215,11 +215,11 @@ impl fmt::Debug for SpecificFragmentInfo {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match *self {
|
match *self {
|
||||||
SpecificFragmentInfo::ScannedText(ref info) => {
|
SpecificFragmentInfo::ScannedText(ref info) => {
|
||||||
write!(f, " \"{}\"", slice_chars(&*info.run.text, info.range.begin().get() as usize,
|
write!(f, "\"{}\"", slice_chars(&*info.run.text, info.range.begin().get() as usize,
|
||||||
info.range.end().get() as usize))
|
info.range.end().get() as usize))
|
||||||
}
|
}
|
||||||
SpecificFragmentInfo::UnscannedText(ref info) => {
|
SpecificFragmentInfo::UnscannedText(ref info) => {
|
||||||
write!(f, " \"{}\"", info.text)
|
write!(f, "\"{}\"", info.text)
|
||||||
}
|
}
|
||||||
_ => Ok(())
|
_ => Ok(())
|
||||||
}
|
}
|
||||||
|
@ -2409,13 +2409,32 @@ impl Fragment {
|
||||||
|
|
||||||
impl fmt::Debug for Fragment {
|
impl fmt::Debug for Fragment {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
try!(write!(f, "({} {} ", self.debug_id(), self.specific.get_type()));
|
let border_padding_string = if !self.border_padding.is_zero() {
|
||||||
try!(write!(f, "bb {:?} bp {:?} m {:?}{:?}",
|
format!(" border_padding={:?}", self.border_padding)
|
||||||
|
} else {
|
||||||
|
"".to_owned()
|
||||||
|
};
|
||||||
|
|
||||||
|
let margin_string = if !self.margin.is_zero() {
|
||||||
|
format!(" margin={:?}", self.margin)
|
||||||
|
} else {
|
||||||
|
"".to_owned()
|
||||||
|
};
|
||||||
|
|
||||||
|
let damage_string = if self.restyle_damage != RestyleDamage::empty() {
|
||||||
|
format!(" damage={:?}", self.restyle_damage)
|
||||||
|
} else {
|
||||||
|
"".to_owned()
|
||||||
|
};
|
||||||
|
|
||||||
|
write!(f, "{}({}) [{:?}] border_box={:?}{}{}{}",
|
||||||
|
self.specific.get_type(),
|
||||||
|
self.debug_id(),
|
||||||
|
self.specific,
|
||||||
self.border_box,
|
self.border_box,
|
||||||
self.border_padding,
|
border_padding_string,
|
||||||
self.margin,
|
margin_string,
|
||||||
self.specific));
|
damage_string)
|
||||||
write!(f, ")")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ use unicode_bidi;
|
||||||
use util;
|
use util;
|
||||||
use util::geometry::ZERO_RECT;
|
use util::geometry::ZERO_RECT;
|
||||||
use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
|
use util::logical_geometry::{LogicalRect, LogicalSize, WritingMode};
|
||||||
|
use util::print_tree::PrintTree;
|
||||||
use util::range::{Range, RangeIndex};
|
use util::range::{Range, RangeIndex};
|
||||||
use wrapper::PseudoElementType;
|
use wrapper::PseudoElementType;
|
||||||
|
|
||||||
|
@ -775,16 +776,6 @@ pub struct InlineFragments {
|
||||||
pub fragments: Vec<Fragment>,
|
pub fragments: Vec<Fragment>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for InlineFragments {
|
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
||||||
for fragment in &self.fragments {
|
|
||||||
try!(write!(f, "\n * {:?}", fragment))
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
impl InlineFragments {
|
impl InlineFragments {
|
||||||
/// Creates an empty set of inline fragments.
|
/// Creates an empty set of inline fragments.
|
||||||
pub fn new() -> InlineFragments {
|
pub fn new() -> InlineFragments {
|
||||||
|
@ -1824,15 +1815,21 @@ impl Flow for InlineFlow {
|
||||||
}
|
}
|
||||||
containing_block_size
|
containing_block_size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn print_extra_flow_children(&self, print_tree: &mut PrintTree) {
|
||||||
|
for fragment in &self.fragments.fragments {
|
||||||
|
print_tree.add_item(format!("{:?}", fragment));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for InlineFlow {
|
impl fmt::Debug for InlineFlow {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "{:?} - {:x} - Ovr {:?} - {:?}",
|
write!(f,
|
||||||
|
"{:?}({:x}) {:?}",
|
||||||
self.class(),
|
self.class(),
|
||||||
self.base.debug_id(),
|
self.base.debug_id(),
|
||||||
flow::base(self).overflow,
|
flow::base(self))
|
||||||
self.fragments)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1251,7 +1251,7 @@ impl LayoutTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
if opts::get().dump_flow_tree {
|
if opts::get().dump_flow_tree {
|
||||||
root_flow.dump();
|
root_flow.print("Post layout flow tree".to_owned());
|
||||||
}
|
}
|
||||||
|
|
||||||
self.generation += 1;
|
self.generation += 1;
|
||||||
|
|
|
@ -17,6 +17,7 @@ use std::fmt;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use style::properties::ComputedValues;
|
use style::properties::ComputedValues;
|
||||||
use util::logical_geometry::LogicalSize;
|
use util::logical_geometry::LogicalSize;
|
||||||
|
use util::print_tree::PrintTree;
|
||||||
|
|
||||||
pub struct MulticolFlow {
|
pub struct MulticolFlow {
|
||||||
pub block_flow: BlockFlow,
|
pub block_flow: BlockFlow,
|
||||||
|
@ -101,6 +102,10 @@ impl Flow for MulticolFlow {
|
||||||
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
||||||
self.block_flow.mutate_fragments(mutator)
|
self.block_flow.mutate_fragments(mutator)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn print_extra_flow_children(&self, print_tree: &mut PrintTree) {
|
||||||
|
self.block_flow.print_extra_flow_children(print_tree);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for MulticolFlow {
|
impl fmt::Debug for MulticolFlow {
|
||||||
|
|
|
@ -30,6 +30,7 @@ use table_row::{TableRowFlow};
|
||||||
use table_row::{self, CellIntrinsicInlineSize, CollapsedBorder, CollapsedBorderProvenance};
|
use table_row::{self, CellIntrinsicInlineSize, CollapsedBorder, CollapsedBorderProvenance};
|
||||||
use table_wrapper::TableLayout;
|
use table_wrapper::TableLayout;
|
||||||
use util::logical_geometry::LogicalSize;
|
use util::logical_geometry::LogicalSize;
|
||||||
|
use util::print_tree::PrintTree;
|
||||||
|
|
||||||
/// A table flow corresponded to the table's internal table fragment under a table wrapper flow.
|
/// A table flow corresponded to the table's internal table fragment under a table wrapper flow.
|
||||||
/// The properties `position`, `float`, and `margin-*` are used on the table wrapper fragment,
|
/// The properties `position`, `float`, and `margin-*` are used on the table wrapper fragment,
|
||||||
|
@ -549,6 +550,10 @@ impl Flow for TableFlow {
|
||||||
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
||||||
self.block_flow.mutate_fragments(mutator)
|
self.block_flow.mutate_fragments(mutator)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn print_extra_flow_children(&self, print_tree: &mut PrintTree) {
|
||||||
|
self.block_flow.print_extra_flow_children(print_tree);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for TableFlow {
|
impl fmt::Debug for TableFlow {
|
||||||
|
|
|
@ -16,6 +16,7 @@ use std::fmt;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use style::properties::ComputedValues;
|
use style::properties::ComputedValues;
|
||||||
use util::logical_geometry::LogicalSize;
|
use util::logical_geometry::LogicalSize;
|
||||||
|
use util::print_tree::PrintTree;
|
||||||
|
|
||||||
/// A table formatting context.
|
/// A table formatting context.
|
||||||
pub struct TableCaptionFlow {
|
pub struct TableCaptionFlow {
|
||||||
|
@ -100,6 +101,10 @@ impl Flow for TableCaptionFlow {
|
||||||
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
||||||
self.block_flow.mutate_fragments(mutator)
|
self.block_flow.mutate_fragments(mutator)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn print_extra_flow_children(&self, print_tree: &mut PrintTree) {
|
||||||
|
self.block_flow.print_extra_flow_children(print_tree);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for TableCaptionFlow {
|
impl fmt::Debug for TableCaptionFlow {
|
||||||
|
|
|
@ -24,6 +24,7 @@ use style::properties::ComputedValues;
|
||||||
use table::InternalTable;
|
use table::InternalTable;
|
||||||
use table_row::{CollapsedBorder, CollapsedBorderProvenance};
|
use table_row::{CollapsedBorder, CollapsedBorderProvenance};
|
||||||
use util::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode};
|
use util::logical_geometry::{LogicalMargin, LogicalRect, LogicalSize, WritingMode};
|
||||||
|
use util::print_tree::PrintTree;
|
||||||
use wrapper::{ServoThreadSafeLayoutNode, ThreadSafeLayoutNode};
|
use wrapper::{ServoThreadSafeLayoutNode, ThreadSafeLayoutNode};
|
||||||
|
|
||||||
/// A table formatting context.
|
/// A table formatting context.
|
||||||
|
@ -214,6 +215,10 @@ impl Flow for TableCellFlow {
|
||||||
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
||||||
self.block_flow.mutate_fragments(mutator)
|
self.block_flow.mutate_fragments(mutator)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn print_extra_flow_children(&self, print_tree: &mut PrintTree) {
|
||||||
|
self.block_flow.print_extra_flow_children(print_tree);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for TableCellFlow {
|
impl fmt::Debug for TableCellFlow {
|
||||||
|
|
|
@ -29,6 +29,7 @@ use style::values::computed::LengthOrPercentageOrAuto;
|
||||||
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, VecExt};
|
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, VecExt};
|
||||||
use table_cell::{CollapsedBordersForCell, TableCellFlow};
|
use table_cell::{CollapsedBordersForCell, TableCellFlow};
|
||||||
use util::logical_geometry::{LogicalSize, PhysicalSide, WritingMode};
|
use util::logical_geometry::{LogicalSize, PhysicalSide, WritingMode};
|
||||||
|
use util::print_tree::PrintTree;
|
||||||
|
|
||||||
/// A single row of a table.
|
/// A single row of a table.
|
||||||
pub struct TableRowFlow {
|
pub struct TableRowFlow {
|
||||||
|
@ -456,11 +457,15 @@ impl Flow for TableRowFlow {
|
||||||
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
||||||
self.block_flow.mutate_fragments(mutator)
|
self.block_flow.mutate_fragments(mutator)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn print_extra_flow_children(&self, print_tree: &mut PrintTree) {
|
||||||
|
self.block_flow.print_extra_flow_children(print_tree);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for TableRowFlow {
|
impl fmt::Debug for TableRowFlow {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "TableRowFlow: {:?}", self.block_flow.fragment)
|
write!(f, "TableRowFlow: {:?}", self.block_flow)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ use style::properties::ComputedValues;
|
||||||
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, TableLikeFlow};
|
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize, InternalTable, TableLikeFlow};
|
||||||
use table_row::{self, CollapsedBordersForRow};
|
use table_row::{self, CollapsedBordersForRow};
|
||||||
use util::logical_geometry::{LogicalSize, WritingMode};
|
use util::logical_geometry::{LogicalSize, WritingMode};
|
||||||
|
use util::print_tree::PrintTree;
|
||||||
|
|
||||||
/// A table formatting context.
|
/// A table formatting context.
|
||||||
pub struct TableRowGroupFlow {
|
pub struct TableRowGroupFlow {
|
||||||
|
@ -234,10 +235,14 @@ impl Flow for TableRowGroupFlow {
|
||||||
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
||||||
self.block_flow.mutate_fragments(mutator)
|
self.block_flow.mutate_fragments(mutator)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn print_extra_flow_children(&self, print_tree: &mut PrintTree) {
|
||||||
|
self.block_flow.print_extra_flow_children(print_tree);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for TableRowGroupFlow {
|
impl fmt::Debug for TableRowGroupFlow {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "TableRowGroupFlow: {:?}", self.block_flow.fragment)
|
write!(f, "TableRowGroupFlow: {:?}", self.block_flow)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ use style::values::computed::LengthOrPercentageOrAuto;
|
||||||
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize};
|
use table::{ColumnComputedInlineSize, ColumnIntrinsicInlineSize};
|
||||||
use table_row;
|
use table_row;
|
||||||
use util::logical_geometry::LogicalSize;
|
use util::logical_geometry::LogicalSize;
|
||||||
|
use util::print_tree::PrintTree;
|
||||||
|
|
||||||
#[derive(Copy, Clone, RustcEncodable, Debug)]
|
#[derive(Copy, Clone, RustcEncodable, Debug)]
|
||||||
pub enum TableLayout {
|
pub enum TableLayout {
|
||||||
|
@ -462,14 +463,18 @@ impl Flow for TableWrapperFlow {
|
||||||
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
fn mutate_fragments(&mut self, mutator: &mut FnMut(&mut Fragment)) {
|
||||||
self.block_flow.mutate_fragments(mutator)
|
self.block_flow.mutate_fragments(mutator)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn print_extra_flow_children(&self, print_tree: &mut PrintTree) {
|
||||||
|
self.block_flow.print_extra_flow_children(print_tree);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Debug for TableWrapperFlow {
|
impl fmt::Debug for TableWrapperFlow {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
if self.block_flow.base.flags.is_float() {
|
if self.block_flow.base.flags.is_float() {
|
||||||
write!(f, "TableWrapperFlow(Float): {:?}", self.block_flow.fragment)
|
write!(f, "TableWrapperFlow(Float): {:?}", self.block_flow)
|
||||||
} else {
|
} else {
|
||||||
write!(f, "TableWrapperFlow: {:?}", self.block_flow.fragment)
|
write!(f, "TableWrapperFlow: {:?}", self.block_flow)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,7 +175,7 @@ impl Debug for DebugWritingMode {
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
|
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
|
||||||
self.mode.fmt(formatter)
|
write!(formatter, "{}", self.mode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -502,9 +502,14 @@ pub struct LogicalMargin<T> {
|
||||||
|
|
||||||
impl<T: Debug> Debug for LogicalMargin<T> {
|
impl<T: Debug> Debug for LogicalMargin<T> {
|
||||||
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
|
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
|
||||||
write!(formatter,
|
let writing_mode_string = if cfg!(debug_assertions) {
|
||||||
"LogicalMargin({:?}, inline: {:?}..{:?} block: {:?}..{:?})",
|
format!("{:?}, ", self.debug_writing_mode)
|
||||||
self.debug_writing_mode,
|
} else {
|
||||||
|
"".to_owned()
|
||||||
|
};
|
||||||
|
|
||||||
|
write!(formatter, "LogicalMargin({}i:{:?}..{:?} b:{:?}..{:?})",
|
||||||
|
writing_mode_string,
|
||||||
self.inline_start,
|
self.inline_start,
|
||||||
self.inline_end,
|
self.inline_end,
|
||||||
self.block_start,
|
self.block_start,
|
||||||
|
@ -788,9 +793,14 @@ pub struct LogicalRect<T> {
|
||||||
|
|
||||||
impl<T: Debug> Debug for LogicalRect<T> {
|
impl<T: Debug> Debug for LogicalRect<T> {
|
||||||
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
|
fn fmt(&self, formatter: &mut Formatter) -> Result<(), Error> {
|
||||||
write!(formatter,
|
let writing_mode_string = if cfg!(debug_assertions) {
|
||||||
"LogicalRect({:?}, i{:?}×b{:?}, @ (i{:?},b{:?}))",
|
format!("{:?}, ", self.debug_writing_mode)
|
||||||
self.debug_writing_mode,
|
} else {
|
||||||
|
"".to_owned()
|
||||||
|
};
|
||||||
|
|
||||||
|
write!(formatter, "LogicalRect({}i{:?}×b{:?}, @ (i{:?},b{:?}))",
|
||||||
|
writing_mode_string,
|
||||||
self.size.inline,
|
self.size.inline,
|
||||||
self.size.block,
|
self.size.block,
|
||||||
self.start.i,
|
self.start.i,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue