diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 5f29335dd28..4d9194a3be1 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -4569,30 +4569,10 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsFrameConstructorState& aState, PRBool propagatedScrollToViewport = PropagateScrollToViewport() == aDocElement; - // The document root should not be scrollable in any paginated context, - // even in print preview. - PRBool isScrollable = display->IsScrollableOverflow() - && !aState.mPresContext->IsPaginated() - && !propagatedScrollToViewport; - - nsIFrame* scrollFrame = nsnull; - - // build a scrollframe - if (isScrollable) { - nsRefPtr newContext; - - newContext = BeginBuildingScrollFrame( aState, - aDocElement, - styleContext, - aParentFrame, - nsnull, - nsCSSAnonBoxes::scrolledContent, - PR_FALSE, - scrollFrame); - - styleContext = newContext; - aParentFrame = scrollFrame; - } + NS_ASSERTION(!display->IsScrollableOverflow() || + aState.mPresContext->IsPaginated() || + propagatedScrollToViewport, + "Scrollbars should have been propagated to the viewport"); nsIFrame* contentFrame = nsnull; PRBool isBlockFrame = PR_FALSE; @@ -4643,16 +4623,7 @@ nsCSSFrameConstructor::ConstructDocElementFrame(nsFrameConstructorState& aState, // set the primary frame aState.mFrameManager->SetPrimaryFrameFor(aDocElement, contentFrame); - // Finish building the scrollframe - if (isScrollable) { - FinishBuildingScrollFrame(aParentFrame, contentFrame); - // primary is set above (to the contentFrame) - - *aNewFrame = scrollFrame; - } else { - // if not scrollable the new frame is the content frame. - *aNewFrame = contentFrame; - } + *aNewFrame = contentFrame; mInitialContainingBlock = contentFrame;