@@ -38,7 +38,7 @@ use dom::window::{ReflowReason, Window};
3838use ipc_channel:: ipc;
3939use js:: jsapi:: { JSAutoCompartment , JSContext , MutableHandleValue } ;
4040use js:: jsval:: { NullValue , UndefinedValue } ;
41- use msg:: constellation_msg:: { FrameType , LoadData , PipelineId , SubpageId , TraversalDirection } ;
41+ use msg:: constellation_msg:: { FrameType , LoadData , PipelineId , TraversalDirection } ;
4242use net_traits:: response:: HttpsState ;
4343use script_layout_interface:: message:: ReflowQueryType ;
4444use script_traits:: { IFrameLoadInfo , MozBrowserEvent , ScriptMsg as ConstellationMsg } ;
@@ -68,7 +68,6 @@ bitflags! {
6868pub struct HTMLIFrameElement {
6969 htmlelement : HTMLElement ,
7070 pipeline_id : Cell < Option < PipelineId > > ,
71- subpage_id : Cell < Option < SubpageId > > ,
7271 sandbox : MutNullableHeap < JS < DOMTokenList > > ,
7372 sandbox_allowance : Cell < Option < SandboxAllowance > > ,
7473 load_blocker : DOMRefCell < Option < LoadBlocker > > ,
@@ -94,14 +93,11 @@ impl HTMLIFrameElement {
9493 } ) . unwrap_or_else ( || Url :: parse ( "about:blank" ) . unwrap ( ) )
9594 }
9695
97- pub fn generate_new_subpage_id ( & self ) -> ( SubpageId , Option < SubpageId > ) {
98- self . pipeline_id . set ( Some ( PipelineId :: new ( ) ) ) ;
99-
100- let old_subpage_id = self . subpage_id . get ( ) ;
101- let win = window_from_node ( self ) ;
102- let subpage_id = win. get_next_subpage_id ( ) ;
103- self . subpage_id . set ( Some ( subpage_id) ) ;
104- ( subpage_id, old_subpage_id)
96+ pub fn generate_new_pipeline_id ( & self ) -> ( Option < PipelineId > , PipelineId ) {
97+ let old_pipeline_id = self . pipeline_id . get ( ) ;
98+ let new_pipeline_id = PipelineId :: new ( ) ;
99+ self . pipeline_id . set ( Some ( new_pipeline_id) ) ;
100+ ( old_pipeline_id, new_pipeline_id)
105101 }
106102
107103 pub fn navigate_or_reload_child_browsing_context ( & self , load_data : Option < LoadData > ) {
@@ -126,16 +122,14 @@ impl HTMLIFrameElement {
126122 }
127123
128124 let window = window_from_node ( self ) ;
129- let ( new_subpage_id, old_subpage_id) = self . generate_new_subpage_id ( ) ;
130- let new_pipeline_id = self . pipeline_id . get ( ) . unwrap ( ) ;
125+ let ( old_pipeline_id, new_pipeline_id) = self . generate_new_pipeline_id ( ) ;
131126 let private_iframe = self . privatebrowsing ( ) ;
132127 let frame_type = if self . Mozbrowser ( ) { FrameType :: MozBrowserIFrame } else { FrameType :: IFrame } ;
133128
134129 let load_info = IFrameLoadInfo {
135130 load_data : load_data,
136131 parent_pipeline_id : window. pipeline_id ( ) ,
137- new_subpage_id : new_subpage_id,
138- old_subpage_id : old_subpage_id,
132+ old_pipeline_id : old_pipeline_id,
139133 new_pipeline_id : new_pipeline_id,
140134 sandbox : sandboxed,
141135 is_private : private_iframe,
@@ -170,8 +164,7 @@ impl HTMLIFrameElement {
170164 }
171165 }
172166
173- pub fn update_subpage_id ( & self , new_subpage_id : SubpageId , new_pipeline_id : PipelineId ) {
174- self . subpage_id . set ( Some ( new_subpage_id) ) ;
167+ pub fn update_pipeline_id ( & self , new_pipeline_id : PipelineId ) {
175168 self . pipeline_id . set ( Some ( new_pipeline_id) ) ;
176169
177170 let mut blocker = self . load_blocker . borrow_mut ( ) ;
@@ -186,7 +179,6 @@ impl HTMLIFrameElement {
186179 HTMLIFrameElement {
187180 htmlelement : HTMLElement :: new_inherited ( localName, prefix, document) ,
188181 pipeline_id : Cell :: new ( None ) ,
189- subpage_id : Cell :: new ( None ) ,
190182 sandbox : Default :: default ( ) ,
191183 sandbox_allowance : Cell :: new ( None ) ,
192184 load_blocker : DOMRefCell :: new ( None ) ,
@@ -208,11 +200,6 @@ impl HTMLIFrameElement {
208200 self . pipeline_id . get ( )
209201 }
210202
211- #[ inline]
212- pub fn subpage_id ( & self ) -> Option < SubpageId > {
213- self . subpage_id . get ( )
214- }
215-
216203 pub fn change_visibility_status ( & self , visibility : bool ) {
217204 if self . visibility . get ( ) != visibility {
218205 self . visibility . set ( visibility) ;
@@ -270,11 +257,11 @@ impl HTMLIFrameElement {
270257 }
271258
272259 pub fn get_content_window ( & self ) -> Option < Root < Window > > {
273- self . subpage_id . get ( ) . and_then ( |subpage_id | {
260+ self . pipeline_id . get ( ) . and_then ( |pipeline_id | {
274261 let window = window_from_node ( self ) ;
275262 let window = window. r ( ) ;
276263 let browsing_context = window. browsing_context ( ) ;
277- browsing_context. find_child_by_subpage ( subpage_id )
264+ browsing_context. find_child_by_id ( pipeline_id )
278265 } )
279266 }
280267
@@ -659,12 +646,11 @@ impl VirtualMethods for HTMLIFrameElement {
659646 receiver. recv ( ) . unwrap ( )
660647 }
661648
662- // Resetting the subpage id to None is required here so that
649+ // Resetting the pipeline_id to None is required here so that
663650 // if this iframe is subsequently re-added to the document
664651 // the load doesn't think that it's a navigation, but instead
665652 // a new iframe. Without this, the constellation gets very
666653 // confused.
667- self . subpage_id . set ( None ) ;
668654 self . pipeline_id . set ( None ) ;
669655 }
670656 }
0 commit comments