Bug 1252739 - nsStyleImageLayers::HasLayerWithImage should return true when we have mask-image:<element-reference> | <gradient>; r=dbaron

MozReview-Commit-ID: 876p0IfKoUi
This commit is contained in:
CJKu 2016-03-02 16:27:21 +08:00
parent c9a7e8c0a5
commit 8ed0c2a68c

View File

@ -2367,7 +2367,12 @@ 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;
}
}