Bug 1301305 - Add a performance warning type for transform animations that should be synchronized with geometric animations; r?hiro, r?flod draft
authorBrian Birtles <birtles@gmail.com>
Fri, 02 Dec 2016 10:00:51 +0900
changeset 447578 b4bbc3e4ffa69d0d741fe6d67aba0349b9325b3e
parent 447577 6e0a30658d35fa236f9d8bfb343cb4355b4ce0e5
child 447579 6b2a719c0c9d744d6204b8cff50efe21f5940e2d
push id38084
push userbbirtles@mozilla.com
push dateTue, 06 Dec 2016 07:57:40 +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)