mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Add support for canceling CSS transitions
This change adds support for canceling CSS transitions when a property is no longer transitionable or when an element becomes styled with display:none. Support for canceling and replacing CSS transitions when the end value changes is still pending. This change also takes advantage of updating the constellation message to fix a bug where transition events could be sent for closed pipelines. Fixes #15079.
This commit is contained in:
parent
99cd30eaad
commit
453b252a65
15 changed files with 351 additions and 153 deletions
|
@ -207,6 +207,9 @@ pub struct LayoutThread {
|
|||
/// The list of animations that have expired since the last style recalculation.
|
||||
expired_animations: ServoArc<RwLock<FxHashMap<OpaqueNode, Vec<Animation>>>>,
|
||||
|
||||
/// The list of animations that have been cancelled during the last style recalculation.
|
||||
cancelled_animations: ServoArc<RwLock<FxHashMap<OpaqueNode, Vec<Animation>>>>,
|
||||
|
||||
/// A counter for epoch messages
|
||||
epoch: Cell<Epoch>,
|
||||
|
||||
|
@ -576,6 +579,7 @@ impl LayoutThread {
|
|||
document_shared_lock: None,
|
||||
running_animations: ServoArc::new(RwLock::new(Default::default())),
|
||||
expired_animations: ServoArc::new(RwLock::new(Default::default())),
|
||||
cancelled_animations: ServoArc::new(RwLock::new(Default::default())),
|
||||
// Epoch starts at 1 because of the initial display list for epoch 0 that we send to WR
|
||||
epoch: Cell::new(Epoch(1)),
|
||||
viewport_size: Size2D::new(Au(0), Au(0)),
|
||||
|
@ -655,6 +659,7 @@ impl LayoutThread {
|
|||
visited_styles_enabled: false,
|
||||
running_animations: self.running_animations.clone(),
|
||||
expired_animations: self.expired_animations.clone(),
|
||||
cancelled_animations: self.cancelled_animations.clone(),
|
||||
registered_speculative_painters: &self.registered_painters,
|
||||
local_context_creation_data: Mutex::new(thread_local_style_context_creation_data),
|
||||
timer: self.timer.clone(),
|
||||
|
@ -1785,6 +1790,7 @@ impl LayoutThread {
|
|||
&self.script_chan,
|
||||
&mut *self.running_animations.write(),
|
||||
&mut *self.expired_animations.write(),
|
||||
&mut *self.cancelled_animations.write(),
|
||||
invalid_nodes,
|
||||
newly_transitioning_nodes,
|
||||
&self.new_animations_receiver,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue