diff --git a/layout/generic/nsHTMLContainerFrame.cpp b/layout/generic/nsHTMLContainerFrame.cpp
index 20b7912578fa..9a2af4414f0d 100644
--- a/layout/generic/nsHTMLContainerFrame.cpp
+++ b/layout/generic/nsHTMLContainerFrame.cpp
@@ -234,6 +234,8 @@ nsHTMLContainerFrame::CreateWrapperFrame(nsIPresContext& aPresContext,
NS_RELEASE(pseudoStyle);
// Init the body frame
+ aFrame->SetGeometricParent(aWrapperFrame);
+ aFrame->SetContentParent(aWrapperFrame);
aWrapperFrame->SetInitialChildList(aPresContext, nsnull, aFrame);
}
diff --git a/layout/html/base/src/nsHTMLContainerFrame.cpp b/layout/html/base/src/nsHTMLContainerFrame.cpp
index 20b7912578fa..9a2af4414f0d 100644
--- a/layout/html/base/src/nsHTMLContainerFrame.cpp
+++ b/layout/html/base/src/nsHTMLContainerFrame.cpp
@@ -234,6 +234,8 @@ nsHTMLContainerFrame::CreateWrapperFrame(nsIPresContext& aPresContext,
NS_RELEASE(pseudoStyle);
// Init the body frame
+ aFrame->SetGeometricParent(aWrapperFrame);
+ aFrame->SetContentParent(aWrapperFrame);
aWrapperFrame->SetInitialChildList(aPresContext, nsnull, aFrame);
}