Backed out changeset 9e290d196600 (bug 574621) for causing test failures.

This commit is contained in:
Timothy Nikkel 2010-07-29 15:16:40 -05:00
parent b6f426f863
commit 563e069ae6

View File

@ -5786,22 +5786,17 @@ void PresShell::UpdateCanvasBackground()
// If we have a frame tree and it has style information that
// specifies the background color of the canvas, update our local
// cache of that color.
nsIFrame* rootStyleFrame = FrameConstructor()->GetRootElementStyleFrame();
if (rootStyleFrame) {
nsIFrame* rootFrame = FrameConstructor()->GetRootElementStyleFrame();
if (rootFrame) {
nsStyleContext* bgStyle =
nsCSSRendering::FindRootFrameBackground(rootStyleFrame);
nsCSSRendering::FindRootFrameBackground(rootFrame);
// XXX We should really be passing the canvasframe, not the root element
// style frame but we don't have access to the canvasframe here. It isn't
// a problem because only a few frames can return something other than true
// and none of them would be a canvas frame or root element style frame.
mCanvasBackgroundColor =
nsCSSRendering::DetermineBackgroundColor(GetPresContext(), bgStyle,
rootStyleFrame);
if (nsLayoutUtils::GetCrossDocParentFrame(FrameManager()->GetRootFrame()) &&
!nsContentUtils::IsChildOfSameType(mDocument)) {
mCanvasBackgroundColor =
NS_ComposeColors(mPresContext->DefaultBackgroundColor(), mCanvasBackgroundColor);
}
rootFrame);
}
// If the root element of the document (ie html) has style 'display: none'