diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index d8e32a9a5c38..230b91e1a506 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -1310,11 +1310,16 @@ nsIFrame::IsTransformed() const return ((mState & NS_FRAME_MAY_BE_TRANSFORMED) && (StyleDisplay()->HasTransform(this) || IsSVGTransformed() || - (mContent && - nsLayoutUtils::HasAnimationOfProperty(this, - eCSSProperty_transform) && - IsFrameOfType(eSupportsCSSTransforms) && - mContent->GetPrimaryFrame() == this))); + HasAnimationOfTransform())); +} + +bool +nsIFrame::HasAnimationOfTransform() const +{ + return mContent && + nsLayoutUtils::HasAnimationOfProperty(this, eCSSProperty_transform) && + IsFrameOfType(eSupportsCSSTransforms) && + mContent->GetPrimaryFrame() == this; } bool diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 445e0d9cd1e6..f13d8bbdf43f 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -1641,6 +1641,11 @@ public: */ bool IsTransformed() const; + /** + * True if this frame has any animation of transform in effect. + */ + bool HasAnimationOfTransform() const; + /** * Returns true if the frame is translucent or the frame has opacity * animations for the purposes of creating a stacking context. diff --git a/layout/painting/FrameLayerBuilder.cpp b/layout/painting/FrameLayerBuilder.cpp index 027aea60bf64..15a7d1a99229 100644 --- a/layout/painting/FrameLayerBuilder.cpp +++ b/layout/painting/FrameLayerBuilder.cpp @@ -5541,7 +5541,10 @@ ChooseScaleAndSetTransform(FrameLayerBuilder* aLayerBuilder, if ((aLayerBuilder->IsBuildingRetainedLayers() && (!canDraw2D || transform2d.HasNonIntegerTranslation())) || aContainerFrame->Extend3DContext() || - aContainerFrame->Combines3DTransformWithAncestors()) { + aContainerFrame->Combines3DTransformWithAncestors() || + // For async transform animation, the value would be changed at + // any time, integer translation is not always true. + aContainerFrame->HasAnimationOfTransform()) { aOutgoingScale.mDisableSubpixelAntialiasingInDescendants = true; } return true;