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

@ -422,11 +422,6 @@ impl<'le> GeckoElement<'le> {
}
}
#[inline]
fn may_have_animations(&self) -> bool {
self.as_node().get_bool_flag(nsINode_BooleanFlag::ElementHasAnimations)
}
#[inline]
fn has_id(&self) -> bool {
self.as_node().get_bool_flag(nsINode_BooleanFlag::ElementHasID)
@ -777,6 +772,11 @@ impl<'le> TElement for GeckoElement<'le> {
(self.flags() & node_flags) == node_flags
}
#[inline]
fn may_have_animations(&self) -> bool {
self.as_node().get_bool_flag(nsINode_BooleanFlag::ElementHasAnimations)
}
fn update_animations(&self,
before_change_style: Option<Arc<ComputedValues>>,
tasks: UpdateAnimationsTasks) {