From 596193f975f9093d0104d095864462b7afaa081b Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Tue, 20 Oct 2015 08:32:17 +1000 Subject: [PATCH] Fix iframes flickering on mouse move. Fixes #7867 (and probably several other iframe bugs). When collecting layers for children of a pipeline, pass through the current subpage pipeline recursively. This prevents descendany layers (such as scroll layers) from being collected and re-created on the subsequent paint. --- components/compositing/compositor_layer.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/components/compositing/compositor_layer.rs b/components/compositing/compositor_layer.rs index 0bcb35bd28d..525135fd208 100644 --- a/components/compositing/compositor_layer.rs +++ b/components/compositing/compositor_layer.rs @@ -449,17 +449,22 @@ impl RcCompositorLayer for Rc> { compositor: &mut IOCompositor, pipeline_id: PipelineId, new_layers: &[LayerProperties], - pipelines_removed: &mut Vec) + pipelines_removed: &mut Vec, + layer_pipeline_id: Option) where Window: WindowMethods { // Traverse children first so that layers are removed // bottom up - allowing each layer being removed to properly // clean up any tiles it owns. for kid in &*layer.children() { + let extra_data = kid.extra_data.borrow(); + let layer_pipeline_id = extra_data.subpage_info.or(layer_pipeline_id); + collect_old_layers_for_pipeline(kid, compositor, pipeline_id, new_layers, - pipelines_removed); + pipelines_removed, + layer_pipeline_id); } // Retain child layers that also exist in the new layer list. @@ -477,7 +482,7 @@ impl RcCompositorLayer for Rc> { } } - if let Some(layer_pipeline_id) = extra_data.subpage_info { + if let Some(layer_pipeline_id) = layer_pipeline_id { for layer_properties in new_layers.iter() { // Keep this layer if a reference to it exists. if let Some(ref subpage_layer_info) = layer_properties.subpage_layer_info { @@ -507,7 +512,8 @@ impl RcCompositorLayer for Rc> { compositor, pipeline_id, new_layers, - pipelines_removed); + pipelines_removed, + None); } }