Replace current session entry for reloads

This commit is contained in:
Connor Brewster 2016-09-02 23:28:20 -05:00
parent 0b0495cff4
commit e9b2f1b916
10 changed files with 89 additions and 57 deletions

View file

@ -100,7 +100,7 @@ impl HTMLIFrameElement {
(old_pipeline_id, new_pipeline_id)
}
pub fn navigate_or_reload_child_browsing_context(&self, load_data: Option<LoadData>) {
pub fn navigate_or_reload_child_browsing_context(&self, load_data: Option<LoadData>, replace: bool) {
let sandboxed = if self.is_sandboxed() {
IFrameSandboxed
} else {
@ -134,6 +134,7 @@ impl HTMLIFrameElement {
sandbox: sandboxed,
is_private: private_iframe,
frame_type: frame_type,
replace: replace,
};
window.constellation_chan()
.send(ConstellationMsg::ScriptLoadedURLInIFrame(load_info))
@ -150,7 +151,7 @@ impl HTMLIFrameElement {
let document = document_from_node(self);
self.navigate_or_reload_child_browsing_context(
Some(LoadData::new(url, document.get_referrer_policy(), Some(document.url().clone()))));
Some(LoadData::new(url, document.get_referrer_policy(), Some(document.url().clone()))), false);
}
#[allow(unsafe_code)]
@ -491,7 +492,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
fn Reload(&self, _hard_reload: bool) -> ErrorResult {
if self.Mozbrowser() {
if self.upcast::<Node>().is_in_doc() {
self.navigate_or_reload_child_browsing_context(None);
self.navigate_or_reload_child_browsing_context(None, true);
}
Ok(())
} else {