Fixes a number of race conditions and reliability issues with reftests and compositor.

The basic idea is it's safe to output an image for reftest by testing:
 - That the compositor doesn't have any animations active.
 - That the compositor is not waiting on any outstanding paint messages to arrive.
 - That the script tasks are "idle" and therefore won't cause reflow.
    - This currently means page loaded, onload fired, reftest-wait not active, first reflow triggered.
    - It could easily be expanded to handle pending timers etc.
 - That the "epoch" that the layout tasks have last laid out after script went idle, is reflected by the compositor in all visible layers for that pipeline.
This commit is contained in:
Glenn Watson 2015-05-13 09:58:01 +10:00
parent b3b9deafa7
commit eec3fad93d
17 changed files with 363 additions and 390 deletions

View file

@ -60,6 +60,13 @@ pub trait StylesheetLoadResponder {
fn respond(self: Box<Self>);
}
/// Used to determine if a script has any pending asynchronous activity.
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum ScriptState {
DocumentLoaded,
DocumentLoading,
}
/// Messages sent from the constellation to the script task
pub enum ConstellationControlMsg {
/// Gives a channel and ID to a layout task, as well as the ID of that layout's parent
@ -96,6 +103,8 @@ pub enum ConstellationControlMsg {
TickAllAnimations(PipelineId),
/// Notifies script that a stylesheet has finished loading.
StylesheetLoadComplete(PipelineId, Url, Box<StylesheetLoadResponder+Send>),
/// Get the current state of the script task for a given pipeline.
GetCurrentState(Sender<ScriptState>, PipelineId),
}
/// The mouse button involved in the event.