Bug 1301305 - Notify animations when they should synchronize with geometric animations; r?hiro
MozReview-Commit-ID: 9Ploi5UwseA
--- a/devtools/client/animationinspector/test/browser_animation_animated_properties_displayed.js
+++ b/devtools/client/animationinspector/test/browser_animation_animated_properties_displayed.js
@@ -77,15 +77,15 @@ function hasExpectedProperties(container
return true;
}
function hasExpectedWarnings(containerEl) {
let warnings = [...containerEl.querySelectorAll(".warning")];
for (let warning of warnings) {
let warningID =
- "CompositorAnimationWarningTransformWithGeometricProperties";
+ "CompositorAnimationWarningTransformWithSyncGeometricAnimations";
if (warning.getAttribute("title") == LAYOUT_ERRORS_L10N.getStr(warningID)) {
return true;
}
}
return false;
}
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -120,16 +120,28 @@ FindAnimationsForCompositor(const nsIFra
MOZ_ASSERT(!aMatches || aMatches->IsEmpty(),
"Matches array, if provided, should be empty");
EffectSet* effects = EffectSet::GetEffectSet(aFrame);
if (!effects || effects->IsEmpty()) {
return false;
}
+ // First check for newly-started transform animations that should be
+ // synchronized with geometric animations. We need to do this before any
+ // other early returns (the one above is ok) since we can only check this
+ // state when the animation is newly-started.
+ if (aProperty == eCSSProperty_transform) {
+ PendingAnimationTracker* tracker =
+ aFrame->PresContext()->Document()->GetPendingAnimationTracker();
+ if (tracker) {
+ tracker->MarkAnimationsThatMightNeedSynchronization();
+ }
+ }
+
// If the property will be added to the animations level of the cascade but
// there is an !important rule for that property in the cascade then the
// animation will not be applied since the !important rule overrides it.
if (effects->PropertiesWithImportantRules().HasProperty(aProperty) &&
effects->PropertiesForAnimationsLevel().HasProperty(aProperty)) {
return false;
}
--- a/dom/animation/test/chrome/test_animation_performance_warning.html
+++ b/dom/animation/test/chrome/test_animation_performance_warning.html
@@ -316,17 +316,17 @@ function testSetOfGeometricProperties()
[
{
property,
runningOnCompositor: false
},
{
property: 'transform',
runningOnCompositor: false,
- warning: 'CompositorAnimationWarningTransformWithGeometricProperties'
+ warning: 'CompositorAnimationWarningTransformWithSyncGeometricAnimations'
}
]);
}, 'Transform animation should be run on the main thread');
}, `${property} is treated as a geometric property`);
});
}
// Performance warning tests that set and clear a style property.