From 01110420048c6f70cf466945bcb842e8641311b6 Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Fri, 15 May 2020 09:22:26 +0200 Subject: [PATCH] layout_2020: Fix WebRender display list dumping We need to enable display list serialization before building the display list for it to work properly. --- components/layout_thread_2020/lib.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/components/layout_thread_2020/lib.rs b/components/layout_thread_2020/lib.rs index d97c29459ac..66fc5d53183 100644 --- a/components/layout_thread_2020/lib.rs +++ b/components/layout_thread_2020/lib.rs @@ -1302,15 +1302,19 @@ impl LayoutThread { fragment_tree.scrollable_overflow(), ); + // `dump_serialized_display_list` doesn't actually print anything. It sets up + // the display list for printing the serialized version when `finalize()` is called. + // We need to call this before adding any display items so that they are printed + // during `finalize()`. + if self.dump_display_list { + display_list.wr.dump_serialized_display_list(); + } + fragment_tree.build_display_list(&mut display_list); if self.dump_flow_tree { fragment_tree.print(); } - if self.dump_display_list { - display_list.wr.dump_serialized_display_list(); - } - debug!("Layout done!"); let mut epoch = self.epoch.get();