mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Create a SequentialTask for updating CSS animations in the case where the traversal is triggered by CSS rule changes.
This commit is contained in:
parent
dd29fc1f68
commit
6a72b66e7b
1 changed files with 6 additions and 2 deletions
|
@ -366,6 +366,7 @@ trait PrivateMatchMethods: TElement {
|
||||||
|
|
||||||
#[cfg(feature = "gecko")]
|
#[cfg(feature = "gecko")]
|
||||||
fn needs_animations_update(&self,
|
fn needs_animations_update(&self,
|
||||||
|
context: &mut StyleContext<Self>,
|
||||||
old_values: Option<&Arc<ComputedValues>>,
|
old_values: Option<&Arc<ComputedValues>>,
|
||||||
new_values: &ComputedValues)
|
new_values: &ComputedValues)
|
||||||
-> bool {
|
-> bool {
|
||||||
|
@ -378,7 +379,10 @@ trait PrivateMatchMethods: TElement {
|
||||||
let old_box_style = old.get_box();
|
let old_box_style = old.get_box();
|
||||||
let old_display_style = old_box_style.clone_display();
|
let old_display_style = old_box_style.clone_display();
|
||||||
let new_display_style = new_box_style.clone_display();
|
let new_display_style = new_box_style.clone_display();
|
||||||
// FIXME: Bug 1344581: We still need to compare keyframe rules.
|
|
||||||
|
// If the traverse is triggered by CSS rule changes,
|
||||||
|
// we need to try to update all CSS animations.
|
||||||
|
context.shared.traversal_flags.for_css_rule_changes() ||
|
||||||
!old_box_style.animations_equals(&new_box_style) ||
|
!old_box_style.animations_equals(&new_box_style) ||
|
||||||
(old_display_style == display::T::none &&
|
(old_display_style == display::T::none &&
|
||||||
new_display_style != display::T::none &&
|
new_display_style != display::T::none &&
|
||||||
|
@ -400,7 +404,7 @@ trait PrivateMatchMethods: TElement {
|
||||||
use context::UpdateAnimationsTasks;
|
use context::UpdateAnimationsTasks;
|
||||||
|
|
||||||
let mut tasks = UpdateAnimationsTasks::empty();
|
let mut tasks = UpdateAnimationsTasks::empty();
|
||||||
if self.needs_animations_update(old_values.as_ref(), new_values) {
|
if self.needs_animations_update(context, old_values.as_ref(), new_values) {
|
||||||
tasks.insert(CSS_ANIMATIONS);
|
tasks.insert(CSS_ANIMATIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue