mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
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.
This commit is contained in:
parent
b9b25b6f82
commit
56fbfd46a4
12 changed files with 145 additions and 217 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue