mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Introduce UpdateAnimationTasks to perform a bunch of animation's tasks in a SequentialTask.
The UpdateAnimationsTasks is a bitflags and each bit is generated from Gecko's UpdateAnimationsTasks (enum class) values for matching values between C++ and Rust. For this reason, the bitflags is annotated as (feature = "gecko"), as a result update_animations() which uses this bitflags also became gecko-only function.
This commit is contained in:
parent
0c843d4b7d
commit
4183b0dff2
9 changed files with 82 additions and 21 deletions
|
@ -15,6 +15,7 @@
|
|||
//! the separation between the style system implementation and everything else.
|
||||
|
||||
use atomic_refcell::AtomicRefCell;
|
||||
use context::UpdateAnimationsTasks;
|
||||
use data::ElementData;
|
||||
use dom::{AnimationRules, LayoutIterator, NodeInfo, TElement, TNode, UnsafeNode};
|
||||
use dom::{OpaqueNode, PresentationalHintsSynthetizer};
|
||||
|
@ -555,7 +556,8 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
(self.flags() & node_flags) == node_flags
|
||||
}
|
||||
|
||||
fn update_animations(&self, pseudo: Option<&PseudoElement>) {
|
||||
fn update_animations(&self, pseudo: Option<&PseudoElement>,
|
||||
tasks: UpdateAnimationsTasks) {
|
||||
// We have to update animations even if the element has no computed style
|
||||
// since it means the element is in a display:none subtree, we should destroy
|
||||
// all CSS animations in display:none subtree.
|
||||
|
@ -584,7 +586,8 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
unsafe {
|
||||
Gecko_UpdateAnimations(self.0, atom_ptr,
|
||||
computed_values_opt,
|
||||
parent_values_opt);
|
||||
parent_values_opt,
|
||||
tasks.bits());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue