Bug 504269. background color of iframe not drawn on print. r+sr=roc

This commit is contained in:
Timothy Nikkel 2009-07-29 18:10:50 -04:00
parent c28e754020
commit 24844a2db3
2 changed files with 18 additions and 11 deletions

View File

@ -1083,12 +1083,24 @@ nsLayoutUtils::PaintFrame(nsIRenderingContext* aRenderingContext, nsIFrame* aFra
}
}
// For printing, this function is first called on an nsPageFrame, which
// creates a display list with a PageContent item. The PageContent item's
// paint function calls this function on the nsPageFrame's child which is
// an nsPageContentFrame. We only want to add the canvas background color
// item once, for the nsPageContentFrame.
if (NS_SUCCEEDED(rv) && aFrame->GetType() != nsGkAtoms::pageFrame) {
nsIAtom* frameType = aFrame->GetType();
// For the viewport frame in print preview/page layout we want to paint
// the grey background behind the page, not the canvas color.
if (frameType == nsGkAtoms::viewportFrame &&
aFrame->PresContext()->IsRootPaginatedDocument() &&
(aFrame->PresContext()->Type() == nsPresContext::eContext_PrintPreview ||
aFrame->PresContext()->Type() == nsPresContext::eContext_PageLayout)) {
nsRect bounds = nsRect(builder.ToReferenceFrame(aFrame),
aFrame->GetSize());
rv = list.AppendNewToBottom(new (&builder) nsDisplaySolidColor(
aFrame, bounds, NS_RGB(115, 115, 115)));
} else if (frameType != nsGkAtoms::pageFrame) {
// For printing, this function is first called on an nsPageFrame, which
// creates a display list with a PageContent item. The PageContent item's
// paint function calls this function on the nsPageFrame's child which is
// an nsPageContentFrame. We only want to add the canvas background color
// item once, for the nsPageContentFrame.
// Add the canvas background color.
rv = aFrame->PresContext()->PresShell()->AddCanvasBackgroundColorItem(
builder, list, aFrame, nsnull, aBackstop);

View File

@ -213,11 +213,6 @@
cursor: default !important;
}
*|*::-moz-viewport, *|*::-moz-viewport-scroll, *|*::-moz-canvas,
*|*::-moz-scrolled-canvas {
background-color: #737373 !important;
}
}
/* XML parse error reporting */