From 4e847c05fb119005a3a26754d12e37388c386b40 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 15 Apr 2015 17:18:10 -0700 Subject: [PATCH] gfx: Fix debug dumping of child stacking contexts. --- components/gfx/display_list/mod.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index b5b935c88d2..c31c7b34464 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -170,7 +170,7 @@ impl DisplayList { let doit = |items: &Vec| { for item in items.iter() { match *item { - DisplayItem::SolidColorClass(ref solid_color) => println!("{:?} SolidColor. {:?}", indentation, solid_color.base.bounds), + DisplayItem::SolidColorClass(ref solid_color) => println!("{} SolidColor. {:?}", indentation, solid_color.base.bounds), DisplayItem::TextClass(ref text) => println!("{:?} Text. {:?}", indentation, text.base.bounds), DisplayItem::ImageClass(ref image) => println!("{:?} Image. {:?}", indentation, image.base.bounds), DisplayItem::BorderClass(ref border) => println!("{:?} Border. {:?}", indentation, border.base.bounds), @@ -184,14 +184,11 @@ impl DisplayList { doit(&(self.all_display_items())); if self.children.len() != 0 { - println!("{} Children stacking contexts list length: {}", indentation, self.children.len()); - for subitem in self.children.iter() { - doit(&subitem.display_list.all_display_items()); - if subitem.display_list.children.len() != 0 { - // Rant: String doesn't have a substr() method that won't overflow if the - // selected range is bigger than the string length. - subitem.display_list.print_items(indentation.clone()+&indentation[0..min_length]); - } + println!("{} Children stacking contexts list length: {}", + indentation, + self.children.len()); + for sublist in self.children.iter() { + sublist.display_list.print_items(indentation.clone()+&indentation[0..min_length]); } } }