aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Moffitt <jack@metajack.im>2014-09-14 22:54:03 -0600
committerJack Moffitt <jack@metajack.im>2014-09-14 22:54:03 -0600
commit00150b8c712ee2eaac7bc383f3b7e996ac3449fc (patch)
tree903c9ad8bdd18b0ef0e96aa4945ced2ebc0aba32
parent2f12d5628f6a2a6b101c156baf66777b7ca5a4bb (diff)
parent102e06f46b51422612b637714c0afca8a7be9a9e (diff)
downloadservo-00150b8c712ee2eaac7bc383f3b7e996ac3449fc.tar.gz
servo-00150b8c712ee2eaac7bc383f3b7e996ac3449fc.zip
Merge pull request #3336 from glennw/resize-fail
Handle AttachLayout before ResizeMsg. Fixes #3333 for yahoo static suite.
-rw-r--r--components/script/script_task.rs9
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),