aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Moffitt <jack@metajack.im>2014-09-15 19:37:29 -0600
committerJack Moffitt <jack@metajack.im>2014-09-15 19:37:29 -0600
commit8a02fe0fc6df5f5812a3de80d417fd6e68502ce3 (patch)
tree6a7cfeb1dc69941ae970aa904d9d9b428227d423
parentd161d0ad47dbfbd5ff6e28d19008e0719f078eff (diff)
parent151cbf07a64be65ac63400880783a15828123b43 (diff)
downloadservo-8a02fe0fc6df5f5812a3de80d417fd6e68502ce3.tar.gz
servo-8a02fe0fc6df5f5812a3de80d417fd6e68502ce3.zip
Merge pull request #3347 from jdm/blankiframe
Make all iframes attached to a document default to about:blank.
-rw-r--r--components/script/dom/htmliframeelement.rs46
1 files changed, 23 insertions, 23 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index 6422e5a8f10..7ca33cf8674 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -82,29 +82,29 @@ impl<'a> HTMLIFrameElementHelpers for JSRef<'a, HTMLIFrameElement> {
}
fn process_the_iframe_attributes(&self) {
- match self.get_url() {
- Some(url) => {
- let sandboxed = if self.is_sandboxed() {
- IFrameSandboxed
- } else {
- IFrameUnsandboxed
- };
-
- // Subpage Id
- let window = window_from_node(self).root();
- let page = window.deref().page();
- let subpage_id = page.get_next_subpage_id();
-
- self.deref().size.deref().set(Some(IFrameSize {
- pipeline_id: page.id,
- subpage_id: subpage_id,
- }));
-
- let ConstellationChan(ref chan) = *page.constellation_chan.deref();
- chan.send(LoadIframeUrlMsg(url, page.id, subpage_id, sandboxed));
- }
- _ => ()
- }
+ let url = match self.get_url() {
+ Some(url) => url.clone(),
+ None => Url::parse("about:blank").unwrap(),
+ };
+
+ let sandboxed = if self.is_sandboxed() {
+ IFrameSandboxed
+ } else {
+ IFrameUnsandboxed
+ };
+
+ // Subpage Id
+ let window = window_from_node(self).root();
+ let page = window.deref().page();
+ let subpage_id = page.get_next_subpage_id();
+
+ self.deref().size.deref().set(Some(IFrameSize {
+ pipeline_id: page.id,
+ subpage_id: subpage_id,
+ }));
+
+ let ConstellationChan(ref chan) = *page.constellation_chan.deref();
+ chan.send(LoadIframeUrlMsg(url, page.id, subpage_id, sandboxed));
}
}