mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Check has_new_animation_style along with for_css_rule_changes() in needs_animations_update().
This commit is contained in:
parent
3f2d747689
commit
ae1ccdd456
1 changed files with 8 additions and 3 deletions
|
@ -653,9 +653,14 @@ trait PrivateMatchMethods: TElement {
|
||||||
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();
|
||||||
|
|
||||||
// If the traverse is triggered by CSS rule changes,
|
// If the traverse is triggered by CSS rule changes, we need to
|
||||||
// we need to try to update all CSS animations.
|
// try to update all CSS animations on the element if the element
|
||||||
context.shared.traversal_flags.for_css_rule_changes() ||
|
// has CSS animation style regardless of whether the animation is
|
||||||
|
// running or not.
|
||||||
|
// TODO: We should check which @keyframes changed/added/deleted
|
||||||
|
// and update only animations corresponding to those @keyframes.
|
||||||
|
(context.shared.traversal_flags.for_css_rule_changes() &&
|
||||||
|
has_new_animation_style) ||
|
||||||
!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 &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue