Call may_have_animations() for parent element in the case where the target is pseudo element.

In case of pseudo elements ElementHasAnimations is set on the parent element.

updating-animation-on-pseudo-element.html fails without this patch, succeeds
with this patch.
This commit is contained in:
Hiroyuki Ikezoe 2017-07-20 12:29:34 +09:00
parent 7d95fb8e49
commit 48851135e8

View file

@ -1089,6 +1089,16 @@ impl<'le> TElement for GeckoElement<'le> {
#[inline]
fn may_have_animations(&self) -> bool {
if let Some(pseudo) = self.implemented_pseudo_element() {
if !pseudo.is_before_or_after() {
return false;
}
return self.parent_element()
.map_or(false, |p| {
p.as_node()
.get_bool_flag(nsINode_BooleanFlag::ElementHasAnimations)
});
}
self.as_node().get_bool_flag(nsINode_BooleanFlag::ElementHasAnimations)
}