diff options
author | dhaval0603 <dhaval0603@gmail.com> | 2016-03-23 15:28:49 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2016-04-04 15:22:38 -0400 |
commit | af64a888e6e1f1b1aacf03dc44cec773f9e2c05d (patch) | |
tree | 7f6962445786bbcc73bbf80d0645e292d8f5d31b /components/script/dom/htmliframeelement.rs | |
parent | afa5ae4c72563eb8d3d25fdacb8cb2825517da46 (diff) | |
download | servo-af64a888e6e1f1b1aacf03dc44cec773f9e2c05d.tar.gz servo-af64a888e6e1f1b1aacf03dc44cec773f9e2c05d.zip |
Private browsing - Initial steps
Diffstat (limited to 'components/script/dom/htmliframeelement.rs')
-rw-r--r-- | components/script/dom/htmliframeelement.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index a4ccafd2d4c..84db4ddf39f 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -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 { |