bug 856779 - remove nsFrameManager::Init() r=dholbert

This commit is contained in:
Trevor Saunders 2013-03-31 18:43:04 -04:00
parent 1e1929f0f1
commit 8a324dc194
5 changed files with 10 additions and 37 deletions

View File

@ -1399,8 +1399,9 @@ MoveChildrenTo(nsPresContext* aPresContext,
//----------------------------------------------------------------------
nsCSSFrameConstructor::nsCSSFrameConstructor(nsIDocument *aDocument,
nsIPresShell *aPresShell)
: nsFrameManager(aPresShell)
nsIPresShell *aPresShell,
nsStyleSet* aStyleSet)
: nsFrameManager(aPresShell, aStyleSet)
, mDocument(aDocument)
, mRootElementFrame(nullptr)
, mRootElementStyleFrame(nullptr)

View File

@ -55,7 +55,8 @@ public:
typedef mozilla::css::RestyleTracker RestyleTracker;
typedef mozilla::css::OverflowChangedTracker OverflowChangedTracker;
nsCSSFrameConstructor(nsIDocument *aDocument, nsIPresShell* aPresShell);
nsCSSFrameConstructor(nsIDocument *aDocument, nsIPresShell* aPresShell,
nsStyleSet* aStyleSet);
~nsCSSFrameConstructor(void) {
NS_ASSERTION(mUpdateCount == 0, "Dying in the middle of our own update?");
}

View File

@ -188,23 +188,6 @@ nsFrameManager::~nsFrameManager()
NS_ASSERTION(!mPresShell, "nsFrameManager::Destroy never called");
}
nsresult
nsFrameManager::Init(nsStyleSet* aStyleSet)
{
if (!mPresShell) {
NS_ERROR("null pres shell");
return NS_ERROR_FAILURE;
}
if (!aStyleSet) {
NS_ERROR("null style set");
return NS_ERROR_FAILURE;
}
mStyleSet = aStyleSet;
return NS_OK;
}
void
nsFrameManager::Destroy()
{

View File

@ -49,14 +49,14 @@ class nsFrameManager : public nsFrameManagerBase
typedef nsIFrame::ChildListID ChildListID;
public:
nsFrameManager(nsIPresShell *aPresShell) NS_HIDDEN {
nsFrameManager(nsIPresShell *aPresShell, nsStyleSet* aStyleSet) NS_HIDDEN {
mPresShell = aPresShell;
mStyleSet = aStyleSet;
MOZ_ASSERT(mPresShell, "need a pres shell");
MOZ_ASSERT(mStyleSet, "need a style set");
}
~nsFrameManager() NS_HIDDEN;
// Initialization
NS_HIDDEN_(nsresult) Init(nsStyleSet* aStyleSet);
/*
* After Destroy is called, it is an error to call any FrameManager methods.
* Destroy should be called when the frame tree managed by the frame

View File

@ -781,7 +781,6 @@ PresShell::Init(nsIDocument* aDocument,
NS_PRECONDITION(nullptr != aDocument, "null ptr");
NS_PRECONDITION(nullptr != aPresContext, "null ptr");
NS_PRECONDITION(nullptr != aViewManager, "null ptr");
nsresult result;
if ((nullptr == aDocument) || (nullptr == aPresContext) ||
(nullptr == aViewManager)) {
@ -799,7 +798,7 @@ PresShell::Init(nsIDocument* aDocument,
mViewManager = aViewManager;
// Create our frame constructor.
mFrameConstructor = new nsCSSFrameConstructor(mDocument, this);
mFrameConstructor = new nsCSSFrameConstructor(mDocument, this, aStyleSet);
mFrameManager = mFrameConstructor;
@ -831,17 +830,6 @@ PresShell::Init(nsIDocument* aDocument,
NS_ADDREF(mSelection = new nsFrameSelection());
// Create and initialize the frame manager
// XXXjwatt it would be better if we did this right after creating
// mFrameConstructor, since the frame constructor and frame manager
// are now the same object.
result = mFrameConstructor->Init(mStyleSet);
if (NS_FAILED(result)) {
NS_WARNING("Frame manager initialization failed");
mStyleSet = nullptr;
return result;
}
mSelection->Init(this, nullptr);
// Important: this has to happen after the selection has been set up