From 0e770e33c0638c1f3c4cde0d1ba7a77ef6d11fa0 Mon Sep 17 00:00:00 2001 From: Horia Iosif Olaru Date: Fri, 28 Feb 2014 09:11:37 -0500 Subject: [PATCH] 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 --- layout/generic/nsFrame.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index f3b8b3d0eec..a8bc8791a1b 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -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);