Bug 381621: Get rid of nsBoxFrame::AddRef/Release, plus a few misc cleanups. r+sr=dbaron.

This commit is contained in:
sharparrow1@yahoo.com 2007-05-22 13:34:00 -07:00
Родитель 2d375302cb
Коммит b7b65effc9
6 изменённых файлов: 6 добавлений и 46 удалений

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

@ -5606,7 +5606,8 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsFrameConstructorState& aState,
PRBool aAppendToExisting,
nsFrameItems& aChildItems)
{
nsCOMPtr<nsIAnonymousContentCreator> creator(do_QueryInterface(aParentFrame));
nsIAnonymousContentCreator* creator = nsnull;
CallQueryInterface(aParentFrame, &creator);
if (!creator)
return NS_OK;

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

@ -1651,7 +1651,8 @@ nsGfxScrollFrameInner::CreateAnonymousContent(nsTArray<nsIContent*>& aElements)
}
// The anonymous <div> used by <inputs> never gets scrollbars.
nsCOMPtr<nsITextControlFrame> textFrame(do_QueryInterface(parent));
nsITextControlFrame* textFrame = nsnull;
CallQueryInterface(parent, &textFrame);
if (textFrame) {
// Make sure we are not a text area.
nsCOMPtr<nsIDOMHTMLTextAreaElement> textAreaElement(do_QueryInterface(parent->GetContent()));

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

@ -645,9 +645,6 @@ nsBox::SyncLayout(nsBoxLayoutState& aState)
flags);
}
if (IsBoxFrame())
mState &= ~(NS_STATE_STYLE_CHANGE);
return NS_OK;
}

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

@ -47,7 +47,6 @@ class nsITheme;
#define NS_STATE_IS_ROOT 0x01000000
#define NS_STATE_SET_TO_DEBUG 0x04000000
#define NS_STATE_DEBUG_WAS_SET 0x08000000
#define NS_STATE_STYLE_CHANGE 0x20000000
class nsBox : public nsIFrame {

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

@ -741,14 +741,7 @@ nsBoxFrame::Reflow(nsPresContext* aPresContext,
aDesiredSize.height = mRect.height;
aDesiredSize.ascent = ascent;
// NS_FRAME_OUTSIDE_CHILDREN is set in SetBounds() above
if (mState & NS_FRAME_OUTSIDE_CHILDREN) {
nsRect* overflowArea = GetOverflowAreaProperty();
NS_ASSERTION(overflowArea, "Failed to set overflow area property");
aDesiredSize.mOverflowArea = *overflowArea;
} else {
aDesiredSize.mOverflowArea = nsRect(nsPoint(0, 0), GetSize());
}
aDesiredSize.mOverflowArea = GetOverflowRect();
#ifdef DO_NOISY_REFLOW
{
@ -1438,18 +1431,6 @@ nsBoxFrame::PaintXULDebugOverlay(nsIRenderingContext& aRenderingContext,
}
#endif
NS_IMETHODIMP_(nsrefcnt)
nsBoxFrame::AddRef(void)
{
return NS_OK;
}
NS_IMETHODIMP_(nsrefcnt)
nsBoxFrame::Release(void)
{
return NS_OK;
}
#ifdef DEBUG_LAYOUT
void
nsBoxFrame::GetBoxName(nsAutoString& aName)
@ -1511,14 +1492,6 @@ nsBoxFrame::GetDebug(PRBool& aDebug)
// This new behaviour is implemented in nsDisplayList::HitTest.
// REVIEW: This debug-box stuff is annoying. I'm just going to put debug boxes
// in the outline layer and avoid GetDebugBoxAt.
nsIBox*
nsBoxFrame::GetBoxForFrame(nsIFrame* aFrame, PRBool& aIsAdaptor)
{
if (aFrame && !aFrame->IsBoxFrame())
aIsAdaptor = PR_TRUE;
return aFrame;
}
// REVIEW: GetCursor had debug-only event dumping code. I have replaced it
// with instrumentation in nsDisplayXULDebug.
@ -1531,6 +1504,7 @@ nsBoxFrame::GetContentOf(nsIContent** aContent)
*aContent = frame->GetContent();
if (*aContent) {
NS_ADDREF(*aContent);
NS_ASSERTION(*aContent == GetContent(), "Can't happen");
return NS_OK;
}

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

@ -90,10 +90,6 @@ public:
// gets the rect inside our border and debug border. If you wish to paint inside a box
// call this method to get the rect so you don't draw on the debug border or outer border.
// Override addref/release to not assert
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
// ------ nsIBox -------------
NS_IMETHOD SetLayoutManager(nsIBoxLayout* aLayout);
NS_IMETHOD GetLayoutManager(nsIBoxLayout** aLayout);
@ -253,12 +249,6 @@ protected:
private:
// helper methods
static PRBool AdjustTargetToScope(nsIFrame* aParent, nsIFrame*& aTargetFrame);
#ifdef DEBUG_LAYOUT
nsresult SetDebug(nsPresContext* aPresContext, PRBool aDebug);
PRBool GetInitialDebug(PRBool& aDebug);
@ -284,8 +274,6 @@ private:
void CacheAttributes();
nsIBox* GetBoxForFrame(nsIFrame* aFrame, PRBool& aIsAdaptor);
// instance variables.
Halignment mHalign;
Valignment mValign;