Bug 1400035 - Check the frame has opacity animations in nsSVGUtils::CanOptimizeOpacity(). r?jwatt draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Sun, 17 Sep 2017 07:28:12 +0900
changeset 667968 ffd1b49c26dbd9ab06edcef42396d70d6713ba0b
parent 667935 319a34bea9e4f3459886b5b9e835bd338320f1fd
child 667969 51a3b2f6b0a4381ffa8514888d2e7959f399c3bc
push id80904
push userhikezoe@mozilla.com
push dateWed, 20 Sep 2017 23:59:21 +0000
reviewersjwatt
bugs1400035
milestone57.0a1
Bug 1400035 - Check the frame has opacity animations in nsSVGUtils::CanOptimizeOpacity(). r?jwatt If the frame has opacity animation, we can't optimize it at all. MozReview-Commit-ID: JQYiPvSaxEs
layout/svg/nsSVGUtils.cpp
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -1304,16 +1304,21 @@ nsSVGUtils::CanOptimizeOpacity(nsIFrame 
   // XXX The SVG WG is intending to allow fill, stroke and markers on <image>
   if (type == LayoutFrameType::SVGImage) {
     return true;
   }
   const nsStyleSVG *style = aFrame->StyleSVG();
   if (style->HasMarker()) {
     return false;
   }
+
+  if (nsLayoutUtils::HasAnimationOfProperty(aFrame, eCSSProperty_opacity)) {
+    return false;
+  }
+
   if (!style->HasFill() || !HasStroke(aFrame)) {
     return true;
   }
   return false;
 }
 
 gfxMatrix
 nsSVGUtils::AdjustMatrixForUnits(const gfxMatrix &aMatrix,