Skip update_animations if we have no running animations and the element becomes display:none.

This commit is contained in:
Hiroyuki Ikezoe 2017-03-10 11:25:23 +09:00
parent 9ff99d4608
commit c32ba98031
5 changed files with 22 additions and 4 deletions

View file

@ -29,6 +29,7 @@ use gecko_bindings::bindings::{Gecko_IsLink, Gecko_IsRootElement, Gecko_MatchesE
use gecko_bindings::bindings::{Gecko_IsUnvisitedLink, Gecko_IsVisitedLink, Gecko_Namespace};
use gecko_bindings::bindings::{Gecko_SetNodeFlags, Gecko_UnsetNodeFlags};
use gecko_bindings::bindings::Gecko_ClassOrClassList;
use gecko_bindings::bindings::Gecko_ElementHasCSSAnimations;
use gecko_bindings::bindings::Gecko_GetAnimationRule;
use gecko_bindings::bindings::Gecko_GetHTMLPresentationAttrDeclarationBlock;
use gecko_bindings::bindings::Gecko_GetStyleAttrDeclarationBlock;
@ -526,6 +527,11 @@ impl<'le> TElement for GeckoElement<'le> {
parent_values_opt);
}
}
fn has_css_animations(&self, pseudo: Option<&PseudoElement>) -> bool {
let atom_ptr = PseudoElement::ns_atom_or_null_from_opt(pseudo);
unsafe { Gecko_ElementHasCSSAnimations(self.0, atom_ptr) }
}
}
impl<'le> PartialEq for GeckoElement<'le> {