aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/script_task.rs
diff options
context:
space:
mode:
authorMs2ger <ms2ger@gmail.com>2014-05-14 17:23:18 +0200
committerMs2ger <ms2ger@gmail.com>2014-05-14 17:23:18 +0200
commit8f63c9e1c8ee776b72b0a906a137b7155773ec50 (patch)
treee0593b8b77de3b01523ae6fff4ff8a2daa71de5a /src/components/script/script_task.rs
parentb77869bd9ab404d17941e17280db0b0a7184ee68 (diff)
downloadservo-8f63c9e1c8ee776b72b0a906a137b7155773ec50.tar.gz
servo-8f63c9e1c8ee776b72b0a906a137b7155773ec50.zip
Store the subpage id in the Page.
Diffstat (limited to 'src/components/script/script_task.rs')
-rw-r--r--src/components/script/script_task.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs
index 470a39822de..82f4ab0bb5f 100644
--- a/src/components/script/script_task.rs
+++ b/src/components/script/script_task.rs
@@ -121,6 +121,9 @@ pub struct Page {
/// Pipeline id associated with this page.
pub id: PipelineId,
+ /// Subpage id associated with this page, if any.
+ pub subpage_id: Option<SubpageId>,
+
/// Unique id for last reflow request; used for confirming completion reply.
pub last_reflow_id: Traceable<Cell<uint>>,
@@ -191,7 +194,8 @@ impl IterablePage for Rc<Page> {
}
impl Page {
- fn new(id: PipelineId, layout_chan: LayoutChan,
+ fn new(id: PipelineId, subpage_id: Option<SubpageId>,
+ layout_chan: LayoutChan,
window_size: Size2D<uint>, resource_task: ResourceTask,
constellation_chan: ConstellationChan,
js_context: Rc<Cx>) -> Page {
@@ -201,6 +205,7 @@ impl Page {
};
Page {
id: id,
+ subpage_id: subpage_id,
frame: Traceable::new(RefCell::new(None)),
layout_chan: Untraceable::new(layout_chan),
layout_join_port: Untraceable::new(RefCell::new(None)),
@@ -607,7 +612,7 @@ impl ScriptTask {
window_size: Size2D<uint>)
-> Rc<ScriptTask> {
let (js_runtime, js_context) = ScriptTask::new_rt_and_cx();
- let page = Page::new(id, layout_chan, window_size,
+ let page = Page::new(id, None, layout_chan, window_size,
resource_task.clone(),
constellation_chan.clone(),
js_context.clone());
@@ -795,7 +800,7 @@ impl ScriptTask {
task's page tree. This is a bug.");
let new_page = {
let window_size = parent_page.window_size.deref().get();
- Page::new(new_pipeline_id, layout_chan, window_size,
+ Page::new(new_pipeline_id, Some(subpage_id), layout_chan, window_size,
parent_page.resource_task.deref().clone(),
self.constellation_chan.clone(),
self.js_context.borrow().get_ref().clone())