mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Don't traverse elements that have no style data in animation-only restyle.
Animation-only restyle only works with elements that have already been styled.
This commit is contained in:
parent
9b166c5cda
commit
028c0e4a43
1 changed files with 11 additions and 4 deletions
|
@ -326,14 +326,21 @@ pub trait DomTraversal<E: TElement> : Sync {
|
|||
// the element if the element has animation only dirty
|
||||
// descendants bit, animation-only restyle hint or recascade.
|
||||
if traversal_flags.for_animation_only() {
|
||||
if el.has_animation_only_dirty_descendants() {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Skip elements that have no style data since animation-only
|
||||
// restyle is not necessary for the elements.
|
||||
let data = match el.borrow_data() {
|
||||
Some(d) => d,
|
||||
None => return false,
|
||||
};
|
||||
|
||||
if !data.has_styles() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if el.has_animation_only_dirty_descendants() {
|
||||
return true;
|
||||
}
|
||||
|
||||
return data.restyle.hint.has_animation_hint() ||
|
||||
data.restyle.hint.has_recascade_self();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue