Bug 1400035 - Check the frame has opacity animations in nsSVGUtils::CanOptimizeOpacity(). r=jwatt
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Sun, 17 Sep 2017 07:28:12 +0900
changeset 431631 f4ae3d8fd4a4af37aa0e11cb138a4eba8e087f95
parent 431630 dd9b01ec0df24f506d2bd2d8d09fd92694901193
child 431632 2db87d9e38c1f4ad9eb9b42d5998c65662992899
push id7785
push userryanvm@gmail.com
push dateThu, 21 Sep 2017 13:39:55 +0000
treeherdermozilla-beta@06d4034a8a03 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs1400035
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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,