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/window.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/window.rs')
-rw-r--r-- | components/script/dom/window.rs | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs index da8d9be0ead..f4efcd8dd76 100644 --- a/components/script/dom/window.rs +++ b/components/script/dom/window.rs @@ -51,7 +51,7 @@ use js::jsval::UndefinedValue; use js::rust::CompileOptionsWrapper; use js::rust::Runtime; use libc; -use msg::constellation_msg::{FrameType, LoadData, PipelineId, SubpageId, WindowSizeType}; +use msg::constellation_msg::{FrameType, LoadData, PipelineId, WindowSizeType}; use net_traits::ResourceThreads; use net_traits::bluetooth_thread::BluetoothMethodMsg; use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread}; @@ -200,16 +200,14 @@ pub struct Window { /// page changes. devtools_wants_updates: Cell<bool>, - next_subpage_id: Cell<SubpageId>, - /// Pending resize event, if any. resize_event: Cell<Option<(WindowSizeData, WindowSizeType)>>, /// Pipeline id associated with this page. id: PipelineId, - /// Subpage id associated with this page, if any. - parent_info: Option<(PipelineId, SubpageId, FrameType)>, + /// Parent id associated with this page, if any. + parent_info: Option<(PipelineId, FrameType)>, /// Global static data related to the DOM. dom_static: GlobalStaticData, @@ -335,11 +333,7 @@ impl Window { self.id } - pub fn subpage(&self) -> Option<SubpageId> { - self.parent_info.map(|p| p.1) - } - - pub fn parent_info(&self) -> Option<(PipelineId, SubpageId, FrameType)> { + pub fn parent_info(&self) -> Option<(PipelineId, FrameType)> { self.parent_info } @@ -1492,13 +1486,6 @@ impl Window { WindowProxyHandler(self.dom_static.windowproxy_handler.0) } - pub fn get_next_subpage_id(&self) -> SubpageId { - let subpage_id = self.next_subpage_id.get(); - let SubpageId(id_num) = subpage_id; - self.next_subpage_id.set(SubpageId(id_num + 1)); - subpage_id - } - pub fn get_pending_reflow_count(&self) -> u32 { self.pending_reflow_count.get() } @@ -1612,7 +1599,7 @@ impl Window { // https://html.spec.whatwg.org/multipage/#top-level-browsing-context pub fn is_top_level(&self) -> bool { match self.parent_info { - Some((_, _, FrameType::IFrame)) => false, + Some((_, FrameType::IFrame)) => false, _ => true, } } @@ -1676,7 +1663,7 @@ impl Window { timer_event_chan: IpcSender<TimerEvent>, layout_chan: Sender<Msg>, id: PipelineId, - parent_info: Option<(PipelineId, SubpageId, FrameType)>, + parent_info: Option<(PipelineId, FrameType)>, window_size: Option<WindowSizeData>) -> Root<Window> { let layout_rpc: Box<LayoutRPC> = { @@ -1726,7 +1713,6 @@ impl Window { page_clip_rect: Cell::new(max_rect()), fragment_name: DOMRefCell::new(None), resize_event: Cell::new(None), - next_subpage_id: Cell::new(SubpageId(0)), layout_chan: layout_chan, layout_rpc: layout_rpc, window_size: Cell::new(window_size), |