Bug 1341372 - Part 2: Add one FFI for TElement::has_css_transitions.
Add one FFI, Gecko_ElementHasCSSTransitions, to check if there is any
transition in CSSTransitionCollection. This will be used to check if we need
to update transition and if we should compute the after-change style.
MozReview-Commit-ID: 7xP4SdxNp7g
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -522,16 +522,34 @@ Gecko_ElementHasCSSAnimations(RawGeckoEl
CSSEnabledState::eForAllContent);
nsAnimationManager::CSSAnimationCollection* collection =
nsAnimationManager::CSSAnimationCollection
::GetAnimationCollection(aElement, pseudoType);
return collection && !collection->mAnimations.IsEmpty();
}
+bool
+Gecko_ElementHasCSSTransitions(RawGeckoElementBorrowed aElement,
+ nsIAtom* aPseudoTagOrNull)
+{
+ MOZ_ASSERT(!aPseudoTagOrNull ||
+ aPseudoTagOrNull == nsCSSPseudoElements::before ||
+ aPseudoTagOrNull == nsCSSPseudoElements::after);
+
+ CSSPseudoElementType pseudoType =
+ nsCSSPseudoElements::GetPseudoType(aPseudoTagOrNull,
+ CSSEnabledState::eForAllContent);
+ nsTransitionManager::CSSTransitionCollection* collection =
+ nsTransitionManager::CSSTransitionCollection
+ ::GetAnimationCollection(aElement, pseudoType);
+
+ return collection && !collection->mAnimations.IsEmpty();
+}
+
double
Gecko_GetProgressFromComputedTiming(RawGeckoComputedTimingBorrowed aComputedTiming)
{
return aComputedTiming->mProgress.Value();
}
double
Gecko_GetPositionInSegment(RawGeckoAnimationPropertySegmentBorrowed aSegment,
--- a/layout/style/ServoBindings.h
+++ b/layout/style/ServoBindings.h
@@ -200,16 +200,18 @@ void Gecko_UpdateAnimations(RawGeckoElem
ServoComputedValuesBorrowedOrNull aOldComputedValues,
ServoComputedValuesBorrowedOrNull aComputedValues,
ServoComputedValuesBorrowedOrNull aParentComputedValues,
mozilla::UpdateAnimationsTasks aTaskBits);
bool Gecko_ElementHasAnimations(RawGeckoElementBorrowed aElement,
nsIAtom* aPseudoTagOrNull);
bool Gecko_ElementHasCSSAnimations(RawGeckoElementBorrowed aElement,
nsIAtom* aPseudoTagOrNull);
+bool Gecko_ElementHasCSSTransitions(RawGeckoElementBorrowed aElement,
+ nsIAtom* aPseudoTagOrNull);
double Gecko_GetProgressFromComputedTiming(RawGeckoComputedTimingBorrowed aComputedTiming);
double Gecko_GetPositionInSegment(
RawGeckoAnimationPropertySegmentBorrowed aSegment,
double aProgress,
mozilla::ComputedTimingFunction::BeforeFlag aBeforeFlag);
// Get servo's AnimationValue for |aProperty| from the cached base style
// |aBaseStyles|.
// |aBaseStyles| is nsRefPtrHashtable<nsUint32HashKey, RawServoAnimationValue>.