Check ElementHasAnimations before trying to get animations rules.

In case of ::before and ::after element, the generated content has no
ElementHasAnimations flag, their parent has the flag.
This commit is contained in:
Hiroyuki Ikezoe 2017-05-24 11:12:09 +09:00
parent 4935d972e5
commit fce7c2d885
3 changed files with 24 additions and 12 deletions

View file

@ -506,6 +506,11 @@ pub trait TElement : Eq + PartialEq + Debug + Hash + Sized + Copy + Clone +
/// Returns true if the element has all the specified selector flags.
fn has_selector_flags(&self, flags: ElementSelectorFlags) -> bool;
/// In Gecko, element has a flag that represents the element may have
/// any type of animations or not to bail out animation stuff early.
/// Whereas Servo doesn't have such flag.
fn may_have_animations(&self) -> bool { false }
/// Creates a task to update various animation state on a given (pseudo-)element.
#[cfg(feature = "gecko")]
fn update_animations(&self,