Skip to content

Commit

Permalink
Merge pull request #3336 from glennw/resize-fail
Browse files Browse the repository at this point in the history
Handle AttachLayout before ResizeMsg. Fixes #3333 for yahoo static suite.
  • Loading branch information
metajack committed Sep 15, 2014
2 parents 2f12d56 + 102e06f commit 00150b8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/script/script_task.rs
Expand Up @@ -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");
Expand All @@ -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),
Expand Down

0 comments on commit 00150b8

Please sign in to comment.