Bug 976533 - In case there is are both a MixBlendMode and BlendContainer wrapping the same stacking display list, reverse the order so that the BlendContainer comes first. This way, it will not isolate the legitimate MixBlendMode item. r=roc

This commit is contained in:
Horia Iosif Olaru 2014-02-28 09:11:37 -05:00
parent b3e8b1ec7f
commit b92ebfeaec

View File

@ -2029,6 +2029,19 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
}
}
/* If adding both a nsDisplayBlendContainer and a nsDisplayMixBlendMode to the
* same list, the nsDisplayBlendContainer should be added first. This only
* happens when the element creating this stacking context has mix-blend-mode
* and also contains a child which has mix-blend-mode.
* The nsDisplayBlendContainer must be added to the list first, so it does not
* isolate the containing element blending as well.
*/
if (aBuilder->ContainsBlendMode()) {
resultList.AppendNewToTop(
new (aBuilder) nsDisplayBlendContainer(aBuilder, this, &resultList));
}
/* If there's blending, wrap up the list in a blend-mode item. Note
* that opacity can be applied before blending as the blend color is
* not affected by foreground opacity (only background alpha).
@ -2038,11 +2051,6 @@ nsIFrame::BuildDisplayListForStackingContext(nsDisplayListBuilder* aBuilder,
resultList.AppendNewToTop(
new (aBuilder) nsDisplayMixBlendMode(aBuilder, this, &resultList));
}
if (aBuilder->ContainsBlendMode()) {
resultList.AppendNewToTop(
new (aBuilder) nsDisplayBlendContainer(aBuilder, this, &resultList));
}
CreateOwnLayerIfNeeded(aBuilder, &resultList);