Bug 1294171 - Part 1. Treat unresolvable mask as no mask before support image mask. r=mstange

MozReview-Commit-ID: 9f2k7NtpYuR

--HG--
extra : rebase_source : b39ef5f82382fd9d7f237d1dabd6d834b8bbefa0
This commit is contained in:
cku 2016-08-18 11:24:28 +08:00
Родитель 6ae29c9c6d
Коммит 3cd159aa2b
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -697,6 +697,8 @@ nsSVGIntegrationUtils::PaintFramesWithEffects(const PaintFramesParams& aParams)
const nsStyleSVGReset *svgReset = firstFrame->StyleSVGReset();
nsTArray<nsSVGMaskFrame *> maskFrames = effectProperties.GetMaskFrames();
#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
// For a HTML doc:
// According to css-masking spec, always create a mask surface when we
// have any item in maskFrame even if all of those items are
@ -708,6 +710,13 @@ nsSVGIntegrationUtils::PaintFramesWithEffects(const PaintFramesParams& aParams)
bool shouldGenerateMaskLayer = hasSVGLayout
? maskFrames.Length() == 1 && maskFrames[0]
: maskFrames.Length() > 0;
#else
// Since we do not support image mask so far, we should treat any
// unresolvable mask as no mask. Otherwise, any object with a valid image
// mask, e.g. url("xxx.png"), will become invisible just because we can not
// handle image mask correctly. (See bug 1294171)
bool shouldGenerateMaskLayer = maskFrames.Length() == 1 && maskFrames[0];
#endif
// These are used if we require a temporary surface for a custom blend mode.
RefPtr<gfxContext> target = &aParams.ctx;