diff options
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/htmlanchorelement.rs | 2 | ||||
-rw-r--r-- | components/script/dom/htmlformelement.rs | 2 | ||||
-rw-r--r-- | components/script/dom/htmliframeelement.rs | 7 | ||||
-rw-r--r-- | components/script/dom/location.rs | 8 | ||||
-rw-r--r-- | components/script/dom/window.rs | 5 |
5 files changed, 13 insertions, 11 deletions
diff --git a/components/script/dom/htmlanchorelement.rs b/components/script/dom/htmlanchorelement.rs index 08e7e01b77a..bd77c0a1eba 100644 --- a/components/script/dom/htmlanchorelement.rs +++ b/components/script/dom/htmlanchorelement.rs @@ -588,5 +588,5 @@ fn follow_hyperlink(subject: &Element, hyperlink_suffix: Option<String>) { debug!("following hyperlink to {}", url); let window = document.window(); - window.load_url(url); + window.load_url(url, false); } diff --git a/components/script/dom/htmlformelement.rs b/components/script/dom/htmlformelement.rs index d6a794621e5..268b04a159f 100644 --- a/components/script/dom/htmlformelement.rs +++ b/components/script/dom/htmlformelement.rs @@ -902,7 +902,7 @@ impl Runnable for PlannedNavigation { fn handler(self: Box<PlannedNavigation>) { if self.generation_id == self.form.root().generation_id.get() { let script_chan = self.script_chan.clone(); - script_chan.send(MainThreadScriptMsg::Navigate(self.pipeline_id, self.load_data)).unwrap(); + script_chan.send(MainThreadScriptMsg::Navigate(self.pipeline_id, self.load_data, false)).unwrap(); } } } diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 3b74d3e6e05..1503ff28e06 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -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 { diff --git a/components/script/dom/location.rs b/components/script/dom/location.rs index 72361193aa3..41783c877bc 100644 --- a/components/script/dom/location.rs +++ b/components/script/dom/location.rs @@ -40,7 +40,7 @@ impl Location { setter: fn(&mut Url, USVString)) { let mut url = self.window.get_url(); setter(&mut url, value); - self.window.load_url(url); + self.window.load_url(url, false); } } @@ -51,13 +51,13 @@ impl LocationMethods for Location { // _entry settings object_. let base_url = self.window.get_url(); if let Ok(url) = base_url.join(&url.0) { - self.window.load_url(url); + self.window.load_url(url, false); } } // https://html.spec.whatwg.org/multipage/#dom-location-reload fn Reload(&self) { - self.window.load_url(self.get_url()); + self.window.load_url(self.get_url(), true); } // https://html.spec.whatwg.org/multipage/#dom-location-hash @@ -106,7 +106,7 @@ impl LocationMethods for Location { // https://html.spec.whatwg.org/multipage/#dom-location-href fn SetHref(&self, value: USVString) { if let Ok(url) = self.window.get_url().join(&value.0) { - self.window.load_url(url); + self.window.load_url(url, false); } } diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index f4efcd8dd76..069dd3fc2d6 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -1410,11 +1410,12 @@ impl Window { } /// Commence a new URL load which will either replace this window or scroll to a fragment. - pub fn load_url(&self, url: Url) { + pub fn load_url(&self, url: Url, replace: bool) { let doc = self.Document(); self.main_thread_script_chan().send( MainThreadScriptMsg::Navigate(self.id, - LoadData::new(url, doc.get_referrer_policy(), Some(doc.url().clone())))).unwrap(); + LoadData::new(url, doc.get_referrer_policy(), Some(doc.url().clone())), + replace)).unwrap(); } pub fn handle_fire_timer(&self, timer_id: TimerEventId) { |