bug 1058044 - Background-blend-mode no longer blends correctly for <html> elements. r=roc

This commit is contained in:
Rik Cabanier 2014-09-23 19:50:00 +02:00
parent 51675a240f
commit ce6c5dc0b7
2 changed files with 8 additions and 5 deletions

View File

@ -786,6 +786,7 @@ PresShell::PresShell()
}
mPaintingIsFrozen = false;
mHasCSSBackgroundColor = true;
}
NS_IMPL_ISUPPORTS(PresShell, nsIPresShell, nsIDocumentObserver,
@ -5263,7 +5264,7 @@ PresShell::AddPrintPreviewBackgroundItem(nsDisplayListBuilder& aBuilder,
static bool
AddCanvasBackgroundColor(const nsDisplayList& aList, nsIFrame* aCanvasFrame,
nscolor aColor)
nscolor aColor, bool aCSSBackgroundColor)
{
for (nsDisplayItem* i = aList.GetBottom(); i; i = i->GetAbove()) {
if (i->Frame() == aCanvasFrame &&
@ -5274,8 +5275,8 @@ AddCanvasBackgroundColor(const nsDisplayList& aList, nsIFrame* aCanvasFrame,
}
nsDisplayList* sublist = i->GetSameCoordinateSystemChildren();
if (sublist &&
i->GetType() != nsDisplayItem::TYPE_BLEND_CONTAINER &&
AddCanvasBackgroundColor(*sublist, aCanvasFrame, aColor))
!(i->GetType() == nsDisplayItem::TYPE_BLEND_CONTAINER && !aCSSBackgroundColor) &&
AddCanvasBackgroundColor(*sublist, aCanvasFrame, aColor, aCSSBackgroundColor))
return true;
}
return false;
@ -5317,7 +5318,7 @@ PresShell::AddCanvasBackgroundColorItem(nsDisplayListBuilder& aBuilder,
if (sf) {
nsCanvasFrame* canvasFrame = do_QueryFrame(sf->GetScrolledFrame());
if (canvasFrame && canvasFrame->IsVisibleForPainting(&aBuilder)) {
if (AddCanvasBackgroundColor(aList, canvasFrame, bgcolor))
if (AddCanvasBackgroundColor(aList, canvasFrame, bgcolor, mHasCSSBackgroundColor))
return;
}
}
@ -5365,12 +5366,12 @@ void PresShell::UpdateCanvasBackground()
// and none of them would be a canvas frame or root element style frame.
bool drawBackgroundImage;
bool drawBackgroundColor;
mCanvasBackgroundColor =
nsCSSRendering::DetermineBackgroundColor(mPresContext, bgStyle,
rootStyleFrame,
drawBackgroundImage,
drawBackgroundColor);
mHasCSSBackgroundColor = drawBackgroundColor;
if (GetPresContext()->IsCrossProcessRootContentDocument() &&
!IsTransparentContainerElement(mPresContext)) {
mCanvasBackgroundColor =

View File

@ -828,6 +828,8 @@ protected:
bool mNextPaintCompressed : 1;
bool mHasCSSBackgroundColor : 1;
static bool sDisableNonTestMouseEvents;
};