Start using on_refresh_driver_tick #5681

Final
This commit is contained in:
Guro Bokum 2015-04-20 22:01:56 +07:00
parent 6d2f70a4fd
commit be2cb665de
19 changed files with 315 additions and 68 deletions

View file

@ -729,6 +729,8 @@ impl ScriptTask {
ConstellationControlMsg::WebDriverCommand(pipeline_id, msg) => {
self.handle_webdriver_msg(pipeline_id, msg);
}
ConstellationControlMsg::TickAllAnimations(pipeline_id) =>
self.handle_tick_all_animations(pipeline_id),
}
}
@ -778,6 +780,8 @@ impl ScriptTask {
devtools::handle_set_timeline_markers(&page, self, marker_types, reply),
DevtoolScriptControlMsg::DropTimelineMarkers(_pipeline_id, marker_types) =>
devtools::handle_drop_timeline_markers(&page, self, marker_types),
DevtoolScriptControlMsg::RequestAnimationFrame(pipeline_id, callback) =>
devtools::handle_request_animation_frame(&page, pipeline_id, callback),
}
}
@ -1018,6 +1022,13 @@ impl ScriptTask {
return false;
}
/// Handles when layout task finishes all animation in one tick
fn handle_tick_all_animations(&self, id: PipelineId) {
let page = get_page(&self.root_page(), id);
let document = page.document().root();
document.r().invoke_animation_callbacks();
}
/// The entry point to document loading. Defines bindings, sets up the window and document
/// objects, parses HTML and CSS, and kicks off initial layout.
fn load(&self, response: LoadResponse, incomplete: InProgressLoad) {