aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/layout_task.rs
diff options
context:
space:
mode:
authorAdenilson Cavalcanti <cavalcantii@gmail.com>2015-02-24 17:51:23 -0800
committerAdenilson Cavalcanti <cavalcantii@gmail.com>2015-02-25 19:10:05 -0800
commitb9e9d7471d12079c3c2d7970b21bd56a1460ee78 (patch)
tree75a1a0aa143c557756f551674bfbed3a13d24ee5 /components/layout/layout_task.rs
parentefb7f5cd91210ba5e4cef195298ffec88b0a970b (diff)
downloadservo-b9e9d7471d12079c3c2d7970b21bd56a1460ee78.tar.gz
servo-b9e9d7471d12079c3c2d7970b21bd56a1460ee78.zip
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.
Diffstat (limited to 'components/layout/layout_task.rs')
-rw-r--r--components/layout/layout_task.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs
index 3d2bc463cdc..1b043c3d26b 100644
--- a/components/layout/layout_task.rs
+++ b/components/layout/layout_task.rs
@@ -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,