Bug 1252739 - nsStyleImageLayers::HasLayerWithImage should return true when we have mask-image:<element-reference> | <gradient>; r=dbaron
authorCJKu <cku@mozilla.com>
Wed, 02 Mar 2016 16:27:21 +0800
changeset 322738 ad21637bb1cd5adeb4d63cd875a206fcac0c7c82
parent 322737 c6ebde846f2d47225592194a716160be1831c5f9
child 322739 0a2dadeedd4f221d859bee69db3f83a48454c45c
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbaron
bugs1252739
milestone47.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 1252739 - nsStyleImageLayers::HasLayerWithImage should return true when we have mask-image:<element-reference> | <gradient>; r=dbaron MozReview-Commit-ID: 876p0IfKoUi
layout/style/nsStyleStruct.cpp
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -2362,17 +2362,22 @@ nsStyleImageLayers::CalcDifference(const
 
   return hint;
 }
 
 bool
 nsStyleImageLayers::HasLayerWithImage() const
 {
   for (uint32_t i = 0; i < mImageCount; i++) {
-    if (mLayers[i].mSourceURI) {
+    // mLayers[i].mSourceURI can be nullptr if mask-image prop value is
+    // <element-reference> or <gradient>
+    // mLayers[i].mImage can be empty if mask-image prop value is a reference
+    // to SVG mask element.
+    // So we need to test both mSourceURI and mImage.
+    if (mLayers[i].mSourceURI || !mLayers[i].mImage.IsEmpty()) {
       return true;
     }
   }
 
   return false;
 }
 
 bool