From 0e30666d18dcbeeeed95c2df95a070ff2a7803b2 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Thu, 7 Mar 2019 09:28:36 -0500 Subject: [PATCH] Mark pipelines not visible when updating the active pipeline for a browsing context. --- components/constellation/constellation.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 2b6df7d456a..eeb9ffcf78a 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -2655,6 +2655,13 @@ where }, }; + if let Some(old_pipeline) = self.pipelines.get(&old_pipeline_id) { + old_pipeline.notify_visibility(false); + } + if let Some(new_pipeline) = self.pipelines.get(&new_pipeline_id) { + new_pipeline.notify_visibility(true); + } + self.update_activity(old_pipeline_id); self.update_activity(new_pipeline_id); @@ -3373,6 +3380,10 @@ where self.notify_history_changed(change.top_level_browsing_context_id); }, Some(old_pipeline_id) => { + if let Some(pipeline) = self.pipelines.get(&old_pipeline_id) { + pipeline.notify_visibility(false); + } + // https://html.spec.whatwg.org/multipage/#unload-a-document self.unload_document(old_pipeline_id); // Deactivate the old pipeline, and activate the new one.