diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 56fd4031fbcd..6e48951e474a 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -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'