зеркало из https://github.com/mozilla/pjs.git
Bug 313817. DeCOMtaminate more NS_New*Frame functions. r+sr=roc, patch by Marc Liddell
This commit is contained in:
Родитель
624b78a677
Коммит
c4070dec03
|
@ -61,10 +61,10 @@ static const PRUnichar ALEF = 0x05D0;
|
|||
#define CHAR_IS_HEBREW(c) ((0x0590 <= (c)) && ((c)<= 0x05FF))
|
||||
// Note: The above code are moved from gfx/src/windows/nsRenderingContextWin.cpp
|
||||
|
||||
nsresult
|
||||
NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewDirectionalFrame(nsIFrame** aNewFrame, PRUnichar aChar);
|
||||
nsIFrame*
|
||||
NS_NewContinuingTextFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewDirectionalFrame(nsIPresShell* aPresShell, PRUnichar aChar);
|
||||
|
||||
nsBidiPresUtils::nsBidiPresUtils() : mArraySize(8),
|
||||
mIndexMap(nsnull),
|
||||
|
@ -113,7 +113,7 @@ CreateBidiContinuation(nsPresContext* aPresContext,
|
|||
|
||||
NS_ASSERTION(presShell, "PresShell must be set on PresContext before calling nsBidiPresUtils::CreateBidiContinuation");
|
||||
|
||||
NS_NewContinuingTextFrame(presShell, aNewFrame);
|
||||
*aNewFrame = NS_NewContinuingTextFrame(presShell);
|
||||
if (!(*aNewFrame) ) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
@ -176,29 +176,32 @@ nsBidiPresUtils::Resolve(nsPresContext* aPresContext,
|
|||
mLogicalFrames.Clear();
|
||||
mContentToFrameIndex.Clear();
|
||||
|
||||
nsIPresShell* shell = aPresContext->PresShell();
|
||||
|
||||
// handle bidi-override being set on the block itself before calling
|
||||
// InitLogicalArray.
|
||||
const nsStyleVisibility* vis = aBlockFrame->GetStyleVisibility();
|
||||
const nsStyleTextReset* text = aBlockFrame->GetStyleTextReset();
|
||||
|
||||
if (text->mUnicodeBidi == NS_STYLE_UNICODE_BIDI_OVERRIDE) {
|
||||
nsresult rv = NS_OK;
|
||||
nsIFrame *directionalFrame = nsnull;
|
||||
|
||||
if (NS_STYLE_DIRECTION_RTL == vis->mDirection) {
|
||||
rv = NS_NewDirectionalFrame(&directionalFrame, kRLO);
|
||||
directionalFrame = NS_NewDirectionalFrame(shell, kRLO);
|
||||
}
|
||||
else if (NS_STYLE_DIRECTION_LTR == vis->mDirection) {
|
||||
rv = NS_NewDirectionalFrame(&directionalFrame, kLRO);
|
||||
directionalFrame = NS_NewDirectionalFrame(shell, kLRO);
|
||||
}
|
||||
if (directionalFrame && NS_SUCCEEDED(rv)) {
|
||||
|
||||
if (directionalFrame) {
|
||||
mLogicalFrames.AppendElement(directionalFrame);
|
||||
}
|
||||
}
|
||||
mSuccess = InitLogicalArray(aPresContext, aFirstChild, nsnull, PR_TRUE);
|
||||
|
||||
if (text->mUnicodeBidi == NS_STYLE_UNICODE_BIDI_OVERRIDE) {
|
||||
nsIFrame *directionalFrame = nsnull;
|
||||
nsresult rv = NS_NewDirectionalFrame(&directionalFrame, kPDF);
|
||||
if (directionalFrame && NS_SUCCEEDED(rv)) {
|
||||
nsIFrame* directionalFrame = NS_NewDirectionalFrame(shell, kPDF);
|
||||
if (directionalFrame) {
|
||||
mLogicalFrames.AppendElement(directionalFrame);
|
||||
}
|
||||
}
|
||||
|
@ -365,13 +368,14 @@ nsBidiPresUtils::InitLogicalArray(nsPresContext* aPresContext,
|
|||
{
|
||||
nsIFrame* frame;
|
||||
nsIFrame* directionalFrame;
|
||||
nsresult rv;
|
||||
nsresult res = NS_OK;
|
||||
|
||||
nsIPresShell* shell = aPresContext->PresShell();
|
||||
|
||||
for (frame = aCurrentFrame;
|
||||
frame && frame != aNextInFlow;
|
||||
frame = frame->GetNextSibling()) {
|
||||
rv = NS_ERROR_FAILURE;
|
||||
directionalFrame = nsnull;
|
||||
const nsStyleDisplay* display = frame->GetStyleDisplay();
|
||||
|
||||
if (aAddMarkers && !display->IsBlockLevel() ) {
|
||||
|
@ -382,22 +386,23 @@ nsBidiPresUtils::InitLogicalArray(nsPresContext* aPresContext,
|
|||
break;
|
||||
case NS_STYLE_UNICODE_BIDI_EMBED:
|
||||
if (NS_STYLE_DIRECTION_RTL == vis->mDirection) {
|
||||
rv = NS_NewDirectionalFrame(&directionalFrame, kRLE);
|
||||
directionalFrame = NS_NewDirectionalFrame(shell, kRLE);
|
||||
}
|
||||
else if (NS_STYLE_DIRECTION_LTR == vis->mDirection) {
|
||||
rv = NS_NewDirectionalFrame(&directionalFrame, kLRE);
|
||||
directionalFrame = NS_NewDirectionalFrame(shell, kLRE);
|
||||
}
|
||||
break;
|
||||
case NS_STYLE_UNICODE_BIDI_OVERRIDE:
|
||||
if (NS_STYLE_DIRECTION_RTL == vis->mDirection) {
|
||||
rv = NS_NewDirectionalFrame(&directionalFrame, kRLO);
|
||||
directionalFrame = NS_NewDirectionalFrame(shell, kRLO);
|
||||
}
|
||||
else if (NS_STYLE_DIRECTION_LTR == vis->mDirection) {
|
||||
rv = NS_NewDirectionalFrame(&directionalFrame, kLRO);
|
||||
directionalFrame = NS_NewDirectionalFrame(shell, kLRO);
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (NS_SUCCEEDED(rv) ) {
|
||||
|
||||
if (directionalFrame) {
|
||||
mLogicalFrames.AppendElement(directionalFrame);
|
||||
}
|
||||
}
|
||||
|
@ -426,9 +431,10 @@ nsBidiPresUtils::InitLogicalArray(nsPresContext* aPresContext,
|
|||
}
|
||||
|
||||
// If the element is attributed by dir, indicate direction pop (add PDF frame)
|
||||
if (NS_SUCCEEDED(rv) ) {
|
||||
rv = NS_NewDirectionalFrame(&directionalFrame, kPDF);
|
||||
if (NS_SUCCEEDED(rv) ) {
|
||||
if (directionalFrame) {
|
||||
directionalFrame = NS_NewDirectionalFrame(shell, kPDF);
|
||||
|
||||
if (directionalFrame) {
|
||||
mLogicalFrames.AppendElement(directionalFrame);
|
||||
}
|
||||
}
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -195,21 +195,17 @@ NS_IMPL_ISUPPORTS1(nsComboButtonListener, nsIDOMMouseListener)
|
|||
// static class data member for Bug 32920
|
||||
nsComboboxControlFrame * nsComboboxControlFrame::mFocused = nsnull;
|
||||
|
||||
nsresult
|
||||
NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aStateFlags)
|
||||
nsIFrame*
|
||||
NS_NewComboboxControlFrame(nsIPresShell* aPresShell, PRUint32 aStateFlags)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsComboboxControlFrame* it = new (aPresShell) nsComboboxControlFrame;
|
||||
if (!it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
if (it) {
|
||||
// set the state flags (if any are provided)
|
||||
it->AddStateBits(aStateFlags);
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return it;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
@ -2027,9 +2023,10 @@ nsComboboxControlFrame::CreateDisplayFrame(nsPresContext* aPresContext)
|
|||
nsIPresShell *shell = aPresContext->PresShell();
|
||||
nsStyleSet *styleSet = shell->StyleSet();
|
||||
|
||||
nsresult rv = NS_NewBlockFrame(shell, (nsIFrame**)&mDisplayFrame, NS_BLOCK_SPACE_MGR);
|
||||
if (NS_FAILED(rv)) { return rv; }
|
||||
if (!mDisplayFrame) { return NS_ERROR_NULL_POINTER; }
|
||||
mDisplayFrame = NS_NewBlockFrame(shell, NS_BLOCK_SPACE_MGR);
|
||||
if (NS_UNLIKELY(!mDisplayFrame)) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
// create the style context for the anonymous frame
|
||||
nsRefPtr<nsStyleContext> styleContext;
|
||||
|
@ -2039,9 +2036,11 @@ nsComboboxControlFrame::CreateDisplayFrame(nsPresContext* aPresContext)
|
|||
if (!styleContext) { return NS_ERROR_NULL_POINTER; }
|
||||
|
||||
// create a text frame and put it inside the block frame
|
||||
rv = NS_NewTextFrame(shell, &mTextFrame);
|
||||
if (NS_FAILED(rv)) { return rv; }
|
||||
if (!mTextFrame) { return NS_ERROR_NULL_POINTER; }
|
||||
mTextFrame = NS_NewTextFrame(shell);
|
||||
if (NS_UNLIKELY(!mTextFrame)) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
nsRefPtr<nsStyleContext> textStyleContext;
|
||||
textStyleContext = styleSet->ResolveStyleForNonElement(styleContext);
|
||||
if (!textStyleContext) { return NS_ERROR_NULL_POINTER; }
|
||||
|
@ -2051,7 +2050,7 @@ nsComboboxControlFrame::CreateDisplayFrame(nsPresContext* aPresContext)
|
|||
|
||||
aPresContext->FrameManager()->SetPrimaryFrameFor(content, mTextFrame);
|
||||
|
||||
rv = mDisplayFrame->Init(aPresContext, mContent, this, styleContext, nsnull);
|
||||
nsresult rv = mDisplayFrame->Init(aPresContext, mContent, this, styleContext, nsnull);
|
||||
if (NS_FAILED(rv)) { return rv; }
|
||||
|
||||
mDisplayFrame->SetInitialChildList(aPresContext, nsnull, mTextFrame);
|
||||
|
@ -2153,9 +2152,10 @@ nsComboboxControlFrame::CreateFrameFor(nsPresContext* aPresContext,
|
|||
nsStyleSet *styleSet = shell->StyleSet();
|
||||
|
||||
// Start by by creating a containing frame
|
||||
nsresult rv = NS_NewBlockFrame(shell, (nsIFrame**)&mDisplayFrame, NS_BLOCK_SPACE_MGR);
|
||||
if (NS_FAILED(rv)) { return rv; }
|
||||
if (!mDisplayFrame) { return NS_ERROR_NULL_POINTER; }
|
||||
mDisplayFrame = NS_NewBlockFrame(shell, NS_BLOCK_SPACE_MGR);
|
||||
if (NS_UNLIKELY(!mDisplayFrame)) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
// create the style context for the anonymous block frame
|
||||
nsRefPtr<nsStyleContext> styleContext;
|
||||
|
@ -2165,9 +2165,11 @@ nsComboboxControlFrame::CreateFrameFor(nsPresContext* aPresContext,
|
|||
if (!styleContext) { return NS_ERROR_NULL_POINTER; }
|
||||
|
||||
// Create a text frame and put it inside the block frame
|
||||
rv = NS_NewTextFrame(shell, &mTextFrame);
|
||||
if (NS_FAILED(rv)) { return rv; }
|
||||
if (!mTextFrame) { return NS_ERROR_NULL_POINTER; }
|
||||
mTextFrame = NS_NewTextFrame(shell);
|
||||
if (NS_UNLIKELY(!mTextFrame)) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
nsRefPtr<nsStyleContext> textStyleContext;
|
||||
textStyleContext = styleSet->ResolveStyleForNonElement(styleContext);
|
||||
if (!textStyleContext) { return NS_ERROR_NULL_POINTER; }
|
||||
|
@ -2183,7 +2185,7 @@ nsComboboxControlFrame::CreateFrameFor(nsPresContext* aPresContext,
|
|||
frameManager->SetPrimaryFrameFor(content, mTextFrame);
|
||||
*/
|
||||
|
||||
rv = mDisplayFrame->Init(aPresContext, mContent, this, styleContext, nsnull);
|
||||
nsresult rv = mDisplayFrame->Init(aPresContext, mContent, this, styleContext, nsnull);
|
||||
if (NS_FAILED(rv)) { return rv; }
|
||||
|
||||
mDisplayFrame->SetInitialChildList(aPresContext, nsnull, mTextFrame);
|
||||
|
|
|
@ -87,7 +87,7 @@ class nsComboboxControlFrame : public nsAreaFrame,
|
|||
public nsIStatefulFrame
|
||||
{
|
||||
public:
|
||||
friend nsresult NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aFlags);
|
||||
friend nsIFrame* NS_NewComboboxControlFrame(nsIPresShell* aPresShell, PRUint32 aFlags);
|
||||
friend class RedisplayTextEvent;
|
||||
|
||||
nsComboboxControlFrame();
|
||||
|
|
|
@ -126,23 +126,17 @@ protected:
|
|||
nscoord mLegendSpace;
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aStateFlags)
|
||||
nsIFrame*
|
||||
NS_NewFieldSetFrame(nsIPresShell* aPresShell, PRUint32 aStateFlags)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsFieldSetFrame* it = new (aPresShell) nsFieldSetFrame;
|
||||
if (!it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
if (it) {
|
||||
// set the state flags (if any are provided)
|
||||
it->AddStateBits(aStateFlags);
|
||||
}
|
||||
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return it;
|
||||
}
|
||||
|
||||
nsFieldSetFrame::nsFieldSetFrame()
|
||||
|
|
|
@ -77,19 +77,10 @@
|
|||
#define SYNC_BUTTON 0x2
|
||||
#define SYNC_BOTH 0x3
|
||||
|
||||
nsresult
|
||||
NS_NewFileControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewFileControlFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsFileControlFrame* it = new (aPresShell) nsFileControlFrame();
|
||||
if (!it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsFileControlFrame();
|
||||
}
|
||||
|
||||
nsFileControlFrame::nsFileControlFrame():
|
||||
|
|
|
@ -66,19 +66,10 @@ nsGfxButtonControlFrame::nsGfxButtonControlFrame()
|
|||
mSuggestedHeight = kSuggestedNotSet;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsGfxButtonControlFrame* it = new (aPresShell) nsGfxButtonControlFrame;
|
||||
if (!it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsGfxButtonControlFrame;
|
||||
}
|
||||
|
||||
nsIAtom*
|
||||
|
@ -221,9 +212,11 @@ nsGfxButtonControlFrame::CreateFrameFor(nsPresContext* aPresContext,
|
|||
nsIFrame * parentFrame = mFrames.FirstChild();
|
||||
nsStyleContext* styleContext = parentFrame->GetStyleContext();
|
||||
|
||||
rv = NS_NewTextFrame(aPresContext->PresShell(), &newFrame);
|
||||
if (NS_FAILED(rv)) { return rv; }
|
||||
if (!newFrame) { return NS_ERROR_NULL_POINTER; }
|
||||
newFrame = NS_NewTextFrame(aPresContext->PresShell());
|
||||
if (NS_UNLIKELY(!newFrame)) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
nsRefPtr<nsStyleContext> textStyleContext;
|
||||
textStyleContext = aPresContext->StyleSet()->
|
||||
ResolveStyleForNonElement(styleContext);
|
||||
|
|
|
@ -57,19 +57,10 @@
|
|||
|
||||
|
||||
//------------------------------------------------------------
|
||||
nsresult
|
||||
NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsGfxCheckboxControlFrame* it = new (aPresShell) nsGfxCheckboxControlFrame;
|
||||
if (!it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsGfxCheckboxControlFrame;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -53,19 +53,10 @@
|
|||
#include "nsIDOMNode.h"
|
||||
#include "nsITheme.h"
|
||||
|
||||
nsresult
|
||||
NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsGfxRadioControlFrame* it = new (aPresShell) nsGfxRadioControlFrame;
|
||||
if (!it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsGfxRadioControlFrame;
|
||||
}
|
||||
|
||||
nsGfxRadioControlFrame::nsGfxRadioControlFrame()
|
||||
|
|
|
@ -153,25 +153,17 @@ private:
|
|||
};
|
||||
|
||||
//---------------------------------------------------------
|
||||
nsresult
|
||||
NS_NewListControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewListControlFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsListControlFrame* it =
|
||||
new (aPresShell) nsListControlFrame(aPresShell, aPresShell->GetDocument());
|
||||
if (!it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
if (it) {
|
||||
it->AddStateBits(NS_FRAME_INDEPENDENT_SELECTION);
|
||||
#if 0
|
||||
// set the state flags (if any are provided)
|
||||
it->AddStateBits(NS_BLOCK_SPACE_MGR);
|
||||
#endif
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return it;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
|
|
@ -79,7 +79,7 @@ class nsListControlFrame : public nsHTMLScrollFrame,
|
|||
public nsISelectControlFrame
|
||||
{
|
||||
public:
|
||||
friend nsresult NS_NewListControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
friend nsIFrame* NS_NewListControlFrame(nsIPresShell* aPresShell);
|
||||
|
||||
// nsISupports
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
|
|
@ -41,22 +41,18 @@
|
|||
#include "nsIContent.h"
|
||||
#include "nsListControlFrame.h"
|
||||
|
||||
nsresult
|
||||
NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsIFrame** aNewFrame, PRUint32 aFlags)
|
||||
nsIFrame*
|
||||
NS_NewSelectsAreaFrame(nsIPresShell* aShell, PRUint32 aFlags)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsSelectsAreaFrame* it = new (aShell) nsSelectsAreaFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
if (it) {
|
||||
// We need NS_BLOCK_SPACE_MGR to ensure that the options inside the select
|
||||
// aren't expanded by right floats outside the select.
|
||||
it->SetFlags(aFlags | NS_BLOCK_SPACE_MGR);
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return it;
|
||||
}
|
||||
|
||||
/*NS_IMETHODIMP
|
||||
|
|
|
@ -49,7 +49,7 @@ class nsIContent;
|
|||
class nsSelectsAreaFrame : public nsAreaFrame
|
||||
{
|
||||
public:
|
||||
friend nsresult NS_NewSelectsAreaFrame(nsIPresShell* aShell, nsIFrame** aResult, PRUint32 aFlags);
|
||||
friend nsIFrame* NS_NewSelectsAreaFrame(nsIPresShell* aShell, PRUint32 aFlags);
|
||||
|
||||
// nsISupports
|
||||
//NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
|
|
@ -90,29 +90,10 @@ nsDirectionalFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
|||
return rv;
|
||||
}
|
||||
|
||||
void*
|
||||
nsDirectionalFrame::operator new(size_t aSize) CPP_THROW_NEW
|
||||
nsIFrame*
|
||||
NS_NewDirectionalFrame(nsIPresShell* aPresShell, PRUnichar aChar)
|
||||
{
|
||||
void* frame = ::operator new(aSize);
|
||||
if (frame) {
|
||||
memset(frame, 0, aSize);
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewDirectionalFrame(nsIFrame** aNewFrame, PRUnichar aChar)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsDirectionalFrame* frame = new nsDirectionalFrame(aChar);
|
||||
*aNewFrame = frame;
|
||||
if (nsnull == frame) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsDirectionalFrame(aChar);
|
||||
}
|
||||
|
||||
#endif /* IBMBIDI */
|
||||
|
|
|
@ -57,8 +57,6 @@ protected:
|
|||
public:
|
||||
nsDirectionalFrame(PRUnichar aChar);
|
||||
|
||||
void* operator new(size_t aSize) CPP_THROW_NEW;
|
||||
|
||||
static const nsIID& GetIID();
|
||||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
|
|
@ -260,20 +260,14 @@ RecordReflowStatus(PRBool aChildIsBlock, nsReflowStatus aFrameReflowStatus)
|
|||
|
||||
const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID;
|
||||
|
||||
nsresult
|
||||
NS_NewBlockFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aFlags)
|
||||
nsIFrame*
|
||||
NS_NewBlockFrame(nsIPresShell* aPresShell, PRUint32 aFlags)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsBlockFrame* it = new (aPresShell) nsBlockFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
if (it) {
|
||||
it->SetFlags(aFlags);
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
}
|
||||
return it;
|
||||
}
|
||||
|
||||
nsBlockFrame::nsBlockFrame()
|
||||
|
|
|
@ -131,7 +131,7 @@ public:
|
|||
const_reverse_line_iterator rbegin_lines() const { return mLines.rbegin(); }
|
||||
const_reverse_line_iterator rend_lines() const { return mLines.rend(); }
|
||||
|
||||
friend nsresult NS_NewBlockFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aFlags);
|
||||
friend nsIFrame* NS_NewBlockFrame(nsIPresShell* aPresShell, PRUint32 aFlags);
|
||||
|
||||
// nsISupports
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
|
|
@ -138,21 +138,16 @@ protected:
|
|||
*
|
||||
* XXX should we support CSS columns applied to table elements?
|
||||
*/
|
||||
nsresult
|
||||
NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aStateFlags)
|
||||
nsIFrame*
|
||||
NS_NewColumnSetFrame(nsIPresShell* aPresShell, PRUint32 aStateFlags)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
|
||||
nsColumnSetFrame* it = new (aPresShell) nsColumnSetFrame;
|
||||
if (!it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
if (it) {
|
||||
// set the state flags (if any are provided)
|
||||
it->AddStateBits(aStateFlags);
|
||||
}
|
||||
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return it;
|
||||
}
|
||||
|
||||
nsColumnSetFrame::nsColumnSetFrame()
|
||||
|
|
|
@ -90,19 +90,10 @@ protected:
|
|||
void DrainOverflowFrames(nsPresContext* aPresContext);
|
||||
};
|
||||
|
||||
nsresult
|
||||
NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewFirstLetterFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsFirstLetterFrame* it = new (aPresShell) nsFirstLetterFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsFirstLetterFrame;
|
||||
}
|
||||
|
||||
nsFirstLetterFrame::nsFirstLetterFrame()
|
||||
|
|
|
@ -87,19 +87,10 @@ static const char kEventQueueServiceCID[] = NS_EVENTQUEUESERVICE_CONTRACTID;
|
|||
|
||||
//----------nsHTMLScrollFrame-------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRBool aIsRoot)
|
||||
nsIFrame*
|
||||
NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, PRBool aIsRoot)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsHTMLScrollFrame* it = new (aPresShell) nsHTMLScrollFrame(aPresShell, aIsRoot);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsHTMLScrollFrame(aPresShell, aIsRoot);
|
||||
}
|
||||
|
||||
nsHTMLScrollFrame::nsHTMLScrollFrame(nsIPresShell* aShell, PRBool aIsRoot)
|
||||
|
@ -940,19 +931,10 @@ NS_INTERFACE_MAP_END_INHERITING(nsHTMLContainerFrame)
|
|||
|
||||
//----------nsXULScrollFrame-------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_NewXULScrollFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRBool aIsRoot)
|
||||
nsIFrame*
|
||||
NS_NewXULScrollFrame(nsIPresShell* aPresShell, PRBool aIsRoot)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsXULScrollFrame* it = new (aPresShell) nsXULScrollFrame(aPresShell, aIsRoot);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsXULScrollFrame(aPresShell, aIsRoot);
|
||||
}
|
||||
|
||||
nsXULScrollFrame::nsXULScrollFrame(nsIPresShell* aShell, PRBool aIsRoot)
|
||||
|
|
|
@ -182,8 +182,7 @@ class nsHTMLScrollFrame : public nsHTMLContainerFrame,
|
|||
public nsIAnonymousContentCreator,
|
||||
public nsIStatefulFrame {
|
||||
public:
|
||||
friend nsresult NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame,
|
||||
PRBool aIsRoot);
|
||||
friend nsIFrame* NS_NewHTMLScrollFrame(nsIPresShell* aPresShell, PRBool aIsRoot);
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
|
@ -333,8 +332,7 @@ class nsXULScrollFrame : public nsBoxFrame,
|
|||
public nsIAnonymousContentCreator,
|
||||
public nsIStatefulFrame {
|
||||
public:
|
||||
friend nsresult NS_NewXULScrollFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame,
|
||||
PRBool aIsRoot);
|
||||
friend nsIFrame* NS_NewXULScrollFrame(nsIPresShell* aPresShell, PRBool aIsRoot);
|
||||
|
||||
// Called to set the child frames. We typically have three: the scroll area,
|
||||
// the vertical scrollbar, and the horizontal scrollbar.
|
||||
|
|
|
@ -158,19 +158,10 @@ private:
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_NewCanvasFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewCanvasFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
CanvasFrame* it = new (aPresShell)CanvasFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell)CanvasFrame;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
|
|
@ -83,9 +83,8 @@ NS_NewFrameContentIterator(nsPresContext* aPresContext,
|
|||
// policies.
|
||||
|
||||
// Create a frame that supports "display: block" layout behavior
|
||||
nsresult
|
||||
NS_NewBlockFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame,
|
||||
PRUint32 aFlags = 0);
|
||||
nsIFrame*
|
||||
NS_NewBlockFrame(nsIPresShell* aPresShell, PRUint32 aFlags = 0);
|
||||
|
||||
// Special Generated Content Frame
|
||||
nsresult
|
||||
|
@ -97,19 +96,17 @@ NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager,
|
|||
// return the option frame
|
||||
// By default, area frames will extend
|
||||
// their height to cover any children that "stick out".
|
||||
nsresult
|
||||
NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame,
|
||||
PRUint32 aFlags);
|
||||
nsIFrame*
|
||||
NS_NewSelectsAreaFrame(nsIPresShell* aPresShell, PRUint32 aFlags);
|
||||
|
||||
// Create a basic area frame.
|
||||
nsIFrame*
|
||||
NS_NewAreaFrame(nsIPresShell* aPresShell, PRUint32 aFlags);
|
||||
|
||||
// These AreaFrame's shrink wrap around their contents
|
||||
inline nsresult
|
||||
NS_NewTableCellInnerFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) {
|
||||
return NS_NewBlockFrame(aPresShell, aNewFrame,
|
||||
NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
|
||||
inline nsIFrame*
|
||||
NS_NewTableCellInnerFrame(nsIPresShell* aPresShell) {
|
||||
return NS_NewBlockFrame(aPresShell, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT);
|
||||
}
|
||||
|
||||
// This type of AreaFrame is the document root, a margin root, and the
|
||||
|
@ -141,8 +138,8 @@ NS_NewRelativeItemWrapperFrame(nsIPresShell* aPresShell) {
|
|||
nsIFrame*
|
||||
NS_NewBRFrame(nsIPresShell* aPresShell);
|
||||
|
||||
nsresult
|
||||
NS_NewCommentFrame(nsIPresShell* aPresShell, nsIFrame** aFrameResult);
|
||||
nsIFrame*
|
||||
NS_NewCommentFrame(nsIPresShell* aPresShell);
|
||||
|
||||
// <frame> and <iframe>
|
||||
nsIFrame*
|
||||
|
@ -151,24 +148,24 @@ NS_NewSubDocumentFrame(nsIPresShell* aPresShell);
|
|||
nsIFrame*
|
||||
NS_NewHTMLFramesetFrame(nsIPresShell* aPresShell);
|
||||
|
||||
nsresult
|
||||
NS_NewViewportFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
nsresult
|
||||
NS_NewCanvasFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
nsIFrame*
|
||||
NS_NewViewportFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewCanvasFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewImageFrame(nsIPresShell* aPresShell);
|
||||
nsresult
|
||||
NS_NewInlineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
nsresult
|
||||
NS_NewPositionedInlineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
nsIFrame*
|
||||
NS_NewInlineFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewPositionedInlineFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewObjectFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewSpacerFrame(nsIPresShell* aPresShell);
|
||||
nsresult
|
||||
NS_NewTextFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsIFrame*
|
||||
NS_NewTextFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewContinuingTextFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewEmptyFrame(nsIPresShell* aPresShell);
|
||||
inline nsIFrame*
|
||||
|
@ -176,78 +173,77 @@ NS_NewWBRFrame(nsIPresShell* aPresShell) {
|
|||
return NS_NewEmptyFrame(aPresShell);
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewColumnSetFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aStateFlags );
|
||||
nsIFrame*
|
||||
NS_NewColumnSetFrame(nsIPresShell* aPresShell, PRUint32 aStateFlags );
|
||||
|
||||
nsresult
|
||||
NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewPageFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewPageContentFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewFirstLetterFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
nsresult
|
||||
NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
nsIFrame*
|
||||
NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewPageFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewPageContentFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewPageBreakFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewFirstLetterFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewFirstLineFrame(nsIPresShell* aPresShell);
|
||||
|
||||
// forms
|
||||
nsresult
|
||||
NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsIFrame*
|
||||
NS_NewGfxButtonControlFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewNativeButtonControlFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewImageControlFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewHTMLButtonControlFrame(nsIPresShell* aPresShell);
|
||||
nsresult
|
||||
NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewNativeCheckboxControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsIFrame** aResult, PRUint32 aFlags);
|
||||
nsresult
|
||||
NS_NewFileControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsIFrame*
|
||||
NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewNativeCheckboxControlFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewFieldSetFrame(nsIPresShell* aPresShell, PRUint32 aFlags);
|
||||
nsIFrame*
|
||||
NS_NewFileControlFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewLegendFrame(nsIPresShell* aPresShell);
|
||||
nsresult
|
||||
NS_NewNativeTextControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
nsIFrame*
|
||||
NS_NewNativeTextControlFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewTextControlFrame(nsIPresShell* aPresShell);
|
||||
nsresult
|
||||
NS_NewGfxAutoTextControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
nsresult
|
||||
NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewNativeRadioControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewListControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewComboboxControlFrame(nsIPresShell* aPresShell, nsIFrame** aResult, PRUint32 aFlags);
|
||||
nsIFrame*
|
||||
NS_NewGfxAutoTextControlFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewNativeRadioControlFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewNativeSelectControlFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewListControlFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewComboboxControlFrame(nsIPresShell* aPresShell, PRUint32 aFlags);
|
||||
nsIFrame*
|
||||
NS_NewIsIndexFrame(nsIPresShell* aPresShell);
|
||||
|
||||
// Table frame factories
|
||||
nsresult
|
||||
NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewTableFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
|
||||
nsresult
|
||||
NS_NewTableColFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewTableRowFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
nsresult
|
||||
NS_NewTableCellFrame(nsIPresShell* aPresShell, PRBool aIsBorderCollapse, nsIFrame** aResult);
|
||||
nsIFrame*
|
||||
NS_NewTableOuterFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewTableFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewTableCaptionFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewTableColFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewTableColGroupFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewTableRowFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewTableRowGroupFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewTableCellFrame(nsIPresShell* aPresShell, PRBool aIsBorderCollapse);
|
||||
|
||||
nsresult
|
||||
NS_NewHTMLContentSink(nsIHTMLContentSink** aInstancePtrResult,
|
||||
|
|
|
@ -67,19 +67,10 @@ NS_DEFINE_IID(kInlineFrameCID, NS_INLINE_FRAME_CID);
|
|||
|
||||
// Basic nsInlineFrame methods
|
||||
|
||||
nsresult
|
||||
NS_NewInlineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewInlineFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsInlineFrame* it = new (aPresShell) nsInlineFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsInlineFrame;
|
||||
}
|
||||
|
||||
nsInlineFrame::nsInlineFrame()
|
||||
|
@ -895,19 +886,10 @@ ReParentChildListStyle(nsPresContext* aPresContext,
|
|||
}
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewFirstLineFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aNewFrame, "null ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsInlineFrame* it = new (aPresShell) nsFirstLineFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsFirstLineFrame;
|
||||
}
|
||||
|
||||
nsFirstLineFrame::nsFirstLineFrame()
|
||||
|
@ -1057,19 +1039,10 @@ nsFirstLineFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
nsresult
|
||||
NS_NewPositionedInlineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewPositionedInlineFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsPositionedInlineFrame* it = new (aPresShell) nsPositionedInlineFrame();
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsPositionedInlineFrame();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -68,7 +68,7 @@ class nsAnonymousBlockFrame;
|
|||
class nsInlineFrame : public nsInlineFrameSuper
|
||||
{
|
||||
public:
|
||||
friend nsresult NS_NewInlineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
friend nsIFrame* NS_NewInlineFrame(nsIPresShell* aPresShell);
|
||||
|
||||
// nsISupports overrides
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
@ -166,7 +166,7 @@ protected:
|
|||
*/
|
||||
class nsFirstLineFrame : public nsInlineFrame {
|
||||
public:
|
||||
friend nsresult NS_NewFirstLineFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
friend nsIFrame* NS_NewFirstLineFrame(nsIPresShell* aPresShell);
|
||||
|
||||
#ifdef DEBUG
|
||||
NS_IMETHOD GetFrameName(nsAString& aResult) const;
|
||||
|
|
|
@ -1194,9 +1194,11 @@ nsObjectFrame::CreateDefaultFrames(nsPresContext *aPresContext,
|
|||
nsIFrame *textFrame = nsnull;
|
||||
|
||||
do {
|
||||
rv = NS_NewBlockFrame(shell, &anchorFrame);
|
||||
if (NS_FAILED(rv))
|
||||
anchorFrame = NS_NewBlockFrame(shell);
|
||||
if (NS_UNLIKELY(!anchorFrame)) {
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
break;
|
||||
}
|
||||
|
||||
rv = anchorFrame->Init(aPresContext, anchor, this, anchorStyleContext, PR_FALSE);
|
||||
if (NS_FAILED(rv))
|
||||
|
@ -1218,9 +1220,11 @@ nsObjectFrame::CreateDefaultFrames(nsPresContext *aPresContext,
|
|||
nsHTMLContainerFrame::CreateViewForFrame(imgFrame, anchorFrame, PR_FALSE);
|
||||
anchorFrame->AppendFrames(nsnull, imgFrame);
|
||||
|
||||
rv = NS_NewTextFrame(shell, &textFrame);
|
||||
if (NS_FAILED(rv))
|
||||
textFrame = NS_NewTextFrame(shell);
|
||||
if (NS_UNLIKELY(!textFrame)) {
|
||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||
break;
|
||||
}
|
||||
|
||||
rv = textFrame->Init(aPresContext, text, anchorFrame, textStyleContext,
|
||||
PR_FALSE);
|
||||
|
|
|
@ -53,17 +53,10 @@
|
|||
#endif
|
||||
|
||||
|
||||
nsresult
|
||||
NS_NewPageContentFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewPageContentFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
|
||||
nsPageContentFrame* it = new (aPresShell) nsPageContentFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsPageContentFrame;
|
||||
}
|
||||
|
||||
nsPageContentFrame::nsPageContentFrame() :
|
||||
|
|
|
@ -45,7 +45,7 @@ class nsSharedPageData;
|
|||
class nsPageContentFrame : public ViewportFrame {
|
||||
|
||||
public:
|
||||
friend nsresult NS_NewPageContentFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
friend nsIFrame* NS_NewPageContentFrame(nsIPresShell* aPresShell);
|
||||
friend class nsPageFrame;
|
||||
|
||||
// nsIFrame
|
||||
|
|
|
@ -94,17 +94,10 @@ extern PRLogModuleInfo * kLayoutPrintingLogMod;
|
|||
// XXX Part of Temporary fix for Bug 127263
|
||||
PRBool nsPageFrame::mDoCreateWidget = PR_TRUE;
|
||||
|
||||
nsresult
|
||||
NS_NewPageFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewPageFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
|
||||
nsPageFrame* it = new (aPresShell) nsPageFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsPageFrame;
|
||||
}
|
||||
|
||||
nsPageFrame::nsPageFrame() :
|
||||
|
@ -691,21 +684,16 @@ nsPageFrame::SetSharedPageData(nsSharedPageData* aPD)
|
|||
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewPageBreakFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aPresShell && aNewFrame, "null PresShell or OUT ptr");
|
||||
NS_PRECONDITION(aPresShell, "null PresShell");
|
||||
#ifdef DEBUG
|
||||
//check that we are only creating page break frames when printing
|
||||
NS_ASSERTION(aPresShell->GetPresContext()->IsPaginated(), "created a page break frame while not printing");
|
||||
#endif
|
||||
|
||||
nsPageBreakFrame* it = new (aPresShell) nsPageBreakFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsPageBreakFrame;
|
||||
}
|
||||
|
||||
nsPageBreakFrame::nsPageBreakFrame()
|
||||
|
|
|
@ -47,7 +47,7 @@ class nsSharedPageData;
|
|||
class nsPageFrame : public nsContainerFrame {
|
||||
|
||||
public:
|
||||
friend nsresult NS_NewPageFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
friend nsIFrame* NS_NewPageFrame(nsIPresShell* aPresShell);
|
||||
|
||||
// nsIFrame
|
||||
NS_IMETHOD SetInitialChildList(nsPresContext* aPresContext,
|
||||
|
@ -172,7 +172,7 @@ protected:
|
|||
nsHTMLReflowMetrics& aDesiredSize);
|
||||
PRBool mHaveReflowed;
|
||||
|
||||
friend nsresult NS_NewPageBreakFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
friend nsIFrame* NS_NewPageBreakFrame(nsIPresShell* aPresShell);
|
||||
};
|
||||
|
||||
#endif /* nsPageFrame_h___ */
|
||||
|
|
|
@ -42,19 +42,10 @@
|
|||
#include "nsLayoutAtoms.h"
|
||||
#include "nsFrameManager.h"
|
||||
|
||||
nsresult
|
||||
NS_NewPlaceholderFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewPlaceholderFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsPlaceholderFrame* it = new (aPresShell) nsPlaceholderFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsPlaceholderFrame;
|
||||
}
|
||||
|
||||
// These are useful for debugging
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
#include "nsSplittableFrame.h"
|
||||
#include "nsLayoutAtoms.h"
|
||||
|
||||
nsresult NS_NewPlaceholderFrame(nsIPresShell* aPresShell, nsIFrame** aInstancePtrResult);
|
||||
nsIFrame* NS_NewPlaceholderFrame(nsIPresShell* aPresShell);
|
||||
|
||||
/**
|
||||
* Implementation of a frame that's used as a placeholder for a frame that
|
||||
|
@ -51,7 +51,7 @@ public:
|
|||
/**
|
||||
* Create a new placeholder frame
|
||||
*/
|
||||
friend nsresult NS_NewPlaceholderFrame(nsIPresShell* aPresShell, nsIFrame** aInstancePtrResult);
|
||||
friend nsIFrame* NS_NewPlaceholderFrame(nsIPresShell* aPresShell);
|
||||
nsPlaceholderFrame();
|
||||
virtual ~nsPlaceholderFrame();
|
||||
|
||||
|
|
|
@ -106,19 +106,10 @@ nsSharedPageData::~nsSharedPageData()
|
|||
if (mDocURL) nsMemory::Free(mDocURL);
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsSimplePageSequenceFrame* it = new (aPresShell) nsSimplePageSequenceFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsSimplePageSequenceFrame;
|
||||
}
|
||||
|
||||
nsSimplePageSequenceFrame::nsSimplePageSequenceFrame() :
|
||||
|
|
|
@ -77,7 +77,7 @@ public:
|
|||
class nsSimplePageSequenceFrame : public nsContainerFrame,
|
||||
public nsIPageSequenceFrame {
|
||||
public:
|
||||
friend nsresult NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
friend nsIFrame* NS_NewSimplePageSequenceFrame(nsIPresShell* aPresShell);
|
||||
|
||||
// nsISupports
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
|
|
|
@ -1132,34 +1132,16 @@ VerifyNotDirty(state)
|
|||
#define DEBUG_VERIFY_NOT_DIRTY(state)
|
||||
#endif
|
||||
|
||||
nsresult
|
||||
NS_NewTextFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewTextFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsTextFrame* it = new (aPresShell) nsTextFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsTextFrame;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewContinuingTextFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewContinuingTextFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsContinuingTextFrame* it = new (aPresShell) nsContinuingTextFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsContinuingTextFrame;
|
||||
}
|
||||
|
||||
nsTextFrame::nsTextFrame()
|
||||
|
|
|
@ -45,19 +45,10 @@
|
|||
#include "nsReflowPath.h"
|
||||
#include "nsIPresShell.h"
|
||||
|
||||
nsresult
|
||||
NS_NewViewportFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewViewportFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
ViewportFrame* it = new (aPresShell) ViewportFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) ViewportFrame;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -80,22 +80,22 @@ NS_NewMathMLmmultiscriptsFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
|||
nsresult
|
||||
NS_NewMathMLmstyleFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
|
||||
nsresult
|
||||
NS_NewMathMLmtableOuterFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
inline nsresult
|
||||
NS_NewMathMLmtableFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewMathMLmtableOuterFrame(nsIPresShell* aPresShell);
|
||||
inline nsIFrame*
|
||||
NS_NewMathMLmtableFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
return NS_NewTableFrame(aPresShell, aNewFrame);
|
||||
return NS_NewTableFrame(aPresShell);
|
||||
}
|
||||
inline nsresult
|
||||
NS_NewMathMLmtrFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
inline nsIFrame*
|
||||
NS_NewMathMLmtrFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
return NS_NewTableRowFrame(aPresShell, aNewFrame);
|
||||
return NS_NewTableRowFrame(aPresShell);
|
||||
}
|
||||
nsresult
|
||||
NS_NewMathMLmtdFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
nsresult
|
||||
NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
nsIFrame*
|
||||
NS_NewMathMLmtdFrame(nsIPresShell* aPresShell);
|
||||
nsIFrame*
|
||||
NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell);
|
||||
nsresult
|
||||
NS_NewMathMLmsqrtFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
nsresult
|
||||
|
|
|
@ -359,19 +359,10 @@ NS_IMPL_ADDREF_INHERITED(nsMathMLmtableOuterFrame, nsMathMLFrame)
|
|||
NS_IMPL_RELEASE_INHERITED(nsMathMLmtableOuterFrame, nsMathMLFrame)
|
||||
NS_IMPL_QUERY_INTERFACE_INHERITED1(nsMathMLmtableOuterFrame, nsTableOuterFrame, nsMathMLFrame)
|
||||
|
||||
nsresult
|
||||
NS_NewMathMLmtableOuterFrame (nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewMathMLmtableOuterFrame (nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsMathMLmtableOuterFrame* it = new (aPresShell) nsMathMLmtableOuterFrame;
|
||||
if (!it)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsMathMLmtableOuterFrame;
|
||||
}
|
||||
|
||||
nsMathMLmtableOuterFrame::nsMathMLmtableOuterFrame()
|
||||
|
@ -587,19 +578,10 @@ NS_IMPL_ADDREF_INHERITED(nsMathMLmtdFrame, nsTableCellFrame)
|
|||
NS_IMPL_RELEASE_INHERITED(nsMathMLmtdFrame, nsTableCellFrame)
|
||||
NS_IMPL_QUERY_INTERFACE_INHERITED0(nsMathMLmtdFrame, nsTableCellFrame)
|
||||
|
||||
nsresult
|
||||
NS_NewMathMLmtdFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewMathMLmtdFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsMathMLmtdFrame* it = new (aPresShell) nsMathMLmtdFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsMathMLmtdFrame;
|
||||
}
|
||||
|
||||
nsMathMLmtdFrame::nsMathMLmtdFrame()
|
||||
|
@ -647,19 +629,10 @@ NS_IMPL_ADDREF_INHERITED(nsMathMLmtdInnerFrame, nsMathMLFrame)
|
|||
NS_IMPL_RELEASE_INHERITED(nsMathMLmtdInnerFrame, nsMathMLFrame)
|
||||
NS_IMPL_QUERY_INTERFACE_INHERITED1(nsMathMLmtdInnerFrame, nsBlockFrame, nsMathMLFrame)
|
||||
|
||||
nsresult
|
||||
NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsMathMLmtdInnerFrame* it = new (aPresShell) nsMathMLmtdInnerFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsMathMLmtdInnerFrame;
|
||||
}
|
||||
|
||||
nsMathMLmtdInnerFrame::nsMathMLmtdInnerFrame()
|
||||
|
|
|
@ -49,7 +49,7 @@ class nsMathMLmtableOuterFrame : public nsTableOuterFrame,
|
|||
public nsMathMLFrame
|
||||
{
|
||||
public:
|
||||
friend nsresult NS_NewMathMLmtableOuterFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
friend nsIFrame* NS_NewMathMLmtableOuterFrame(nsIPresShell* aPresShell);
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
|
@ -109,7 +109,7 @@ protected:
|
|||
class nsMathMLmtdFrame : public nsTableCellFrame
|
||||
{
|
||||
public:
|
||||
friend nsresult NS_NewMathMLmtdFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
friend nsIFrame* NS_NewMathMLmtdFrame(nsIPresShell* aPresShell);
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
|
@ -127,7 +127,7 @@ protected:
|
|||
class nsMathMLmtdInnerFrame : public nsBlockFrame,
|
||||
public nsMathMLFrame {
|
||||
public:
|
||||
friend nsresult NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
friend nsIFrame* NS_NewMathMLmtdInnerFrame(nsIPresShell* aPresShell);
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
|
|
|
@ -1138,22 +1138,14 @@ nsTableCellFrame::GetNextCellInColumn(nsITableCellLayout **aCellLayout)
|
|||
return CallQueryInterface(cellFrame, aCellLayout);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsIFrame*
|
||||
NS_NewTableCellFrame(nsIPresShell* aPresShell,
|
||||
PRBool aIsBorderCollapse,
|
||||
nsIFrame** aNewFrame)
|
||||
PRBool aIsBorderCollapse)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsTableCellFrame* it = (aIsBorderCollapse) ? new (aPresShell) nsBCTableCellFrame
|
||||
: new (aPresShell) nsTableCellFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
if (aIsBorderCollapse)
|
||||
return new (aPresShell) nsBCTableCellFrame;
|
||||
else
|
||||
return new (aPresShell) nsTableCellFrame;
|
||||
}
|
||||
|
||||
nsMargin*
|
||||
|
|
|
@ -115,13 +115,12 @@ public:
|
|||
|
||||
virtual PRBool NeedsToObserve(const nsHTMLReflowState& aReflowState);
|
||||
|
||||
/** instantiate a new instance of nsTableCellFrame.
|
||||
* @param aResult the new object is returned in this out-param
|
||||
/** instantiate a new instance of nsTableRowFrame.
|
||||
* @param aPresShell the pres shell for this frame
|
||||
*
|
||||
* @return NS_OK if the frame was properly allocated, otherwise an error code
|
||||
* @return the frame that was created
|
||||
*/
|
||||
friend nsresult
|
||||
NS_NewTableCellFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
friend nsIFrame* NS_NewTableCellFrame(nsIPresShell* aPresShell);
|
||||
|
||||
NS_IMETHOD Paint(nsPresContext* aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
|
|
|
@ -261,19 +261,10 @@ void nsTableColFrame::Dump(PRInt32 aIndent)
|
|||
#endif
|
||||
/* ----- global methods ----- */
|
||||
|
||||
nsresult
|
||||
NS_NewTableColFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewTableColFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsTableColFrame* it = new (aPresShell) nsTableColFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsTableColFrame;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -87,15 +87,12 @@ public:
|
|||
nsTableColType GetColType() const;
|
||||
void SetColType(nsTableColType aType);
|
||||
|
||||
/** instantiate a new instance of nsTableColFrame.
|
||||
* @param aResult the new object is returned in this out-param
|
||||
* @param aContent the table object to map
|
||||
* @param aParent the parent of the new frame
|
||||
/** instantiate a new instance of nsTableRowFrame.
|
||||
* @param aPresShell the pres shell for this frame
|
||||
*
|
||||
* @return NS_OK if the frame was properly allocated, otherwise an error code
|
||||
* @return the frame that was created
|
||||
*/
|
||||
friend nsresult
|
||||
NS_NewTableColFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
friend nsIFrame* NS_NewTableColFrame(nsIPresShell* aPresShell);
|
||||
|
||||
nsStyleCoord GetStyleWidth() const;
|
||||
|
||||
|
|
|
@ -579,19 +579,10 @@ void nsTableColGroupFrame::GetContinuousBCBorderWidth(float aPixelsToTwips,
|
|||
|
||||
/* ----- global methods ----- */
|
||||
|
||||
nsresult
|
||||
NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewTableColGroupFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsTableColGroupFrame* it = new (aPresShell) nsTableColGroupFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsTableColGroupFrame;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -62,13 +62,12 @@ public:
|
|||
|
||||
// default constructor supplied by the compiler
|
||||
|
||||
/** instantiate a new instance of nsTableColGroupFrame.
|
||||
* @param aResult the new object is returned in this out-param
|
||||
/** instantiate a new instance of nsTableRowFrame.
|
||||
* @param aPresShell the pres shell for this frame
|
||||
*
|
||||
* @return NS_OK if the frame was properly allocated, otherwise an error code
|
||||
* @return the frame that was created
|
||||
*/
|
||||
friend nsresult
|
||||
NS_NewTableColGroupFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
friend nsIFrame* NS_NewTableColGroupFrame(nsIPresShell* aPresShell);
|
||||
|
||||
/** sets defaults for the colgroup.
|
||||
* @see nsIFrame::Init
|
||||
|
|
|
@ -815,9 +815,8 @@ nsTableFrame::CreateAnonymousColGroupFrame(nsTableColGroupType aColGroupType)
|
|||
nsCSSAnonBoxes::tableColGroup,
|
||||
mStyleContext);
|
||||
// Create a col group frame
|
||||
nsIFrame* newFrame;
|
||||
nsresult result = NS_NewTableColGroupFrame(shell, &newFrame);
|
||||
if (NS_SUCCEEDED(result) && newFrame) {
|
||||
nsIFrame* newFrame = NS_NewTableColGroupFrame(shell);
|
||||
if (newFrame) {
|
||||
((nsTableColGroupFrame *)newFrame)->SetColType(aColGroupType);
|
||||
newFrame->Init(presContext, colGroupContent, this, colGroupStyle, nsnull);
|
||||
}
|
||||
|
@ -929,8 +928,7 @@ nsTableFrame::CreateAnonymousColFrames(nsTableColGroupFrame* aColGroupFrame,
|
|||
NS_ASSERTION(iContent, "null content in CreateAnonymousColFrames");
|
||||
|
||||
// create the new col frame
|
||||
nsIFrame* colFrame;
|
||||
NS_NewTableColFrame(shell, &colFrame);
|
||||
nsIFrame* colFrame = NS_NewTableColFrame(shell);
|
||||
((nsTableColFrame *) colFrame)->SetColType(aColType);
|
||||
colFrame->Init(presContext, iContent, aColGroupFrame,
|
||||
styleContext, nsnull);
|
||||
|
@ -4059,19 +4057,10 @@ nscoord nsTableFrame::GetAscent()
|
|||
}
|
||||
/* ----- global methods ----- */
|
||||
|
||||
nsresult
|
||||
NS_NewTableFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewTableFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsTableFrame* it = new (aPresShell) nsTableFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsTableFrame;
|
||||
}
|
||||
|
||||
NS_METHOD
|
||||
|
|
|
@ -181,15 +181,12 @@ public:
|
|||
/** nsTableOuterFrame has intimate knowledge of the inner table frame */
|
||||
friend class nsTableOuterFrame;
|
||||
|
||||
/** instantiate a new instance of nsTableFrame.
|
||||
* @param aResult the new object is returned in this out-param
|
||||
* @param aContent the table object to map
|
||||
* @param aParent the parent of the new frame
|
||||
/** instantiate a new instance of nsTableRowFrame.
|
||||
* @param aPresShell the pres shell for this frame
|
||||
*
|
||||
* @return NS_OK if the frame was properly allocated, otherwise an error code
|
||||
* @return the frame that was created
|
||||
*/
|
||||
friend nsresult
|
||||
NS_NewTableFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
friend nsIFrame* NS_NewTableFrame(nsIPresShell* aPresShell);
|
||||
|
||||
/** sets defaults for table-specific style.
|
||||
* @see nsIFrame::Init
|
||||
|
|
|
@ -87,20 +87,10 @@ nsTableCaptionFrame::GetType() const
|
|||
return nsLayoutAtoms::tableCaptionFrame;
|
||||
}
|
||||
|
||||
nsresult
|
||||
NS_NewTableCaptionFrame(nsIPresShell* aPresShell,
|
||||
nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewTableCaptionFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsTableCaptionFrame* it = new (aPresShell) nsTableCaptionFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsTableCaptionFrame;
|
||||
}
|
||||
|
||||
/* ----------- nsTableOuterFrame ---------- */
|
||||
|
@ -2176,19 +2166,10 @@ NS_IMETHODIMP nsTableOuterFrame::GetTableSize(PRInt32& aRowCount, PRInt32& aColC
|
|||
/*---------------- end of nsITableLayout implementation ------------------*/
|
||||
|
||||
|
||||
nsresult
|
||||
NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewTableOuterFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsTableOuterFrame* it = new (aPresShell) nsTableOuterFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsTableOuterFrame;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
|
@ -54,7 +54,7 @@ class nsTableCaptionFrame : public nsBlockFrame
|
|||
public:
|
||||
// nsISupports
|
||||
virtual nsIAtom* GetType() const;
|
||||
friend nsresult NS_NewTableCaptionFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
friend nsIFrame* NS_NewTableCaptionFrame(nsIPresShell* aPresShell);
|
||||
|
||||
protected:
|
||||
nsTableCaptionFrame();
|
||||
|
@ -78,13 +78,12 @@ public:
|
|||
// nsISupports
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
/** instantiate a new instance of nsTableOuterFrame.
|
||||
* @param aPresShell the presentation shell
|
||||
* @param aResult the new object is returned in this out-param
|
||||
/** instantiate a new instance of nsTableRowFrame.
|
||||
* @param aPresShell the pres shell for this frame
|
||||
*
|
||||
* @return NS_OK if the frame was properly allocated, otherwise an error code
|
||||
* @return the frame that was created
|
||||
*/
|
||||
friend nsresult NS_NewTableOuterFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
friend nsIFrame* NS_NewTableOuterFrame(nsIPresShell* aPresShell);
|
||||
|
||||
// nsIFrame overrides - see there for a description
|
||||
|
||||
|
|
|
@ -1611,19 +1611,10 @@ void nsTableRowFrame::SetContinuousBCBorderWidth(PRUint8 aForSide,
|
|||
|
||||
/* ----- global methods ----- */
|
||||
|
||||
nsresult
|
||||
NS_NewTableRowFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewTableRowFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsTableRowFrame* it = new (aPresShell) nsTableRowFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsTableRowFrame;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
|
|
|
@ -84,14 +84,11 @@ public:
|
|||
nsIFrame* aOldFrame);
|
||||
|
||||
/** instantiate a new instance of nsTableRowFrame.
|
||||
* @param aResult the new object is returned in this out-param
|
||||
* @param aContent the table object to map
|
||||
* @param aParent the parent of the new frame
|
||||
* @param aPresShell the pres shell for this frame
|
||||
*
|
||||
* @return NS_OK if the frame was properly allocated, otherwise an error code
|
||||
* @return the frame that was created
|
||||
*/
|
||||
friend nsresult
|
||||
NS_NewTableRowFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
friend nsIFrame* NS_NewTableRowFrame(nsIPresShell* aPresShell);
|
||||
|
||||
/** @see nsIFrame::Paint */
|
||||
NS_IMETHOD Paint(nsPresContext* aPresContext,
|
||||
|
|
|
@ -1751,19 +1751,10 @@ nsTableRowGroupFrame::GetType() const
|
|||
|
||||
/* ----- global methods ----- */
|
||||
|
||||
nsresult
|
||||
NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewTableRowGroupFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsTableRowGroupFrame* it = new (aPresShell) nsTableRowGroupFrame;
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
*aNewFrame = it;
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsTableRowGroupFrame;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -106,15 +106,12 @@ public:
|
|||
|
||||
// default constructor supplied by the compiler
|
||||
|
||||
/** instantiate a new instance of nsTableRowGroupFrame.
|
||||
* @param aResult the new object is returned in this out-param
|
||||
* @param aContent the table object to map
|
||||
* @param aParent the parent of the new frame
|
||||
/** instantiate a new instance of nsTableRowFrame.
|
||||
* @param aPresShell the pres shell for this frame
|
||||
*
|
||||
* @return NS_OK if the frame was properly allocated, otherwise an error code
|
||||
* @return the frame that was created
|
||||
*/
|
||||
friend nsresult
|
||||
NS_NewTableRowGroupFrame(nsIPresShell* aPresShell, nsIFrame** aResult);
|
||||
friend nsIFrame* NS_NewTableRowGroupFrame(nsIPresShell* aPresShell);
|
||||
virtual ~nsTableRowGroupFrame();
|
||||
|
||||
NS_IMETHOD Init(nsPresContext* aPresContext,
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
class nsDocElementBoxFrame : public nsBoxFrame, public nsIAnonymousContentCreator {
|
||||
public:
|
||||
|
||||
friend nsresult NS_NewBoxFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
friend nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell);
|
||||
|
||||
nsDocElementBoxFrame(nsIPresShell* aShell);
|
||||
|
||||
|
@ -93,21 +93,10 @@ public:
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_NewDocElementBoxFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewDocElementBoxFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsDocElementBoxFrame* it = new (aPresShell) nsDocElementBoxFrame (aPresShell);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
*aNewFrame = it;
|
||||
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsDocElementBoxFrame (aPresShell);
|
||||
}
|
||||
|
||||
nsDocElementBoxFrame::nsDocElementBoxFrame(nsIPresShell* aShell):nsBoxFrame(aShell, PR_TRUE)
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
class nsRootBoxFrame : public nsBoxFrame, public nsIRootBox {
|
||||
public:
|
||||
|
||||
friend nsresult NS_NewBoxFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame);
|
||||
friend nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell);
|
||||
|
||||
nsRootBoxFrame(nsIPresShell* aShell);
|
||||
|
||||
|
@ -118,21 +118,10 @@ protected:
|
|||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsresult
|
||||
NS_NewRootBoxFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
|
||||
nsIFrame*
|
||||
NS_NewRootBoxFrame(nsIPresShell* aPresShell)
|
||||
{
|
||||
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||
if (nsnull == aNewFrame) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsRootBoxFrame* it = new (aPresShell) nsRootBoxFrame (aPresShell);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
*aNewFrame = it;
|
||||
|
||||
return NS_OK;
|
||||
return new (aPresShell) nsRootBoxFrame (aPresShell);
|
||||
}
|
||||
|
||||
nsRootBoxFrame::nsRootBoxFrame(nsIPresShell* aShell):nsBoxFrame(aShell, PR_TRUE)
|
||||
|
|
Загрузка…
Ссылка в новой задаче