From 48851135e89eb08d47dcad62b4386400510e63c0 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Thu, 20 Jul 2017 12:29:34 +0900 Subject: [PATCH] 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. --- components/style/gecko/wrapper.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 9536ed6277a..59f128086ed 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -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) }