servo: Merge #17248 - Fix parent climb hierarchy in send_frame_tree (from cbrewster:fix_the_chrome); r=asajeffrey
authorConnor Brewster <connor.brewster@eagles.oc.edu>
Thu, 08 Jun 2017 18:25:20 -0700
changeset 413591 b8bf64f573f883dbcde9df5417aa61630dcb261e
parent 413590 5b72abe64ab7aecb4d41dd8438cdc4ad16b6ca4c
child 413592 aa3ad194df6cd7531ebdf5327af3b66ab9ae6027
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasajeffrey
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #17248 - Fix parent climb hierarchy in send_frame_tree (from cbrewster:fix_the_chrome); r=asajeffrey <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #17246 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 1fe70437cb182cb734b4bbd1e7c86b38a4557a17
servo/components/constellation/constellation.rs
--- a/servo/components/constellation/constellation.rs
+++ b/servo/components/constellation/constellation.rs
@@ -781,16 +781,17 @@ impl<Message, LTF, STF> Constellation<Me
     }
 
     /// Create a new browsing context and update the internal bookkeeping.
     fn new_browsing_context(&mut self,
                  browsing_context_id: BrowsingContextId,
                  top_level_id: TopLevelBrowsingContextId,
                  pipeline_id: PipelineId,
                  load_data: LoadData) {
+        debug!("Creating new browsing context {}", browsing_context_id);
         let browsing_context = BrowsingContext::new(browsing_context_id, top_level_id, pipeline_id, load_data);
         self.browsing_contexts.insert(browsing_context_id, browsing_context);
 
         // If a child browsing_context, add it to the parent pipeline.
         let parent_info = self.pipelines.get(&pipeline_id)
             .and_then(|pipeline| pipeline.parent_info);
         if let Some((parent_id, _)) = parent_info {
             if let Some(parent) = self.pipelines.get_mut(&parent_id) {
@@ -2852,21 +2853,21 @@ impl<Message, LTF, STF> Constellation<Me
         let mut browsing_context_id = BrowsingContextId::from(top_level_browsing_context_id);
         let mut pipeline_id = match self.browsing_contexts.get(&browsing_context_id) {
             Some(browsing_context) => browsing_context.pipeline_id,
             None => return warn!("Sending frame tree for discarded browsing context {}.", browsing_context_id),
         };
 
         while let Some(pipeline) = self.pipelines.get(&pipeline_id) {
             match pipeline.parent_info {
-                Some((parent_id, _)) => {
+                Some((parent_id, _)) => pipeline_id = parent_id,
+                None => {
                     browsing_context_id = pipeline.browsing_context_id;
-                    pipeline_id = parent_id;
+                    break;
                 },
-                None => break,
             }
         }
 
         // Note that this function can panic, due to ipc-channel creation failure.
         // avoiding this panic would require a mechanism for dealing
         // with low-resource scenarios.
         debug!("Sending frame tree for browsing context {}.", browsing_context_id);
         if let Some(frame_tree) = self.browsing_context_to_sendable(browsing_context_id) {