From ca1a9846eb7188967cc4df720f81b0c0fa6fecda Mon Sep 17 00:00:00 2001 From: Timothy Nikkel Date: Sat, 21 Aug 2010 19:55:55 -0500 Subject: [PATCH] Bug 588407. Put top level content documents in a container layer. r=roc --- layout/generic/nsFrameFrame.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/layout/generic/nsFrameFrame.cpp b/layout/generic/nsFrameFrame.cpp index 44526019481..0a5cee88e36 100644 --- a/layout/generic/nsFrameFrame.cpp +++ b/layout/generic/nsFrameFrame.cpp @@ -483,7 +483,15 @@ nsSubDocumentFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder, new (aBuilder) nsDisplayZoom(subdocRootFrame, &childItems, subdocAPD, parentAPD); childItems.AppendToTop(zoomItem); + } else if (!nsContentUtils::IsChildOfSameType(presShell->GetDocument())) { + // We always want top level content documents to be in their own layer. + // If we need a zoom item then we are good because it creates a layer. If + // not then create our own layer. + nsDisplayOwnLayer* layerItem = new (aBuilder) nsDisplayOwnLayer( + subdocRootFrame ? subdocRootFrame : this, &childItems); + childItems.AppendToTop(layerItem); } + // Clip children to the child root frame's rectangle rv = aLists.Content()->AppendNewToTop( new (aBuilder) nsDisplayClip(this, this, &childItems,