diff options
author | bors-servo <metajack+bors@gmail.com> | 2015-03-16 17:54:50 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2015-03-16 17:54:50 -0600 |
commit | 1092ca10192c79b4b96c25985a2c6245d369090b (patch) | |
tree | d760bf3ad5309c910b9f4e0f5518403a2fbf2e8b /components/script/dom/htmliframeelement.rs | |
parent | 0888a3a16d4f5eafe4f8008ec060764645f3bee5 (diff) | |
parent | 939a89568e9506c2c6ffbd1f49e3acda6acdf370 (diff) | |
download | servo-1092ca10192c79b4b96c25985a2c6245d369090b.tar.gz servo-1092ca10192c79b4b96c25985a2c6245d369090b.zip |
auto merge of #5205 : glennw/servo/iframe-nav, r=jdm
The history is now recorded per frame, but needs to be exposed in a followup PR.
Diffstat (limited to 'components/script/dom/htmliframeelement.rs')
-rw-r--r-- | components/script/dom/htmliframeelement.rs | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index 1bd9071be01..61ce736bb7e 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -63,6 +63,7 @@ pub trait HTMLIFrameElementHelpers { /// http://www.whatwg.org/html/#process-the-iframe-attributes fn process_the_iframe_attributes(self); fn generate_new_subpage_id(self) -> (SubpageId, Option<SubpageId>); + fn navigate_child_browsing_context(self, url: Url); } impl<'a> HTMLIFrameElementHelpers for JSRef<'a, HTMLIFrameElement> { @@ -92,12 +93,7 @@ impl<'a> HTMLIFrameElementHelpers for JSRef<'a, HTMLIFrameElement> { (subpage_id, old_subpage_id) } - fn process_the_iframe_attributes(self) { - let url = match self.get_url() { - Some(url) => url.clone(), - None => Url::parse("about:blank").unwrap(), - }; - + fn navigate_child_browsing_context(self, url: Url) { let sandboxed = if self.is_sandboxed() { IFrameSandboxed } else { @@ -111,11 +107,20 @@ impl<'a> HTMLIFrameElementHelpers for JSRef<'a, HTMLIFrameElement> { self.containing_page_pipeline_id.set(Some(window.pipeline())); let ConstellationChan(ref chan) = window.constellation_chan(); - chan.send(ConstellationMsg::ScriptLoadedURLInIFrame(url, - window.pipeline(), - new_subpage_id, - old_subpage_id, - sandboxed)).unwrap(); + chan.send(ConstellationMsg::ScriptLoadedURLInIFrame(url, + window.pipeline(), + new_subpage_id, + old_subpage_id, + sandboxed)).unwrap(); + } + + fn process_the_iframe_attributes(self) { + let url = match self.get_url() { + Some(url) => url.clone(), + None => Url::parse("about:blank").unwrap(), + }; + + self.navigate_child_browsing_context(url); } } |