Ignore navigation requests from pages that are not active.

This commit is contained in:
Josh Matthews 2016-01-27 18:17:03 -05:00
parent 7eca462c5a
commit c79231f9c6

View file

@ -946,6 +946,14 @@ impl<LTF: LayoutThreadFactory, STF: ScriptThreadFactory> Constellation<LTF, STF>
} }
} }
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); self.handle_load_start_msg(&source_id);
// Being here means either there are no pending frames, or none of the pending // 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. // changes would be overridden by changing the subframe associated with source_id.