From c79231f9c619f33f7fea66c08bec7a7c0695dc21 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Wed, 27 Jan 2016 18:17:03 -0500 Subject: [PATCH] Ignore navigation requests from pages that are not active. --- components/compositing/constellation.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/compositing/constellation.rs b/components/compositing/constellation.rs index 829b9ead234..4bf942302f7 100644 --- a/components/compositing/constellation.rs +++ b/components/compositing/constellation.rs @@ -946,6 +946,14 @@ impl Constellation } } + if !self.pipeline_is_in_current_frame(source_id) { + // Disregard this load if the navigating pipeline is not actually + // active. This could be caused by a delayed navigation (eg. from + // a timer) or a race between multiple navigations (such as an + // onclick handler on an anchor element). + return None; + } + self.handle_load_start_msg(&source_id); // Being here means either there are no pending frames, or none of the pending // changes would be overridden by changing the subframe associated with source_id.