diff options
author | Aneesh Agrawal <aneeshusa@gmail.com> | 2016-06-09 08:17:30 -0400 |
---|---|---|
committer | Aneesh Agrawal <aneeshusa@gmail.com> | 2016-09-13 15:37:38 -0400 |
commit | 56fbfd46a4e1e31bf9cde59cffdffbb1b05f97bf (patch) | |
tree | fdfd2b2e51d840b451ef01a65a4398e1030bb596 /components/script/dom/document.rs | |
parent | b9b25b6f82d838c7bb6f87b71d7726f7a58847d9 (diff) | |
download | servo-56fbfd46a4e1e31bf9cde59cffdffbb1b05f97bf.tar.gz servo-56fbfd46a4e1e31bf9cde59cffdffbb1b05f97bf.zip |
Excise SubpageId and use only PipelineIds
SubpageId was originally introduced in 2013 to help iframes keep track of
their associated (children) pipelines. However, since each pipeline
already has a PipelineId, and those are unique, those are sufficient
to keep track of children.
Diffstat (limited to 'components/script/dom/document.rs')
-rw-r--r-- | components/script/dom/document.rs | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/components/script/dom/document.rs b/components/script/dom/document.rs index a43194783a0..3436a4aaa0b 100644 --- a/components/script/dom/document.rs +++ b/components/script/dom/document.rs @@ -94,7 +94,7 @@ use js::jsapi::{JSContext, JSObject, JSRuntime}; use js::jsapi::JS_GetRuntime; use msg::constellation_msg::{ALT, CONTROL, SHIFT, SUPER}; use msg::constellation_msg::{Key, KeyModifiers, KeyState}; -use msg::constellation_msg::{PipelineId, ReferrerPolicy, SubpageId}; +use msg::constellation_msg::{PipelineId, ReferrerPolicy}; use net_traits::{AsyncResponseTarget, IpcSend, PendingAsyncLoad}; use net_traits::CookieSource::NonHTTP; use net_traits::CoreResourceMsg::{GetCookiesForUrl, SetCookiesForUrl}; @@ -1342,9 +1342,9 @@ impl Document { pub fn trigger_mozbrowser_event(&self, event: MozBrowserEvent) { if PREFS.is_mozbrowser_enabled() { - if let Some((parent_pipeline_id, subpage_id, _)) = self.window.parent_info() { + if let Some((parent_pipeline_id, _)) = self.window.parent_info() { let event = ConstellationMsg::MozBrowserEvent(parent_pipeline_id, - Some(subpage_id), + Some(self.window.pipeline_id()), event); self.window.constellation_chan().send(event).unwrap(); } @@ -1581,15 +1581,7 @@ impl Document { } /// Find an iframe element in the document. - pub fn find_iframe(&self, subpage_id: SubpageId) -> Option<Root<HTMLIFrameElement>> { - self.upcast::<Node>() - .traverse_preorder() - .filter_map(Root::downcast::<HTMLIFrameElement>) - .find(|node| node.subpage_id() == Some(subpage_id)) - } - - /// Find an iframe element in the document. - pub fn find_iframe_by_pipeline(&self, pipeline: PipelineId) -> Option<Root<HTMLIFrameElement>> { + pub fn find_iframe(&self, pipeline: PipelineId) -> Option<Root<HTMLIFrameElement>> { self.upcast::<Node>() .traverse_preorder() .filter_map(Root::downcast::<HTMLIFrameElement>) |