diff options
author | Josh Matthews <josh@joshmatthews.net> | 2018-12-10 18:43:26 -0500 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2018-12-10 18:43:26 -0500 |
commit | b62a1ca66204160f3461503ed8c0b3ffbae573fd (patch) | |
tree | f1e18a7b03d3625df035a2fb9f4c8e44ec6b7102 /components/constellation | |
parent | db786a43994a552acc78f33238efe91edd3da9fb (diff) | |
download | servo-b62a1ca66204160f3461503ed8c0b3ffbae573fd.tar.gz servo-b62a1ca66204160f3461503ed8c0b3ffbae573fd.zip |
Delay setting the constellation's active browser id until the context exists.
Diffstat (limited to 'components/constellation')
-rw-r--r-- | components/constellation/constellation.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/components/constellation/constellation.rs b/components/constellation/constellation.rs index 828db1ce88e..2f921537f2d 100644 --- a/components/constellation/constellation.rs +++ b/components/constellation/constellation.rs @@ -4034,17 +4034,16 @@ where /// Send the current frame tree to compositor fn send_frame_tree(&mut self, top_level_browsing_context_id: TopLevelBrowsingContextId) { - self.active_browser_id = Some(top_level_browsing_context_id); - let browsing_context_id = BrowsingContextId::from(top_level_browsing_context_id); - // 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 - ); + let browsing_context_id = BrowsingContextId::from(top_level_browsing_context_id); if let Some(frame_tree) = self.browsing_context_to_sendable(browsing_context_id) { + debug!( + "Sending frame tree for browsing context {}.", + browsing_context_id + ); + self.active_browser_id = Some(top_level_browsing_context_id); self.compositor_proxy .send(ToCompositorMsg::SetFrameTree(frame_tree)); } |