diff --git a/components/compositing/compositor.rs b/components/compositing/compositor.rs index 715c3bc8912..895f08795bc 100644 --- a/components/compositing/compositor.rs +++ b/components/compositing/compositor.rs @@ -15,7 +15,7 @@ use std::cmp; use std::mem; use geom::point::{Point2D, TypedPoint2D}; use geom::rect::{Rect, TypedRect}; -use geom::size::TypedSize2D; +use geom::size::{Size2D, TypedSize2D}; use geom::scale_factor::ScaleFactor; use gfx::color; use gfx::paint_task::Msg as PaintMsg; @@ -450,8 +450,18 @@ impl IOCompositor { return false; } return self.pipeline_details.values().all(|ref details| { - details.paint_state == PaintState::Idle - }); + // If a pipeline exists and has a root layer that has + // zero size, it will never be painted. In this case, + // consider it as idle to avoid hangs in reftests. + if let Some(ref pipeline) = details.pipeline { + if let Some(root_layer) = self.find_pipeline_root_layer(pipeline.id) { + if root_layer.bounds.borrow().size == Size2D::zero() { + return true; + } + } + } + details.paint_state == PaintState::Idle + }); } fn has_paint_msg_tracking(&self) -> bool { diff --git a/tests/ref/basic.list b/tests/ref/basic.list index e568e5e2311..96d9178e7b1 100644 --- a/tests/ref/basic.list +++ b/tests/ref/basic.list @@ -95,6 +95,8 @@ flaky_cpu == append_style_a.html append_style_b.html == iframe/bg_color.html iframe/bg_color_ref.html == iframe/hide_and_show.html iframe/hide_and_show_ref.html +== iframe/hide_layers1.html iframe/hide_layers_ref.html +== iframe/hide_layers2.html iframe/hide_layers_ref.html == iframe/multiple_external.html iframe/multiple_external_ref.html == iframe/overflow.html iframe/overflow_ref.html == iframe/positioning_margin.html iframe/positioning_margin_ref.html @@ -107,9 +109,6 @@ flaky_cpu == append_style_a.html append_style_b.html == iframe/simple_inline_width_height.html iframe/simple_inline_width_height_ref.html == iframe/simple_inline_width_percentage.html iframe/simple_inline_width_percentage_ref.html -# gw: race condition here caused by pipelines never painting when removed from document -#== iframe/hide_layers1.html iframe/hide_layers_ref.html -#== iframe/hide_layers2.html iframe/hide_layers_ref.html != image_rendering_auto_a.html image_rendering_pixelated_a.html == image_rendering_pixelated_a.html image_rendering_pixelated_ref.html == img_block_display_a.html img_block_display_ref.html