mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Add flag that represents the traversal is only for animation-only restyle.
We will set the flag when the root node of the traversal has has-animation-only-dirty-descendants flag or has animation restyle hints. Also we will use this flag to detect whether we need to trigger CSS transitions or not.
This commit is contained in:
parent
499d1c4117
commit
be332fe5a4
4 changed files with 20 additions and 3 deletions
|
@ -372,6 +372,16 @@ pub trait TElement : PartialEq + Debug + Sized + Copy + Clone + ElementExt + Pre
|
|||
|
||||
/// Returns true if the element has a CSS animation.
|
||||
fn has_css_animations(&self, _pseudo: Option<&PseudoElement>) -> bool;
|
||||
|
||||
/// Returns true if the element has animation restyle hints.
|
||||
fn has_animation_restyle_hints(&self) -> bool {
|
||||
let data = match self.borrow_data() {
|
||||
Some(d) => d,
|
||||
None => return false,
|
||||
};
|
||||
return data.get_restyle()
|
||||
.map_or(false, |r| r.hint.has_animation_hint());
|
||||
}
|
||||
}
|
||||
|
||||
/// TNode and TElement aren't Send because we want to be careful and explicit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue