Bug 1042411 - ASSERTION: It is assumed the initial operator is OPERATOR_OVER, when it is restored later. r=roc

This commit is contained in:
Rik Cabanier 2014-07-28 16:44:00 +02:00
parent c1aff765dd
commit 43c8e50c54
4 changed files with 66 additions and 0 deletions

View File

@ -4646,10 +4646,23 @@ nsImageRenderer::Draw(nsPresContext* aPresContext,
return;
}
gfxContext* ctx = aRenderingContext.ThebesContext();
gfxContext::GraphicsOperator op = ctx->CurrentOperator();
if (op != gfxContext::OPERATOR_OVER) {
ctx->PushGroup(gfxContentType::COLOR_ALPHA);
ctx->SetOperator(gfxContext::OPERATOR_OVER);
}
nsCOMPtr<imgIContainer> image(ImageOps::CreateFromDrawable(drawable));
nsLayoutUtils::DrawImage(&aRenderingContext, aPresContext, image,
filter, aDest, aFill, aAnchor, aDirtyRect,
ConvertImageRendererToDrawFlags(mFlags));
if (op != gfxContext::OPERATOR_OVER) {
ctx->PopGroupToSource();
ctx->Paint();
}
return;
}
case eStyleImageType_Null:

View File

@ -0,0 +1,22 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<html>
<head>
<style>
.c {
height: 10px;
background: rgb(0,255,0,.5);
}
</style>
</head>
<body>
<div class="c"></div>
<div class="c"></div>
</body>
</html>

View File

@ -0,0 +1,29 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE html>
<html>
<head>
<style>
div {
height: 10px;
}
#b {
background: rgb(0,255,0,.5);
}
#c {
background: -moz-element(#b);
background-blend-mode: difference;
}
</style>
</head>
<body>
<div id="b"></div>
<div id="c"></div>
</body>
</html>

View File

@ -82,3 +82,5 @@ pref(layout.css.background-blend-mode.enabled,true) == background-blending-backg
pref(layout.css.background-blend-mode.enabled,true) == background-blend-mode-body-image.html background-blend-mode-body-image-ref.html
pref(layout.css.background-blend-mode.enabled,true) == background-blend-mode-body-transparent-image.html background-blend-mode-body-transparent-image-ref.html
pref(layout.css.background-blend-mode.enabled,true) == background-blending-moz-element.html background-blending-moz-element-ref.html