Bug 1302949 - Skip calling CalculateCumulativeChangeHint
There are a few pieces missing before we can do this with Servo. Since this
only enables an optimization for off-screen animations we should skip this
for now so it doesn't block animations from running.
MozReview-Commit-ID: GecHWQZYxpK
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -291,17 +291,20 @@ KeyframeEffectReadOnly::UpdateProperties
for (AnimationProperty& property : mProperties) {
property.mWinsInCascade =
winningInCascadeProperties.HasProperty(property.mProperty);
property.mIsRunningOnCompositor =
runningOnCompositorProperties.HasProperty(property.mProperty);
}
- CalculateCumulativeChangeHint(aStyleContext);
+ // FIXME (bug 1303235): Do this for Servo too
+ if (aStyleContext->PresContext()->StyleSet()->IsGecko()) {
+ CalculateCumulativeChangeHint(aStyleContext);
+ }
MarkCascadeNeedsUpdate();
RequestRestyle(EffectCompositor::RestyleType::Layer);
}
void
KeyframeEffectReadOnly::ComposeStyle(RefPtr<AnimValuesStyleRule>& aStyleRule,
@@ -1270,16 +1273,23 @@ KeyframeEffectReadOnly::SetAnimation(Ani
bool
KeyframeEffectReadOnly::CanIgnoreIfNotVisible() const
{
if (!AnimationUtils::IsOffscreenThrottlingEnabled()) {
return false;
}
+ // FIXME (bug 1303235): We don't calculate mCumulativeChangeHint for
+ // the Servo backend yet
+ nsPresContext* presContext = GetPresContext();
+ if (!presContext || presContext->StyleSet()->IsServo()) {
+ return false;
+ }
+
// FIXME: For further sophisticated optimization we need to check
// change hint on the segment corresponding to computedTiming.progress.
return NS_IsHintSubset(
mCumulativeChangeHint, nsChangeHint_Hints_CanIgnoreIfNotVisible);
}
void
KeyframeEffectReadOnly::MaybeUpdateFrameForCompositor()