diff options
author | Lars Bergstrom <lars@lars.com> | 2014-01-30 13:03:58 -0600 |
---|---|---|
committer | Lars Bergstrom <lars@lars.com> | 2014-01-30 13:48:22 -0600 |
commit | f41c39b3ddc1c2012711c7af453fe38089bce37d (patch) | |
tree | 71e44894924d585a3b3848cb3ea30a0611264d97 /src/components/script/script_task.rs | |
parent | 572959c3e6d233f470f7851b470bf3f73f8d4191 (diff) | |
download | servo-f41c39b3ddc1c2012711c7af453fe38089bce37d.tar.gz servo-f41c39b3ddc1c2012711c7af453fe38089bce37d.zip |
Add a LoadComplete message so that script informs the constellation,
which can then inform the compositor (and anyone else, later) about
the completion of loading a page. This is important for ref tests,
which should not emit a PNG until load has completed, even if we
perform a composite before then.
Diffstat (limited to 'src/components/script/script_task.rs')
-rw-r--r-- | src/components/script/script_task.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs index 02ffdc49f75..639f0cc15d9 100644 --- a/src/components/script/script_task.rs +++ b/src/components/script/script_task.rs @@ -38,8 +38,8 @@ use js::rust::{Compartment, Cx}; use js; use servo_msg::compositor_msg::{FinishedLoading, Loading, PerformingLayout, ScriptListener}; use servo_msg::constellation_msg::{ConstellationChan, IFrameSandboxed, IFrameUnsandboxed}; -use servo_msg::constellation_msg::{LoadIframeUrlMsg, LoadUrlMsg, NavigationDirection, PipelineId}; -use servo_msg::constellation_msg::{SubpageId}; +use servo_msg::constellation_msg::{LoadIframeUrlMsg, LoadCompleteMsg, LoadUrlMsg, NavigationDirection}; +use servo_msg::constellation_msg::{PipelineId, SubpageId}; use servo_msg::constellation_msg; use servo_net::image_cache_task::ImageCacheTask; use servo_net::resource_task::ResourceTask; @@ -745,7 +745,7 @@ impl ScriptTask { let fragment = url.fragment.as_ref().map(|ref fragment| fragment.to_owned()); // No more reflow required - page.url = Some((url, false)); + page.url = Some((url.clone(), false)); // Receive the JavaScript scripts. assert!(js_scripts.is_some()); @@ -775,6 +775,8 @@ impl ScriptTask { window.eventtarget.dispatch_event_with_target(wintarget, Some(doctarget), event); page.fragment_node = fragment.map_default(None, |fragid| self.find_fragment_node(page, fragid)); + + self.constellation_chan.send(LoadCompleteMsg(page.id, url)); } fn find_fragment_node(&self, page: &mut Page, fragid: ~str) -> Option<AbstractNode> { |