Bug 1301305 - Add a performance warning type for transform animations that should be synchronized with geometric animations; r=hiro, r=flod
authorBrian Birtles <birtles@gmail.com>
Fri, 02 Dec 2016 10:00:51 +0900
changeset 325330 d14b2103446d083f72f5262d79168e8eb539f401
parent 325329 ece7cb85c38122ec03a8870e2f0054ece2024fa0
child 325331 49a60bdadd4eeb1ac0594b095456f5566e499314
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewershiro, flod
bugs1301305
milestone53.0a1
Bug 1301305 - Add a performance warning type for transform animations that should be synchronized with geometric animations; r=hiro, r=flod This patch adds a new performance warning type for the case when we start a transform animation at the same time as an animation that includes a geometric property. In that case we run the transform animation on the main thread so that it is synchronized with the geometric animation (which we can only run on the main thread). This differs from CompositorAnimationWarningTransformWithGeometricProperties in that this applies across different elements whilst the existing warning only covers the case when the same animation animates both transform and geometric properties. MozReview-Commit-ID: EcOMo4VDAYY
dom/animation/AnimationPerformanceWarning.cpp
dom/animation/AnimationPerformanceWarning.h
dom/locales/en-US/chrome/layout/layout_errors.properties
--- a/dom/animation/AnimationPerformanceWarning.cpp
+++ b/dom/animation/AnimationPerformanceWarning.cpp
@@ -54,16 +54,19 @@ AnimationPerformanceWarning::ToLocalized
       key = "CompositorAnimationWarningTransformPreserve3D";
       break;
     case Type::TransformSVG:
       key = "CompositorAnimationWarningTransformSVG";
       break;
     case Type::TransformWithGeometricProperties:
       key = "CompositorAnimationWarningTransformWithGeometricProperties";
       break;
+    case Type::TransformWithSyncGeometricAnimations:
+      key = "CompositorAnimationWarningTransformWithSyncGeometricAnimations";
+      break;
     case Type::TransformFrameInactive:
       key = "CompositorAnimationWarningTransformFrameInactive";
       break;
     case Type::OpacityFrameInactive:
       key = "CompositorAnimationWarningOpacityFrameInactive";
       break;
     case Type::HasRenderingObserver:
       key = "CompositorAnimationWarningHasRenderingObserver";
--- a/dom/animation/AnimationPerformanceWarning.h
+++ b/dom/animation/AnimationPerformanceWarning.h
@@ -18,16 +18,17 @@ struct AnimationPerformanceWarning
 {
   enum class Type : uint8_t {
     ContentTooSmall,
     ContentTooLarge,
     TransformBackfaceVisibilityHidden,
     TransformPreserve3D,
     TransformSVG,
     TransformWithGeometricProperties,
+    TransformWithSyncGeometricAnimations,
     TransformFrameInactive,
     OpacityFrameInactive,
     HasRenderingObserver,
   };
 
   explicit AnimationPerformanceWarning(Type aType)
     : mType(aType) { }
 
--- a/dom/locales/en-US/chrome/layout/layout_errors.properties
+++ b/dom/locales/en-US/chrome/layout/layout_errors.properties
@@ -23,16 +23,18 @@ CompositorAnimationWarningContentTooLarg
 ## LOCALIZATION NOTE(CompositorAnimationWarningTransformBackfaceVisibilityHidden):
 ## 'backface-visibility: hidden' is a CSS property, don't translate it.
 CompositorAnimationWarningTransformBackfaceVisibilityHidden=Animations of ‘backface-visibility: hidden’ transforms cannot be run on the compositor
 ## LOCALIZATION NOTE(CompositorAnimationWarningTransformPreserve3D):
 ## 'transform-style: preserve-3d' is a CSS property, don't translate it.
 CompositorAnimationWarningTransformPreserve3D=Animations of ‘transform-style: preserve-3d’ transforms cannot be run on the compositor
 ## LOCALIZATION NOTE(CompositorAnimationWarningTransformSVG,
 ##                   CompositorAnimationWarningTransformWithGeometricProperties,
+##                   CompositorAnimationWarningTransformWithSyncGeometricAnimations,
 ##                   CompositorAnimationWarningTransformFrameInactive,
 ##                   CompositorAnimationWarningOpacityFrameInactive):
 ## 'transform' and 'opacity' mean CSS property names, don't translate it.
 CompositorAnimationWarningTransformSVG=Animations of ‘transform’ on elements with SVG transforms cannot be run on the compositor
 CompositorAnimationWarningTransformWithGeometricProperties=Animations of ‘transform’ cannot be run on the compositor when geometric properties are animated on the same element at the same time
+CompositorAnimationWarningTransformWithSyncGeometricAnimations=Animation of ‘transform’ cannot be run on the compositor because it should be synchronized with animations of geometric properties that started at the same time
 CompositorAnimationWarningTransformFrameInactive=Animation cannot be run on the compositor because the frame was not marked active for ‘transform’ animation
 CompositorAnimationWarningOpacityFrameInactive=Animation cannot be run on the compositor because the frame was not marked active for ‘opacity’ animation
 CompositorAnimationWarningHasRenderingObserver=Animation cannot be run on the compositor because the element has rendering observers (-moz-element or SVG clipping/masking)