Private browsing - Initial steps

This commit is contained in:
dhaval0603 2016-03-23 15:28:49 -04:00 committed by Josh Matthews
parent afa5ae4c72
commit af64a888e6
5 changed files with 36 additions and 0 deletions

View file

@ -123,6 +123,7 @@ impl HTMLIFrameElement {
let window = window.r();
let (new_subpage_id, old_subpage_id) = self.generate_new_subpage_id();
let new_pipeline_id = self.pipeline_id.get().unwrap();
let private_iframe = self.privatebrowsing();
self.containing_page_pipeline_id.set(Some(window.pipeline()));
@ -134,6 +135,7 @@ impl HTMLIFrameElement {
old_subpage_id: old_subpage_id,
new_pipeline_id: new_pipeline_id,
sandbox: sandboxed,
is_private: private_iframe,
};
chan.send(ConstellationMsg::ScriptLoadedURLInIFrame(load_info)).unwrap();
@ -247,6 +249,17 @@ impl HTMLIFrameElement {
ReflowQueryType::NoQuery,
ReflowReason::IFrameLoadEvent);
}
/// Check whether the iframe has the mozprivatebrowsing attribute set
pub fn privatebrowsing(&self) -> bool {
if self.Mozbrowser() {
let element = self.upcast::<Element>();
element.has_attribute(&Atom::from("mozprivatebrowsing"))
} else {
false
}
}
}
pub trait HTMLIFrameElementLayoutMethods {