Use a restyle for animation ticks

This change corrects synchronization issues with animations, by
reworking the animation processing model to do a quick restyle and
incremental layout when ticking animations.

While this change adds overhead to animation ticks, the idea is that
this will be the fallback when synchronous behavior is required to
fulfill specification requirements. In the optimistic case, many
animations could be updated and applied off-the-main-thread and then
resynchronized when style information is queried by script.

Fixes #13865.
This commit is contained in:
Martin Robinson 2020-04-30 15:38:56 +02:00
parent 5e44327325
commit b585ce5b1f
39 changed files with 1285 additions and 1662 deletions

View file

@ -25,7 +25,6 @@ use crate::shared_lock::StylesheetGuards;
use crate::sharing::StyleSharingCache;
use crate::stylist::Stylist;
use crate::thread_state::{self, ThreadState};
use crate::timer::Timer;
use crate::traversal::DomTraversal;
use crate::traversal_flags::TraversalFlags;
use app_units::Au;
@ -156,9 +155,9 @@ pub struct SharedStyleContext<'a> {
/// Guards for pre-acquired locks
pub guards: StylesheetGuards<'a>,
/// The current timer for transitions and animations. This is needed to test
/// them.
pub timer: Timer,
/// The current time for transitions and animations. This is needed to ensure
/// a consistent sampling time and also to adjust the time for testing.
pub current_time_for_animations: f64,
/// Flags controlling how we traverse the tree.
pub traversal_flags: TraversalFlags,