aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmliframeelement.rs
diff options
context:
space:
mode:
authorPaul Rouget <me@paulrouget.com>2015-12-08 04:39:37 +0100
committerPaul Rouget <me@paulrouget.com>2015-12-08 04:40:16 +0100
commit2a86f9d165f2c6482fcbe093f3029f09ae2b1232 (patch)
treecbb325526db7f5a6dbdd058582075e60b9198743 /components/script/dom/htmliframeelement.rs
parent9cccd34bc487f485c69dae71c5cd07ac8fabed4d (diff)
downloadservo-2a86f9d165f2c6482fcbe093f3029f09ae2b1232.tar.gz
servo-2a86f9d165f2c6482fcbe093f3029f09ae2b1232.zip
Browser API: implement iframe.reload()
Diffstat (limited to 'components/script/dom/htmliframeelement.rs')
-rw-r--r--components/script/dom/htmliframeelement.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index 3798ab4f539..e7816399619 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -90,7 +90,7 @@ impl HTMLIFrameElement {
(subpage_id, old_subpage_id)
}
- pub fn navigate_child_browsing_context(&self, url: Url) {
+ pub fn navigate_or_reload_child_browsing_context(&self, url: Option<Url>) {
let sandboxed = if self.is_sandboxed() {
IFrameSandboxed
} else {
@@ -127,7 +127,7 @@ impl HTMLIFrameElement {
None => url!("about:blank"),
};
- self.navigate_child_browsing_context(url);
+ self.navigate_or_reload_child_browsing_context(Some(url));
}
#[allow(unsafe_code)]
@@ -399,7 +399,12 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/reload
fn Reload(&self, _hardReload: bool) -> Fallible<()> {
- Err(Error::NotSupported)
+ if mozbrowser_enabled() {
+ if self.upcast::<Node>().is_in_doc() {
+ self.navigate_or_reload_child_browsing_context(None);
+ }
+ }
+ Ok(())
}
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/stop