Ensures that iframe navigation updates the parent iframe element subpage id.

This fixes the case of clicking a link in an iframe, going back, then clicking the link again.
This commit is contained in:
Glenn Watson 2015-03-24 10:14:49 +10:00
parent 5ce7d8accf
commit 06a79243a7
4 changed files with 40 additions and 0 deletions

View file

@ -608,6 +608,16 @@ impl<LTF: LayoutTaskFactory, STF: ScriptTaskFactory> Constellation<LTF, STF> {
// Set paint permissions correctly for the compositor layers.
self.revoke_paint_permission(prev_pipeline_id);
self.send_frame_tree_and_grant_paint_permission();
// Update the owning iframe to point to the new subpage id.
// This makes things like contentDocument work correctly.
if let Some((parent_pipeline_id, subpage_id)) = pipeline_info {
let ScriptControlChan(ref script_chan) = self.pipeline(parent_pipeline_id).script_chan;
let (_, new_subpage_id) = self.pipeline(next_pipeline_id).parent_info.unwrap();
script_chan.send(ConstellationControlMsg::UpdateSubpageId(parent_pipeline_id,
subpage_id,
new_subpage_id)).unwrap();
}
}
fn handle_key_msg(&self, key: Key, state: KeyState, mods: KeyModifiers) {