aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmliframeelement.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/htmliframeelement.rs')
-rw-r--r--components/script/dom/htmliframeelement.rs23
1 files changed, 7 insertions, 16 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index beb3134698f..3824d981af1 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -66,7 +66,6 @@ pub struct HTMLIFrameElement {
htmlelement: HTMLElement,
pipeline_id: Cell<Option<PipelineId>>,
subpage_id: Cell<Option<SubpageId>>,
- containing_page_pipeline_id: Cell<Option<PipelineId>>,
sandbox: Cell<Option<u8>>,
load_blocker: DOMRefCell<Option<LoadBlocker>>,
}
@@ -126,8 +125,6 @@ impl HTMLIFrameElement {
let new_pipeline_id = self.pipeline_id.get().unwrap();
let private_iframe = self.privatebrowsing();
- self.containing_page_pipeline_id.set(Some(window.pipeline()));
-
let ConstellationChan(ref chan) = window.constellation_chan();
let load_info = IFrameLoadInfo {
url: url,
@@ -149,7 +146,7 @@ impl HTMLIFrameElement {
pub fn process_the_iframe_attributes(&self) {
let url = match self.get_url() {
Some(url) => url.clone(),
- None => url!("about:blank"),
+ None => Url::parse("about:blank").unwrap(),
};
self.navigate_or_reload_child_browsing_context(Some(url));
@@ -192,7 +189,6 @@ impl HTMLIFrameElement {
htmlelement: HTMLElement::new_inherited(localName, prefix, document),
pipeline_id: Cell::new(None),
subpage_id: Cell::new(None),
- containing_page_pipeline_id: Cell::new(None),
sandbox: Cell::new(None),
load_blocker: DOMRefCell::new(None),
}
@@ -207,11 +203,6 @@ impl HTMLIFrameElement {
}
#[inline]
- pub fn containing_page_pipeline_id(&self) -> Option<PipelineId> {
- self.containing_page_pipeline_id.get()
- }
-
- #[inline]
pub fn pipeline_id(&self) -> Option<PipelineId> {
self.pipeline_id.get()
}
@@ -367,13 +358,13 @@ impl MozBrowserEventDetailBuilder for HTMLIFrameElement {
}
}
-pub fn Navigate(iframe: &HTMLIFrameElement, direction: NavigationDirection) -> Fallible<()> {
+pub fn Navigate(iframe: &HTMLIFrameElement, direction: NavigationDirection) -> ErrorResult {
if iframe.Mozbrowser() {
if iframe.upcast::<Node>().is_in_doc() {
let window = window_from_node(iframe);
let window = window.r();
- let pipeline_info = Some((iframe.containing_page_pipeline_id().unwrap(),
+ let pipeline_info = Some((window.pipeline(),
iframe.subpage_id().unwrap()));
let ConstellationChan(ref chan) = window.constellation_chan();
let msg = ConstellationMsg::Navigate(pipeline_info, direction);
@@ -468,17 +459,17 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
}
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/goBack
- fn GoBack(&self) -> Fallible<()> {
+ fn GoBack(&self) -> ErrorResult {
Navigate(self, NavigationDirection::Back)
}
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/goForward
- fn GoForward(&self) -> Fallible<()> {
+ fn GoForward(&self) -> ErrorResult {
Navigate(self, NavigationDirection::Forward)
}
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/reload
- fn Reload(&self, _hardReload: bool) -> Fallible<()> {
+ fn Reload(&self, _hardReload: bool) -> ErrorResult {
if self.Mozbrowser() {
if self.upcast::<Node>().is_in_doc() {
self.navigate_or_reload_child_browsing_context(None);
@@ -492,7 +483,7 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
}
// https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/stop
- fn Stop(&self) -> Fallible<()> {
+ fn Stop(&self) -> ErrorResult {
Err(Error::NotSupported)
}