mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
style: Allow pausing and unpausing animations.
There's a bit of flickering when unpausing where the node has the original state, but I'm not totally sure where it comes from, posibly from PropertyAnimation returning None due to no styles changing?
This commit is contained in:
parent
2b2e58a868
commit
8527762b83
5 changed files with 159 additions and 71 deletions
|
@ -1290,7 +1290,7 @@ impl LayoutThread {
|
|||
self.tick_animations(&mut rw_data);
|
||||
}
|
||||
|
||||
pub fn tick_animations(&mut self, rw_data: &mut LayoutThreadData) {
|
||||
fn tick_animations(&mut self, rw_data: &mut LayoutThreadData) {
|
||||
let reflow_info = Reflow {
|
||||
goal: ReflowGoal::ForDisplay,
|
||||
page_clip_rect: MAX_RECT,
|
||||
|
@ -1302,14 +1302,14 @@ impl LayoutThread {
|
|||
|
||||
if let Some(mut root_flow) = self.root_flow.clone() {
|
||||
// Perform an abbreviated style recalc that operates without access to the DOM.
|
||||
let mut animations = self.running_animations.write().unwrap();
|
||||
let animations = self.running_animations.read().unwrap();
|
||||
profile(time::ProfilerCategory::LayoutStyleRecalc,
|
||||
self.profiler_metadata(),
|
||||
self.time_profiler_chan.clone(),
|
||||
|| {
|
||||
animation::recalc_style_for_animations(&layout_context,
|
||||
flow_ref::deref_mut(&mut root_flow),
|
||||
&mut animations)
|
||||
&animations)
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue