diff options
author | Tim Kuehn <tkuehn@cmu.edu> | 2013-07-30 22:26:00 -0700 |
---|---|---|
committer | Tim Kuehn <tkuehn@cmu.edu> | 2013-07-31 13:12:33 -0700 |
commit | 959ed774b4e58c06422a012d84a3598dc8a0d24e (patch) | |
tree | 05c1e3a94ea1b5ec944531450cf056659bd99efe /src | |
parent | 2348fbf46dbd8a90e3edc0d7a6c6ba704273b3c7 (diff) | |
download | servo-959ed774b4e58c06422a012d84a3598dc8a0d24e.tar.gz servo-959ed774b4e58c06422a012d84a3598dc8a0d24e.zip |
current frame tree is copied upon subframe navigation to prevent changes from being transitively received
Diffstat (limited to 'src')
-rw-r--r-- | src/components/main/constellation.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/components/main/constellation.rs b/src/components/main/constellation.rs index dac5d743198..a0e455acaa0 100644 --- a/src/components/main/constellation.rs +++ b/src/components/main/constellation.rs @@ -409,6 +409,11 @@ impl Constellation { LoadUrlMsg(source_id, url, size_future) => { debug!("received message to load %s", url::to_str(&url)); // Make sure no pending page would be overridden. + let source_frame = self.current_frame().get_ref().find_mut(source_id).expect( + "Constellation: received a LoadUrlMsg from a pipeline_id associated + with a pipeline not in the active frame tree. This should be + impossible."); + for self.pending_frames.iter().advance |frame_change| { let old_id = frame_change.before.expect("Constellation: Received load msg from pipeline, but there is no currently active page. This should @@ -416,7 +421,7 @@ impl Constellation { let changing_frame = self.current_frame().get_ref().find_mut(old_id).expect("Constellation: Pending change has non-active source pipeline. This should be impossible."); - if changing_frame.contains(source_id) { + if changing_frame.contains(source_id) || source_frame.contains(old_id) { // id that sent load msg is being changed already; abort return true; } @@ -424,10 +429,6 @@ impl Constellation { // Being here means either there are no pending frames, or none of the pending // changes would be overriden by changing the subframe associated with source_id. - let source_frame = self.current_frame().get_ref().find_mut(source_id).expect( - "Constellation: received a LoadUrlMsg from a pipeline_id associated - with a pipeline not in the active frame tree. This should be - impossible."); let parent = source_frame.parent.clone(); let subpage_id = source_frame.pipeline.subpage_id.clone(); let next_pipeline_id = self.get_next_pipeline_id(); @@ -531,7 +532,7 @@ impl Constellation { // Create the next frame tree that will be given to the compositor let next_frame_tree = match to_add.parent { None => to_add, // to_add is the root - Some(_parent) => self.current_frame().get(), + Some(_parent) => self.current_frame().get_ref().clone(), }; // If there are frames to revoke permission from, do so now. |