diff options
Diffstat (limited to 'components/script')
-rw-r--r-- | components/script/script_task.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/components/script/script_task.rs b/components/script/script_task.rs index e743b9a098e..88e2f42415a 100644 --- a/components/script/script_task.rs +++ b/components/script/script_task.rs @@ -419,6 +419,12 @@ impl ScriptTask { loop { match event { + // This has to be handled before the ResizeMsg below, + // otherwise the page may not have been added to the + // child list yet, causing the find() to fail. + FromConstellation(AttachLayoutMsg(new_layout_info)) => { + self.handle_new_layout(new_layout_info); + } FromConstellation(ResizeMsg(id, size)) => { let mut page = self.page.borrow_mut(); let page = page.find(id).expect("resize sent to nonexistent pipeline"); @@ -442,8 +448,7 @@ impl ScriptTask { for msg in sequential.move_iter() { match msg { // TODO(tkuehn) need to handle auxiliary layouts for iframes - FromConstellation(AttachLayoutMsg(new_layout_info)) => - self.handle_new_layout(new_layout_info), + FromConstellation(AttachLayoutMsg(_)) => fail!("should have handled AttachLayoutMsg already"), FromConstellation(LoadMsg(id, url)) => self.load(id, url), FromScript(TriggerLoadMsg(id, url)) => self.trigger_load(id, url), FromScript(TriggerFragmentMsg(id, url)) => self.trigger_fragment(id, url), |