@@ -44,7 +44,7 @@ use servo_config::opts::{self, Opts};
4444use servo_config:: { prefs, prefs:: PrefValue } ;
4545use servo_url:: ServoUrl ;
4646use std:: borrow:: Cow ;
47- use std:: collections:: { HashMap , HashSet } ;
47+ use std:: collections:: { HashMap , HashSet , VecDeque } ;
4848use std:: rc:: Rc ;
4949use std:: sync:: atomic:: AtomicBool ;
5050use std:: sync:: Arc ;
@@ -117,6 +117,10 @@ pub struct InitialPipelineState {
117117 /// If `None`, this is the root.
118118 pub parent_pipeline_id : Option < PipelineId > ,
119119
120+ /// The ID of all ancestors, if any.
121+ /// If empty, this is the root.
122+ pub ancestors : VecDeque < BrowsingContextId > ,
123+
120124 pub opener : Option < BrowsingContextId > ,
121125
122126 /// A channel to the associated constellation.
@@ -226,6 +230,7 @@ impl Pipeline {
226230 Some ( script_chan) => {
227231 let new_layout_info = NewLayoutInfo {
228232 parent_info : state. parent_pipeline_id ,
233+ ancestors : state. ancestors ,
229234 new_pipeline_id : state. id ,
230235 browsing_context_id : state. browsing_context_id ,
231236 top_level_browsing_context_id : state. top_level_browsing_context_id ,
@@ -275,6 +280,7 @@ impl Pipeline {
275280 browsing_context_id : state. browsing_context_id ,
276281 top_level_browsing_context_id : state. top_level_browsing_context_id ,
277282 parent_pipeline_id : state. parent_pipeline_id ,
283+ ancestors : state. ancestors ,
278284 opener : state. opener ,
279285 script_to_constellation_chan : state. script_to_constellation_chan . clone ( ) ,
280286 namespace_request_sender : state. namespace_request_sender ,
@@ -485,6 +491,7 @@ pub struct UnprivilegedPipelineContent {
485491 top_level_browsing_context_id : TopLevelBrowsingContextId ,
486492 browsing_context_id : BrowsingContextId ,
487493 parent_pipeline_id : Option < PipelineId > ,
494+ ancestors : VecDeque < BrowsingContextId > ,
488495 opener : Option < BrowsingContextId > ,
489496 namespace_request_sender : IpcSender < PipelineNamespaceRequest > ,
490497 script_to_constellation_chan : ScriptToConstellationChan ,
@@ -546,6 +553,7 @@ impl UnprivilegedPipelineContent {
546553 browsing_context_id : self . browsing_context_id ,
547554 top_level_browsing_context_id : self . top_level_browsing_context_id ,
548555 parent_info : self . parent_pipeline_id ,
556+ ancestors : self . ancestors ,
549557 opener : self . opener ,
550558 control_chan : self . script_chan . clone ( ) ,
551559 control_port : self . script_port ,
0 commit comments