Bug 1207734 - Part 4.c. Temporarily disable async-transform for individual-transform. r=birtles draft
authorcku <cku@mozilla.com>
Fri, 05 Jan 2018 14:45:05 +0800
changeset 749189 dd508458f70d5473256a4bfe5a2f6bc665bbac9d
parent 749188 6f39ac3e180cdb1706e12f7a662cac3ac1c369d3
child 749190 ee81993c07a30fe5b8788d2ce6707967eb0a832a
push id97349
push userbbirtles@mozilla.com
push dateWed, 31 Jan 2018 02:59:16 +0000
reviewersbirtles
bugs1207734
milestone60.0a1
Bug 1207734 - Part 4.c. Temporarily disable async-transform for individual-transform. r=birtles Since we do not support async-transform for individual-transform yet. MozReview-Commit-ID: gfOzHpjOnQ
dom/animation/KeyframeEffectReadOnly.cpp
layout/style/nsStyleStruct.h
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -1671,16 +1671,22 @@ KeyframeEffectReadOnly::ShouldBlockAsync
     if (property.mProperty == eCSSProperty_transform) {
       if (!CanAnimateTransformOnCompositor(aFrame,
                                            aPerformanceWarning)) {
         return true;
       }
     }
   }
 
+  // XXX cku temporarily disable async-animation when this frame has any
+  // individual transforms before bug 1425837 been fixed.
+  if (aFrame->StyleDisplay()->HasIndividualTransform()) {
+    return true;
+  }
+
   return false;
 }
 
 bool
 KeyframeEffectReadOnly::HasGeometricProperties() const
 {
   for (const AnimationProperty& property : mProperties) {
     if (IsGeometricProperty(property.mProperty)) {
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -2764,16 +2764,20 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
    * or a related property. */
   bool HasTransformStyle() const {
     return mSpecifiedTransform || mSpecifiedRotate || mSpecifiedTranslate ||
            mSpecifiedScale ||
            mTransformStyle == NS_STYLE_TRANSFORM_STYLE_PRESERVE_3D ||
            (mWillChangeBitField & NS_STYLE_WILL_CHANGE_TRANSFORM);
   }
 
+  bool HasIndividualTransform() const {
+    return mSpecifiedRotate || mSpecifiedTranslate || mSpecifiedScale;
+  }
+
   bool HasPerspectiveStyle() const {
     return mChildPerspective.GetUnit() == eStyleUnit_Coord;
   }
 
   bool BackfaceIsHidden() const {
     return mBackfaceVisibility == NS_STYLE_BACKFACE_VISIBILITY_HIDDEN;
   }