Send window size even when there is not top level browsing context yet

This commit is contained in:
Paul Rouget 2018-03-06 16:17:59 +08:00
parent 74249b6322
commit 88bf133d2a
3 changed files with 9 additions and 8 deletions

View file

@ -646,10 +646,9 @@ impl<Window: WindowMethods> IOCompositor<Window> {
device_pixel_ratio: dppx,
initial_viewport: initial_viewport,
};
let top_level_browsing_context_id = match self.root_pipeline {
Some(ref pipeline) => pipeline.top_level_browsing_context_id,
None => return warn!("Window resize without root pipeline."),
};
let top_level_browsing_context_id = self.root_pipeline.as_ref().map(|pipeline| {
pipeline.top_level_browsing_context_id
});
let msg = ConstellationMsg::WindowSize(top_level_browsing_context_id, data, size_type);
if let Err(e) = self.constellation_chan.send(msg) {