diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 1f714b0b34d..e78dc10f274 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -2033,6 +2033,11 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext, nsnull, PR_FALSE, getter_AddRefs(viewportPseudoStyle)); + { // ensure that the viewport thinks it is a block frame, layout goes pootsy if it doesn't + nsStyleDisplay* display = (nsStyleDisplay*)viewportPseudoStyle->GetMutableStyleData(eStyleStruct_Display); + display->mDisplay = NS_STYLE_DISPLAY_BLOCK; + } + // Initialize the viewport frame. It has a NULL content object viewportFrame->Init(*aPresContext, nsnull, nsnull, viewportPseudoStyle, nsnull); diff --git a/layout/html/style/src/nsCSSFrameConstructor.cpp b/layout/html/style/src/nsCSSFrameConstructor.cpp index 1f714b0b34d..e78dc10f274 100644 --- a/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -2033,6 +2033,11 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIPresContext* aPresContext, nsnull, PR_FALSE, getter_AddRefs(viewportPseudoStyle)); + { // ensure that the viewport thinks it is a block frame, layout goes pootsy if it doesn't + nsStyleDisplay* display = (nsStyleDisplay*)viewportPseudoStyle->GetMutableStyleData(eStyleStruct_Display); + display->mDisplay = NS_STYLE_DISPLAY_BLOCK; + } + // Initialize the viewport frame. It has a NULL content object viewportFrame->Init(*aPresContext, nsnull, nsnull, viewportPseudoStyle, nsnull);