mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +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
|
// the element if the element has animation only dirty
|
||||||
// descendants bit, animation-only restyle hint or recascade.
|
// descendants bit, animation-only restyle hint or recascade.
|
||||||
if traversal_flags.for_animation_only() {
|
if traversal_flags.for_animation_only() {
|
||||||
if el.has_animation_only_dirty_descendants() {
|
// Skip elements that have no style data since animation-only
|
||||||
return true;
|
// restyle is not necessary for the elements.
|
||||||
}
|
|
||||||
|
|
||||||
let data = match el.borrow_data() {
|
let data = match el.borrow_data() {
|
||||||
Some(d) => d,
|
Some(d) => d,
|
||||||
None => return false,
|
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() ||
|
return data.restyle.hint.has_animation_hint() ||
|
||||||
data.restyle.hint.has_recascade_self();
|
data.restyle.hint.has_recascade_self();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue