Auto merge of #10399 - jdm:pb, r=jdm

Private browsing - Initial steps

Rebase of #10160.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10399)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-04-05 17:41:11 +05:30
commit d1e8b79583
5 changed files with 36 additions and 0 deletions

View file

@ -124,6 +124,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()));
@ -135,6 +136,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();
@ -248,6 +250,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 {