Auto merge of #5753 - JIoJIaJIu:timeline, r=jdm

RequestAnimationFrame
[Task](https://github.com/servo/servo/issues/5681)

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/5753)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-05-06 00:50:13 -05:00
commit 5e59e77c41
19 changed files with 315 additions and 68 deletions

View file

@ -727,6 +727,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),
}
}
@ -776,6 +778,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),
}
}
@ -1016,6 +1020,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) {