mirror of
https://github.com/servo/servo.git
synced 2025-06-25 17:44:33 +01:00
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.
This commit is contained in:
parent
572959c3e6
commit
f41c39b3dd
6 changed files with 43 additions and 12 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue