Implements a DisplayList dumper.

This patch will iterate through the DisplayList after the reflow
is done and print its elements (as also any sub-lists associated
to a child node stacking context).

It adds a new CLI parameter to trigger the function to dump the display list
to console (i.e. servo --debug dump-display-list url).

Using both display list and flow tree information is helpful to debug
rendering issues.
This commit is contained in:
Adenilson Cavalcanti 2015-02-24 17:51:23 -08:00
parent efb7f5cd91
commit b9e9d7471d
3 changed files with 59 additions and 0 deletions

View file

@ -709,6 +709,12 @@ impl LayoutTask {
color,
ScrollPolicy::Scrollable));
let origin = Rect(Point2D(Au(0), Au(0)), root_size);
if opts::get().dump_display_list {
println!("#### start printing display list.");
display_list.print_items(String::from_str("#"));
}
let stacking_context = Arc::new(StackingContext::new(display_list,
&origin,
&origin,