Bug 852501 part 17. Make ConstructRootFrame infallible. r=dholbert

This commit is contained in:
Boris Zbarsky 2013-03-19 21:47:53 -04:00
Родитель 4b08d55e3f
Коммит ecaf1673f9
3 изменённых файлов: 5 добавлений и 8 удалений

Просмотреть файл

@ -2500,11 +2500,10 @@ nsCSSFrameConstructor::ConstructDocElementFrame(Element* aDocEle
}
nsresult
nsCSSFrameConstructor::ConstructRootFrame(nsIFrame** aNewFrame)
nsIFrame*
nsCSSFrameConstructor::ConstructRootFrame()
{
AUTO_LAYOUT_PHASE_ENTRY_POINT(mPresShell->GetPresContext(), FrameC);
NS_PRECONDITION(aNewFrame, "null out param");
nsStyleSet *styleSet = mPresShell->StyleSet();
@ -2543,8 +2542,7 @@ nsCSSFrameConstructor::ConstructRootFrame(nsIFrame** aNewFrame)
mFixedContainingBlock->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
mFixedContainingBlock->MarkAsAbsoluteContainingBlock();
*aNewFrame = viewportFrame;
return NS_OK;
return viewportFrame;
}
nsresult

Просмотреть файл

@ -73,8 +73,7 @@ private:
nsCSSFrameConstructor& operator=(const nsCSSFrameConstructor& aCopy) MOZ_DELETE;
public:
// XXXbz this method needs to actually return errors!
nsresult ConstructRootFrame(nsIFrame** aNewFrame);
nsIFrame* ConstructRootFrame();
nsresult ReconstructDocElementHierarchy();

Просмотреть файл

@ -1701,7 +1701,7 @@ PresShell::Initialize(nscoord aWidth, nscoord aHeight)
if (!rootFrame) {
nsAutoScriptBlocker scriptBlocker;
mFrameConstructor->BeginUpdate();
mFrameConstructor->ConstructRootFrame(&rootFrame);
rootFrame = mFrameConstructor->ConstructRootFrame();
mFrameConstructor->SetRootFrame(rootFrame);
mFrameConstructor->EndUpdate();
}