Bug 1350754 - Add an FFI to check that a given (pseudo-) element has any type of animations or not. r=birtles,heycam

If an element has any type of animations in match_elements(), we need to call
UpdateEffectProperties() to update KeyframeEffectReadOnly::mProperties.

MozReview-Commit-ID: 1CDhwoM2llE

--HG--
extra : rebase_source : f2c476d579019079702b01fec375f75b4594dee9
This commit is contained in:
Hiroyuki Ikezoe 2017-03-27 19:42:59 +09:00
Родитель 3161326ebd
Коммит ea9ccbbab2
2 изменённых файлов: 18 добавлений и 0 удалений

Просмотреть файл

@ -36,6 +36,7 @@
#include "nsTArray.h"
#include "mozilla/EffectCompositor.h"
#include "mozilla/EffectSet.h"
#include "mozilla/EventStates.h"
#include "mozilla/Keyframe.h"
#include "mozilla/ServoElementSnapshot.h"
@ -458,6 +459,21 @@ Gecko_UpdateAnimations(RawGeckoElementBorrowed aElement,
}
}
bool
Gecko_ElementHasAnimations(RawGeckoElementBorrowed aElement,
nsIAtom* aPseudoTagOrNull)
{
MOZ_ASSERT(!aPseudoTagOrNull ||
aPseudoTagOrNull == nsCSSPseudoElements::before ||
aPseudoTagOrNull == nsCSSPseudoElements::after);
CSSPseudoElementType pseudoType =
nsCSSPseudoElements::GetPseudoType(aPseudoTagOrNull,
CSSEnabledState::eForAllContent);
return !!EffectSet::GetEffectSet(aElement, pseudoType);
}
bool
Gecko_ElementHasCSSAnimations(RawGeckoElementBorrowed aElement,
nsIAtom* aPseudoTagOrNull)

Просмотреть файл

@ -202,6 +202,8 @@ void Gecko_UpdateAnimations(RawGeckoElementBorrowed aElement,
nsIAtom* aPseudoTagOrNull,
ServoComputedValuesBorrowedOrNull aComputedValues,
ServoComputedValuesBorrowedOrNull aParentComputedValues);
bool Gecko_ElementHasAnimations(RawGeckoElementBorrowed aElement,
nsIAtom* aPseudoTagOrNull);
bool Gecko_ElementHasCSSAnimations(RawGeckoElementBorrowed aElement,
nsIAtom* aPseudoTagOrNull);