aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorAlan Jeffrey <ajeffrey@mozilla.com>2016-11-23 08:32:53 -0600
committerAlan Jeffrey <ajeffrey@mozilla.com>2016-11-23 08:32:53 -0600
commitfb6cefcb78fa4f15ece887800308de997bbfc8f5 (patch)
tree10f0bd19ad83ee721f8da0926aaf71c901d2ebe8 /components/script
parent5946f756d788a5ce9c8f6447b4fa04d57daf9076 (diff)
downloadservo-fb6cefcb78fa4f15ece887800308de997bbfc8f5.tar.gz
servo-fb6cefcb78fa4f15ece887800308de997bbfc8f5.zip
When a script thread looks for a current layout thread, it should look in the incomplete loads.
Diffstat (limited to 'components/script')
-rw-r--r--components/script/script_thread.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 135fccf58c3..b902c6df101 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -1201,10 +1201,14 @@ impl ScriptThread {
});
// Pick a layout thread, any layout thread
- match self.documents.borrow().iter().next() {
+ let current_layout_chan = self.documents.borrow().iter().next()
+ .map(|(_, document)| document.window().layout_chan().clone())
+ .or_else(|| self.incomplete_loads.borrow().first().map(|load| load.layout_chan.clone()));
+
+ match current_layout_chan {
None => panic!("Layout attached to empty script thread."),
// Tell the layout thread factory to actually spawn the thread.
- Some((_, document)) => document.window().layout_chan().send(msg).unwrap(),
+ Some(layout_chan) => layout_chan.send(msg).unwrap(),
};
// Kick off the fetch for the new resource.