mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 06:11:37 +00:00
Frames no longet store the content index-in-parent
This commit is contained in:
parent
ea8c399672
commit
d477d86672
@ -82,7 +82,6 @@ public:
|
||||
* for the content.
|
||||
*/
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame) = 0;
|
||||
};
|
||||
|
||||
|
@ -38,7 +38,6 @@ public:
|
||||
*/
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame) = 0;
|
||||
};
|
||||
|
||||
|
@ -96,10 +96,9 @@ public:
|
||||
NS_IMETHOD GetContent(nsIContent*& aContent) const = 0;
|
||||
|
||||
/**
|
||||
* Get/Set the frame's index in parent.
|
||||
* Get the index in parent of the frame's content object
|
||||
*/
|
||||
NS_IMETHOD GetIndexInParent(PRInt32& aIndexInParent) const = 0;
|
||||
NS_IMETHOD SetIndexInParent(PRInt32 aIndexInParent) = 0;
|
||||
NS_IMETHOD GetContentIndex(PRInt32& aIndexInParent) const = 0;
|
||||
|
||||
/**
|
||||
* Get the style context associated with this frame. Note that GetStyleContext()
|
||||
|
@ -39,10 +39,8 @@ static NS_DEFINE_IID(kIStyleSpacingSID, NS_STYLESPACING_SID);
|
||||
static NS_DEFINE_IID(kIRunaroundIID, NS_IRUNAROUND_IID);
|
||||
static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID);
|
||||
|
||||
nsContainerFrame::nsContainerFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsSplittableFrame(aContent, aIndexInParent, aParent),
|
||||
nsContainerFrame::nsContainerFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsSplittableFrame(aContent, aParent),
|
||||
mLastContentIsComplete(PR_TRUE)
|
||||
{
|
||||
}
|
||||
@ -90,8 +88,7 @@ NS_METHOD nsContainerFrame::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
{
|
||||
nsIContentDelegate* contentDelegate = mContent->GetDelegate(aPresContext);
|
||||
|
||||
aContinuingFrame = contentDelegate->CreateFrame(aPresContext, mContent,
|
||||
mIndexInParent, aParent);
|
||||
aContinuingFrame = contentDelegate->CreateFrame(aPresContext, mContent, aParent);
|
||||
NS_RELEASE(contentDelegate);
|
||||
|
||||
PrepareContinuingFrame(aPresContext, aParent, (nsContainerFrame*)aContinuingFrame);
|
||||
@ -322,7 +319,8 @@ void nsContainerFrame::SetFirstContentOffset(const nsIFrame* aFirstChild)
|
||||
nsContainerFrame* pseudoFrame = (nsContainerFrame*)aFirstChild;
|
||||
mFirstContentOffset = pseudoFrame->mFirstContentOffset;
|
||||
} else {
|
||||
aFirstChild->GetIndexInParent(mFirstContentOffset);
|
||||
// XXX TROY Change API to pass in content index if possible...
|
||||
aFirstChild->GetContentIndex(mFirstContentOffset);
|
||||
}
|
||||
}
|
||||
|
||||
@ -344,7 +342,8 @@ void nsContainerFrame::SetLastContentOffset(const nsIFrame* aLastChild)
|
||||
#endif
|
||||
mLastContentIsComplete = pseudoFrame->mLastContentIsComplete;
|
||||
} else {
|
||||
aLastChild->GetIndexInParent(mLastContentOffset);
|
||||
// XXX TROY Change API to pass in content index if possible...
|
||||
aLastChild->GetContentIndex(mLastContentOffset);
|
||||
}
|
||||
#ifdef NS_DEBUG
|
||||
if (mLastContentOffset < mFirstContentOffset) {
|
||||
@ -1146,7 +1145,7 @@ NS_METHOD nsContainerFrame::VerifyTree() const
|
||||
} else {
|
||||
PRInt32 indexInParent;
|
||||
|
||||
child->GetIndexInParent(indexInParent);
|
||||
child->GetContentIndex(indexInParent);
|
||||
VERIFY_ASSERT(offset == indexInParent, "bad child offset");
|
||||
|
||||
nsIFrame* nextInFlow;
|
||||
@ -1275,7 +1274,7 @@ void nsContainerFrame::CheckContentOffsets()
|
||||
} else {
|
||||
PRInt32 indexInParent;
|
||||
|
||||
mFirstChild->GetIndexInParent(indexInParent);
|
||||
mFirstChild->GetContentIndex(indexInParent);
|
||||
if (indexInParent != mFirstContentOffset) {
|
||||
DumpTree();
|
||||
}
|
||||
@ -1296,7 +1295,7 @@ void nsContainerFrame::CheckContentOffsets()
|
||||
} else {
|
||||
PRInt32 indexInParent;
|
||||
|
||||
lastChild->GetIndexInParent(indexInParent);
|
||||
lastChild->GetContentIndex(indexInParent);
|
||||
NS_ASSERTION(indexInParent == mLastContentOffset, "bad last content offset");
|
||||
}
|
||||
}
|
||||
|
@ -190,9 +190,7 @@ public:
|
||||
protected:
|
||||
// Constructor. Takes as arguments the content object, the index in parent,
|
||||
// and the Frame for the content parent
|
||||
nsContainerFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
nsContainerFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
virtual ~nsContainerFrame();
|
||||
|
||||
@ -201,8 +199,8 @@ protected:
|
||||
* flow, sets its content offsets, mLastContentIsComplete, and style context.
|
||||
* Subclasses should invoke this method after construction of a continuing frame.
|
||||
*/
|
||||
void PrepareContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParent,
|
||||
void PrepareContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsContainerFrame* aContFrame);
|
||||
|
||||
|
||||
|
@ -67,16 +67,15 @@ NS_LAYOUT PRBool nsIFrame::GetShowFrameBorders()
|
||||
static NS_DEFINE_IID(kIFrameIID, NS_IFRAME_IID);
|
||||
|
||||
nsresult
|
||||
nsFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -92,11 +91,8 @@ void* nsFrame::operator new(size_t size)
|
||||
return result;
|
||||
}
|
||||
|
||||
nsFrame::nsFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: mContent(aContent), mIndexInParent(aIndexInParent), mContentParent(aParent),
|
||||
mGeometricParent(aParent)
|
||||
nsFrame::nsFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: mContent(aContent), mContentParent(aParent), mGeometricParent(aParent)
|
||||
{
|
||||
NS_ADDREF(mContent);
|
||||
}
|
||||
@ -178,15 +174,12 @@ NS_METHOD nsFrame::GetContent(nsIContent*& aContent) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsFrame::GetIndexInParent(PRInt32& aIndexInParent) const
|
||||
NS_METHOD nsFrame::GetContentIndex(PRInt32& aIndexInParent) const
|
||||
{
|
||||
aIndexInParent = mIndexInParent;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsFrame::SetIndexInParent(PRInt32 aIndexInParent)
|
||||
{
|
||||
mIndexInParent = aIndexInParent;
|
||||
nsIContent* parent = mContent->GetParent();
|
||||
|
||||
aIndexInParent = parent->IndexOf(mContent);
|
||||
NS_RELEASE(parent);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -923,7 +916,10 @@ NS_METHOD nsFrame::ListTag(FILE* out) const
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
fprintf(out, "(%d)@%p", mIndexInParent, this);
|
||||
PRInt32 contentIndex;
|
||||
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)@%p", contentIndex, this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -30,9 +30,8 @@ public:
|
||||
* Create a new "empty" frame that maps a given piece of content into a
|
||||
* 0,0 area.
|
||||
*/
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
@ -43,8 +42,7 @@ public:
|
||||
NS_IMETHOD DeleteFrame();
|
||||
|
||||
NS_IMETHOD GetContent(nsIContent*& aContent) const;
|
||||
NS_IMETHOD GetIndexInParent(PRInt32& aIndexInParent) const;
|
||||
NS_IMETHOD SetIndexInParent(PRInt32 aIndexInParent);
|
||||
NS_IMETHOD GetContentIndex(PRInt32& aIndexInParent) const;
|
||||
|
||||
NS_IMETHOD GetStyleContext(nsIPresContext* aContext, nsIStyleContext*& aStyleContext);
|
||||
NS_IMETHOD SetStyleContext(nsIPresContext* aPresContext, nsIStyleContext* aContext);
|
||||
@ -204,16 +202,13 @@ protected:
|
||||
|
||||
// Constructor. Takes as arguments the content object, the index in parent,
|
||||
// and the Frame for the content parent
|
||||
nsFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
nsFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
virtual ~nsFrame();
|
||||
|
||||
nsRect mRect;
|
||||
nsIContent* mContent;
|
||||
nsIStyleContext* mStyleContext;
|
||||
PRInt32 mIndexInParent;
|
||||
nsIFrame* mContentParent;
|
||||
nsIFrame* mGeometricParent;
|
||||
nsIFrame* mNextSibling; // singly linked list of frames
|
||||
|
@ -341,7 +341,7 @@ void PresShell::ResizeReflow(nscoord aWidth, nscoord aHeight)
|
||||
if (nsnull != root) {
|
||||
nsIContentDelegate* cd = root->GetDelegate(mPresContext);
|
||||
if (nsnull != cd) {
|
||||
mRootFrame = cd->CreateFrame(mPresContext, root, -1, nsnull);
|
||||
mRootFrame = cd->CreateFrame(mPresContext, root, nsnull);
|
||||
NS_RELEASE(cd);
|
||||
|
||||
// set root frame's style context
|
||||
|
@ -22,9 +22,8 @@
|
||||
#include "nsIStyleContext.h"
|
||||
|
||||
nsSplittableFrame::nsSplittableFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsFrame(aContent, aIndexInParent, aParent)
|
||||
: nsFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -55,8 +54,7 @@ NS_METHOD nsSplittableFrame::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
{
|
||||
nsIContentDelegate* contentDelegate = mContent->GetDelegate(aPresContext);
|
||||
|
||||
aContinuingFrame = contentDelegate->CreateFrame(aPresContext, mContent,
|
||||
mIndexInParent, aParent);
|
||||
aContinuingFrame = contentDelegate->CreateFrame(aPresContext, mContent, aParent);
|
||||
NS_RELEASE(contentDelegate);
|
||||
|
||||
// Append the continuing frame to the flow
|
||||
|
@ -24,8 +24,6 @@
|
||||
class nsSplittableFrame : public nsFrame
|
||||
{
|
||||
public:
|
||||
// Flow member functions.
|
||||
|
||||
// CreateContinuingFrame() does the default behavior of using the
|
||||
// content delegate to create a new frame
|
||||
NS_IMETHOD IsSplittable(SplittableType& aIsSplittable) const;
|
||||
@ -33,6 +31,7 @@ public:
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
// Flow member functions.
|
||||
NS_IMETHOD GetPrevInFlow(nsIFrame*& aPrevInFlow) const;
|
||||
NS_IMETHOD SetPrevInFlow(nsIFrame*);
|
||||
NS_IMETHOD GetNextInFlow(nsIFrame*& aNextInFlow) const;
|
||||
@ -57,9 +56,7 @@ public:
|
||||
protected:
|
||||
// Constructor. Takes as arguments the content object, the index in parent,
|
||||
// and the Frame for the content parent
|
||||
nsSplittableFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
nsSplittableFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
virtual ~nsSplittableFrame();
|
||||
|
||||
|
@ -90,7 +90,7 @@ NS_IMPL_ISUPPORTS(SimpleContent, kIContentIID);
|
||||
class SimpleContainer : public nsContainerFrame
|
||||
{
|
||||
public:
|
||||
SimpleContainer(nsIContent* aContent, PRInt32 aIndexInParent);
|
||||
SimpleContainer(nsIContent* aContent);
|
||||
|
||||
ReflowStatus IncrementalReflow(nsIPresContext* aPresContext,
|
||||
nsReflowMetrics& aDesiredSize,
|
||||
@ -108,8 +108,8 @@ public:
|
||||
PRInt32 ChildCount() {return mChildCount;}
|
||||
};
|
||||
|
||||
SimpleContainer::SimpleContainer(nsIContent* aContent, PRInt32 aIndexInParent)
|
||||
: nsContainerFrame(aContent, aIndexInParent, nsnull)
|
||||
SimpleContainer::SimpleContainer(nsIContent* aContent)
|
||||
: nsContainerFrame(aContent, nsnull)
|
||||
{
|
||||
}
|
||||
|
||||
@ -147,15 +147,12 @@ PRBool SimpleContainer::DeleteChildsNextInFlow(nsIFrame* aChild)
|
||||
|
||||
class SimpleSplittableFrame : public nsSplittableFrame {
|
||||
public:
|
||||
SimpleSplittableFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
SimpleSplittableFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
};
|
||||
|
||||
SimpleSplittableFrame::SimpleSplittableFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsSplittableFrame(aContent, aIndexInParent, aParent)
|
||||
: nsSplittableFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -167,7 +164,7 @@ static PRBool
|
||||
TestChildEnumeration()
|
||||
{
|
||||
// Create a simple test container
|
||||
SimpleContainer* f = new SimpleContainer(new SimpleContent(), 0);
|
||||
SimpleContainer* f = new SimpleContainer(new SimpleContent());
|
||||
|
||||
// Add three child frames
|
||||
SimpleContent* childContent = new SimpleContent();
|
||||
@ -175,9 +172,9 @@ TestChildEnumeration()
|
||||
nsFrame* c2;
|
||||
nsFrame* c3;
|
||||
|
||||
nsFrame::NewFrame((nsIFrame**)&c1, childContent, 0, f);
|
||||
nsFrame::NewFrame((nsIFrame**)&c2, childContent, 1, f);
|
||||
nsFrame::NewFrame((nsIFrame**)&c3, childContent, 2, f);
|
||||
nsFrame::NewFrame((nsIFrame**)&c1, childContent, f);
|
||||
nsFrame::NewFrame((nsIFrame**)&c2, childContent, f);
|
||||
nsFrame::NewFrame((nsIFrame**)&c3, childContent, f);
|
||||
|
||||
c1->SetNextSibling(c2);
|
||||
c2->SetNextSibling(c3);
|
||||
@ -256,7 +253,7 @@ static PRBool
|
||||
TestPushChildren()
|
||||
{
|
||||
// Create a simple test container
|
||||
SimpleContainer* f = new SimpleContainer(new SimpleContent(), 0);
|
||||
SimpleContainer* f = new SimpleContainer(new SimpleContent());
|
||||
|
||||
// Add five child frames
|
||||
SimpleContent* childContent = new SimpleContent();
|
||||
@ -317,7 +314,7 @@ TestPushChildren()
|
||||
f->SetOverflowList(nsnull);
|
||||
|
||||
// Create a continuing frame
|
||||
SimpleContainer* f1 = new SimpleContainer(f->GetContent(), 0);
|
||||
SimpleContainer* f1 = new SimpleContainer(f->GetContent());
|
||||
|
||||
// Link it into the flow
|
||||
f->SetNextInFlow(f1);
|
||||
@ -416,7 +413,7 @@ static PRBool
|
||||
TestDeleteChildsNext()
|
||||
{
|
||||
// Create two simple test containers
|
||||
SimpleContainer* f = new SimpleContainer(new SimpleContent(), 0);
|
||||
SimpleContainer* f = new SimpleContainer(new SimpleContent());
|
||||
|
||||
// Create two child frames
|
||||
SimpleContent* childContent = new SimpleContent();
|
||||
@ -462,7 +459,7 @@ TestDeleteChildsNext()
|
||||
// #2a
|
||||
|
||||
// Create a second container frame
|
||||
SimpleContainer* f1 = new SimpleContainer(new SimpleContent(), 0);
|
||||
SimpleContainer* f1 = new SimpleContainer(new SimpleContent());
|
||||
|
||||
// Re-create the continuing child frame
|
||||
c11 = new SimpleSplittableFrame(childContent, 0, f1);
|
||||
|
@ -145,14 +145,13 @@ nsBlockReflowState::Initialize(nsIPresContext* aPresContext,
|
||||
nsresult
|
||||
nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsBlockFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsBlockFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -160,10 +159,8 @@ nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aIndexInParent, aParent)
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -210,7 +207,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext* aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, mIndexInParent, aParent);
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aCX, aParent, cf);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
@ -227,7 +224,9 @@ nsBlockFrame::ListTag(FILE* out) const
|
||||
atom->ToString(tmp);
|
||||
fputs(tmp, out);
|
||||
}
|
||||
fprintf(out, ">(%d)@%p", mIndexInParent, this);
|
||||
PRInt32 contentIndex;
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, ">(%d)@%p", contentIndex, this);
|
||||
} else {
|
||||
nsHTMLContainerFrame::ListTag(out);
|
||||
}
|
||||
@ -357,7 +356,7 @@ nsBlockFrame::WillDeleteNextInFlowFrame(nsIFrame* aNextInFlow)
|
||||
nsIFrame* nextKid;
|
||||
aNextInFlow->GetNextSibling(nextKid);
|
||||
line->mFirstChild = nextKid;
|
||||
nextKid->GetIndexInParent(line->mFirstContentOffset);
|
||||
nextKid->GetContentIndex(line->mFirstContentOffset);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -399,7 +398,7 @@ nsBlockFrame::CreateLineForOverflowList(nsIFrame* aOverflowList)
|
||||
if (nsnull != newLine) {
|
||||
nsIFrame* kid = aOverflowList;
|
||||
newLine->mFirstChild = kid;
|
||||
kid->GetIndexInParent(newLine->mFirstContentOffset);
|
||||
kid->GetContentIndex(newLine->mFirstContentOffset);
|
||||
newLine->mLastContentOffset = -1;
|
||||
newLine->mLastContentIsComplete = PRPackedBool(0x255);
|
||||
PRInt32 kids = 0;
|
||||
@ -704,7 +703,7 @@ nsBlockFrame::PushLines(nsBlockReflowState& aState, nsLineData* aLine)
|
||||
nextInFlow->mLines = aLine;
|
||||
nextInFlow->mFirstChild = firstKid;
|
||||
nextInFlow->mChildCount += pushCount;
|
||||
firstKid->GetIndexInParent(nextInFlow->mFirstContentOffset);
|
||||
firstKid->GetContentIndex(nextInFlow->mFirstContentOffset);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
nextInFlow->VerifyLines(PR_FALSE);
|
||||
|
@ -144,7 +144,6 @@ public:
|
||||
*/
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
// nsISupports
|
||||
@ -224,9 +223,7 @@ public:
|
||||
nsIFrame* aFrame);
|
||||
|
||||
protected:
|
||||
nsBlockFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
nsBlockFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
virtual ~nsBlockFrame();
|
||||
|
||||
|
@ -145,14 +145,13 @@ nsBlockReflowState::Initialize(nsIPresContext* aPresContext,
|
||||
nsresult
|
||||
nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsBlockFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsBlockFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -160,10 +159,8 @@ nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aIndexInParent, aParent)
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -210,7 +207,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext* aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, mIndexInParent, aParent);
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aCX, aParent, cf);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
@ -227,7 +224,9 @@ nsBlockFrame::ListTag(FILE* out) const
|
||||
atom->ToString(tmp);
|
||||
fputs(tmp, out);
|
||||
}
|
||||
fprintf(out, ">(%d)@%p", mIndexInParent, this);
|
||||
PRInt32 contentIndex;
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, ">(%d)@%p", contentIndex, this);
|
||||
} else {
|
||||
nsHTMLContainerFrame::ListTag(out);
|
||||
}
|
||||
@ -357,7 +356,7 @@ nsBlockFrame::WillDeleteNextInFlowFrame(nsIFrame* aNextInFlow)
|
||||
nsIFrame* nextKid;
|
||||
aNextInFlow->GetNextSibling(nextKid);
|
||||
line->mFirstChild = nextKid;
|
||||
nextKid->GetIndexInParent(line->mFirstContentOffset);
|
||||
nextKid->GetContentIndex(line->mFirstContentOffset);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -399,7 +398,7 @@ nsBlockFrame::CreateLineForOverflowList(nsIFrame* aOverflowList)
|
||||
if (nsnull != newLine) {
|
||||
nsIFrame* kid = aOverflowList;
|
||||
newLine->mFirstChild = kid;
|
||||
kid->GetIndexInParent(newLine->mFirstContentOffset);
|
||||
kid->GetContentIndex(newLine->mFirstContentOffset);
|
||||
newLine->mLastContentOffset = -1;
|
||||
newLine->mLastContentIsComplete = PRPackedBool(0x255);
|
||||
PRInt32 kids = 0;
|
||||
@ -704,7 +703,7 @@ nsBlockFrame::PushLines(nsBlockReflowState& aState, nsLineData* aLine)
|
||||
nextInFlow->mLines = aLine;
|
||||
nextInFlow->mFirstChild = firstKid;
|
||||
nextInFlow->mChildCount += pushCount;
|
||||
firstKid->GetIndexInParent(nextInFlow->mFirstContentOffset);
|
||||
firstKid->GetContentIndex(nextInFlow->mFirstContentOffset);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
nextInFlow->VerifyLines(PR_FALSE);
|
||||
|
@ -145,14 +145,13 @@ nsBlockReflowState::Initialize(nsIPresContext* aPresContext,
|
||||
nsresult
|
||||
nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsBlockFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsBlockFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -160,10 +159,8 @@ nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aIndexInParent, aParent)
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -210,7 +207,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext* aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, mIndexInParent, aParent);
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aCX, aParent, cf);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
@ -227,7 +224,9 @@ nsBlockFrame::ListTag(FILE* out) const
|
||||
atom->ToString(tmp);
|
||||
fputs(tmp, out);
|
||||
}
|
||||
fprintf(out, ">(%d)@%p", mIndexInParent, this);
|
||||
PRInt32 contentIndex;
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, ">(%d)@%p", contentIndex, this);
|
||||
} else {
|
||||
nsHTMLContainerFrame::ListTag(out);
|
||||
}
|
||||
@ -357,7 +356,7 @@ nsBlockFrame::WillDeleteNextInFlowFrame(nsIFrame* aNextInFlow)
|
||||
nsIFrame* nextKid;
|
||||
aNextInFlow->GetNextSibling(nextKid);
|
||||
line->mFirstChild = nextKid;
|
||||
nextKid->GetIndexInParent(line->mFirstContentOffset);
|
||||
nextKid->GetContentIndex(line->mFirstContentOffset);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -399,7 +398,7 @@ nsBlockFrame::CreateLineForOverflowList(nsIFrame* aOverflowList)
|
||||
if (nsnull != newLine) {
|
||||
nsIFrame* kid = aOverflowList;
|
||||
newLine->mFirstChild = kid;
|
||||
kid->GetIndexInParent(newLine->mFirstContentOffset);
|
||||
kid->GetContentIndex(newLine->mFirstContentOffset);
|
||||
newLine->mLastContentOffset = -1;
|
||||
newLine->mLastContentIsComplete = PRPackedBool(0x255);
|
||||
PRInt32 kids = 0;
|
||||
@ -704,7 +703,7 @@ nsBlockFrame::PushLines(nsBlockReflowState& aState, nsLineData* aLine)
|
||||
nextInFlow->mLines = aLine;
|
||||
nextInFlow->mFirstChild = firstKid;
|
||||
nextInFlow->mChildCount += pushCount;
|
||||
firstKid->GetIndexInParent(nextInFlow->mFirstContentOffset);
|
||||
firstKid->GetContentIndex(nextInFlow->mFirstContentOffset);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
nextInFlow->VerifyLines(PR_FALSE);
|
||||
|
@ -43,10 +43,8 @@ static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID);
|
||||
|
||||
NS_DEF_PTR(nsIStyleContext);
|
||||
|
||||
nsHTMLContainerFrame::nsHTMLContainerFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aIndexInParent, aParent)
|
||||
nsHTMLContainerFrame::nsHTMLContainerFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -228,8 +226,9 @@ static void AdjustIndexInParents(nsIFrame* aContainerFrame,
|
||||
} else {
|
||||
PRInt32 index;
|
||||
|
||||
childFrame->GetIndexInParent(index);
|
||||
childFrame->GetContentIndex(index);
|
||||
|
||||
#if 0
|
||||
if (::ContentInserted == aChange) {
|
||||
if (index >= aIndexInParent) {
|
||||
childFrame->SetIndexInParent(index + 1);
|
||||
@ -239,13 +238,13 @@ static void AdjustIndexInParents(nsIFrame* aContainerFrame,
|
||||
childFrame->SetIndexInParent(index - 1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nsIFrame* nsHTMLContainerFrame::CreateFrameFor(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent)
|
||||
nsIContent* aContent)
|
||||
{
|
||||
// Get the style content for the frame
|
||||
nsIStyleContextPtr styleContext = aPresContext->ResolveStyleContextFor(aContent, this);
|
||||
@ -255,18 +254,18 @@ nsIFrame* nsHTMLContainerFrame::CreateFrameFor(nsIPresContext* aPresContext,
|
||||
|
||||
// See whether it wants any special handling
|
||||
if (NS_STYLE_POSITION_ABSOLUTE == position->mPosition) {
|
||||
AbsoluteFrame::NewFrame(&result, aContent, aIndexInParent, this);
|
||||
AbsoluteFrame::NewFrame(&result, aContent, this);
|
||||
} else if (display->mFloats != NS_STYLE_FLOAT_NONE) {
|
||||
PlaceholderFrame::NewFrame(&result, aContent, aIndexInParent, this);
|
||||
PlaceholderFrame::NewFrame(&result, aContent, this);
|
||||
} else if (NS_STYLE_DISPLAY_NONE == display->mDisplay) {
|
||||
nsFrame::NewFrame(&result, aContent, aIndexInParent, this);
|
||||
nsFrame::NewFrame(&result, aContent, this);
|
||||
} else {
|
||||
nsIContentDelegate* delegate;
|
||||
|
||||
// Ask the content delegate to create the frame
|
||||
// XXX The delegate will also resolve the style context...
|
||||
delegate = aContent->GetDelegate(aPresContext);
|
||||
result = delegate->CreateFrame(aPresContext, aContent, aIndexInParent, this);
|
||||
result = delegate->CreateFrame(aPresContext, aContent, this);
|
||||
NS_RELEASE(delegate);
|
||||
}
|
||||
|
||||
@ -331,7 +330,7 @@ NS_METHOD nsHTMLContainerFrame::ContentInserted(nsIPresShell* aShell,
|
||||
}
|
||||
|
||||
// Create the new frame
|
||||
nsIFrame* newFrame = parent->CreateFrameFor(aPresContext, aChild, aIndexInParent);
|
||||
nsIFrame* newFrame = parent->CreateFrameFor(aPresContext, aChild);
|
||||
|
||||
// Insert the frame
|
||||
if (nsnull == prevSibling) {
|
||||
|
@ -26,7 +26,6 @@ class nsString;
|
||||
class nsHTMLContainerFrame : public nsContainerFrame {
|
||||
public:
|
||||
nsHTMLContainerFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
@ -63,8 +62,7 @@ protected:
|
||||
const nsString& aTargetSpec);
|
||||
|
||||
nsIFrame* CreateFrameFor(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent);
|
||||
nsIContent* aContent);
|
||||
};
|
||||
|
||||
#endif /* nsHTMLContainerFrame_h___ */
|
||||
|
@ -96,10 +96,9 @@ public:
|
||||
NS_IMETHOD GetContent(nsIContent*& aContent) const = 0;
|
||||
|
||||
/**
|
||||
* Get/Set the frame's index in parent.
|
||||
* Get the index in parent of the frame's content object
|
||||
*/
|
||||
NS_IMETHOD GetIndexInParent(PRInt32& aIndexInParent) const = 0;
|
||||
NS_IMETHOD SetIndexInParent(PRInt32 aIndexInParent) = 0;
|
||||
NS_IMETHOD GetContentIndex(PRInt32& aIndexInParent) const = 0;
|
||||
|
||||
/**
|
||||
* Get the style context associated with this frame. Note that GetStyleContext()
|
||||
|
@ -123,14 +123,13 @@ private:
|
||||
|
||||
nsresult nsInlineFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsInlineFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsInlineFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -138,10 +137,8 @@ nsresult nsInlineFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsInlineFrame::nsInlineFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aIndexInParent, aParent)
|
||||
nsInlineFrame::nsInlineFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aParent)
|
||||
{
|
||||
NS_PRECONDITION(!IsPseudoFrame(), "can not be a pseudo frame");
|
||||
}
|
||||
@ -304,7 +301,7 @@ PRBool nsInlineFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
|
||||
PRInt32 lastIndexInParent;
|
||||
|
||||
LastChild(lastChild);
|
||||
lastChild->GetIndexInParent(lastIndexInParent);
|
||||
lastChild->GetContentIndex(lastIndexInParent);
|
||||
NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset");
|
||||
VerifyLastIsComplete();
|
||||
#endif
|
||||
@ -572,10 +569,10 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||
|
||||
// Check whether it wants to floated or absolutely positioned
|
||||
if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) {
|
||||
AbsoluteFrame::NewFrame(&kidFrame, kid, kidIndex, this);
|
||||
AbsoluteFrame::NewFrame(&kidFrame, kid, this);
|
||||
kidFrame->SetStyleContext(aPresContext,kidStyleContext);
|
||||
} else if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) {
|
||||
PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this);
|
||||
PlaceholderFrame::NewFrame(&kidFrame, kid, this);
|
||||
kidFrame->SetStyleContext(aPresContext,kidStyleContext);
|
||||
} else if (nsnull == kidPrevInFlow) {
|
||||
nsIContentDelegate* kidDel;
|
||||
@ -593,13 +590,13 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||
|
||||
case NS_STYLE_DISPLAY_INLINE:
|
||||
kidDel = kid->GetDelegate(aPresContext);
|
||||
kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this);
|
||||
kidFrame = kidDel->CreateFrame(aPresContext, kid, this);
|
||||
NS_RELEASE(kidDel);
|
||||
break;
|
||||
|
||||
default:
|
||||
NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow");
|
||||
nsFrame::NewFrame(&kidFrame, kid, kidIndex, this);
|
||||
nsFrame::NewFrame(&kidFrame, kid, this);
|
||||
break;
|
||||
}
|
||||
kidFrame->SetStyleContext(aPresContext,kidStyleContext);
|
||||
|
@ -23,10 +23,8 @@ static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID);
|
||||
static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID);
|
||||
static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID);
|
||||
|
||||
nsLeafFrame::nsLeafFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aIndexInParent, aParentFrame)
|
||||
nsLeafFrame::nsLeafFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -49,9 +49,7 @@ public:
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
protected:
|
||||
nsLeafFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsLeafFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
virtual ~nsLeafFrame();
|
||||
|
||||
/**
|
||||
|
@ -116,7 +116,7 @@ nsLineData::Verify(PRBool aFinalCheck) const
|
||||
}
|
||||
while ((nsnull != child) && (child != nextLinesFirstChild)) {
|
||||
PRInt32 indexInParent;
|
||||
child->GetIndexInParent(indexInParent);
|
||||
child->GetContentIndex(indexInParent);
|
||||
NS_ASSERTION(indexInParent == offset, "bad line offsets");
|
||||
len++;
|
||||
if (len != mChildCount) {
|
||||
@ -585,7 +585,7 @@ nsLineLayout::SplitLine(PRInt32 aChildReflowStatus, PRInt32 aRemainingKids)
|
||||
}
|
||||
|
||||
PRInt32 kidIndexInParent;
|
||||
mKidFrame->GetIndexInParent(kidIndexInParent);
|
||||
mKidFrame->GetContentIndex(kidIndexInParent);
|
||||
to->mFirstChild = mKidFrame;
|
||||
to->mChildCount += aRemainingKids;
|
||||
to->mFirstContentOffset = kidIndexInParent;
|
||||
@ -757,7 +757,7 @@ nsLineLayout::PullUpChildren()
|
||||
// new first content offset.
|
||||
mKidFrame->GetNextSibling(line->mFirstChild);
|
||||
PRInt32 indexInParent;
|
||||
line->mFirstChild->GetIndexInParent(indexInParent);
|
||||
line->mFirstChild->GetContentIndex(indexInParent);
|
||||
line->mFirstContentOffset = indexInParent;
|
||||
#ifdef NS_DEBUG
|
||||
line->Verify();
|
||||
@ -843,10 +843,10 @@ nsLineLayout::CreateFrameFor(nsIContent* aKid)
|
||||
PRBool isBlock = PR_FALSE;
|
||||
nsIFrame* kidFrame;
|
||||
if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) {
|
||||
AbsoluteFrame::NewFrame(&kidFrame, aKid, mKidIndex, mBlock);
|
||||
AbsoluteFrame::NewFrame(&kidFrame, aKid, mBlock);
|
||||
kidFrame->SetStyleContext(mPresContext, kidSC);
|
||||
} else if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) {
|
||||
PlaceholderFrame::NewFrame(&kidFrame, aKid, mKidIndex, mBlock);
|
||||
PlaceholderFrame::NewFrame(&kidFrame, aKid, mBlock);
|
||||
kidFrame->SetStyleContext(mPresContext, kidSC);
|
||||
} else if (nsnull == mKidPrevInFlow) {
|
||||
// Create initial frame for the child
|
||||
@ -872,7 +872,7 @@ nsLineLayout::CreateFrameFor(nsIContent* aKid)
|
||||
}
|
||||
#endif
|
||||
kidDel = aKid->GetDelegate(mPresContext);
|
||||
kidFrame = kidDel->CreateFrame(mPresContext, aKid, mKidIndex, mBlock);
|
||||
kidFrame = kidDel->CreateFrame(mPresContext, aKid, mBlock);
|
||||
NS_RELEASE(kidDel);
|
||||
isBlock = PR_TRUE;
|
||||
break;
|
||||
@ -881,12 +881,12 @@ nsLineLayout::CreateFrameFor(nsIContent* aKid)
|
||||
// XXX pass in kidSC to speed things up *alot*!
|
||||
// XXX fix CreateFrame API to return an nsresult!
|
||||
kidDel = aKid->GetDelegate(mPresContext);
|
||||
kidFrame = kidDel->CreateFrame(mPresContext, aKid, mKidIndex, mBlock);
|
||||
kidFrame = kidDel->CreateFrame(mPresContext, aKid, mBlock);
|
||||
NS_RELEASE(kidDel);
|
||||
break;
|
||||
|
||||
default:/* XXX bzzt! */
|
||||
nsFrame::NewFrame(&kidFrame, aKid, mKidIndex, mBlock);
|
||||
nsFrame::NewFrame(&kidFrame, aKid, mBlock);
|
||||
break;
|
||||
}
|
||||
kidFrame->SetStyleContext(mPresContext, kidSC);
|
||||
|
@ -23,8 +23,8 @@
|
||||
#include "nsReflowCommand.h"
|
||||
#include "nsIRenderingContext.h"
|
||||
|
||||
PageFrame::PageFrame(nsIContent* aContent, PRInt32 aIndexInParent, nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aIndexInParent, aParent)
|
||||
PageFrame::PageFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ void PageFrame::CreateFirstChild(nsIPresContext* aPresContext)
|
||||
// Create a frame
|
||||
nsIContentDelegate* cd = child->GetDelegate(aPresContext);
|
||||
if (nsnull != cd) {
|
||||
mFirstChild = cd->CreateFrame(aPresContext, child, 0, this);
|
||||
mFirstChild = cd->CreateFrame(aPresContext, child, this);
|
||||
if (nsnull != mFirstChild) {
|
||||
mChildCount = 1;
|
||||
mLastContentOffset = mFirstContentOffset;
|
||||
@ -158,7 +158,7 @@ NS_METHOD PageFrame::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
PageFrame* cf = new PageFrame(mContent, mIndexInParent, aParent);
|
||||
PageFrame* cf = new PageFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aPresContext, aParent, cf);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
|
@ -23,7 +23,7 @@
|
||||
// Pseudo frame created by the root content frame
|
||||
class PageFrame : public nsContainerFrame {
|
||||
public:
|
||||
PageFrame(nsIContent* aContent, PRInt32 aIndexInParent, nsIFrame* aParent);
|
||||
PageFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext,
|
||||
nsReflowMetrics& aDesiredSize,
|
||||
|
@ -25,14 +25,13 @@ static NS_DEFINE_IID(kIFloaterContainerIID, NS_IFLOATERCONTAINER_IID);
|
||||
nsresult
|
||||
PlaceholderFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new PlaceholderFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new PlaceholderFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -40,10 +39,8 @@ PlaceholderFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PlaceholderFrame::PlaceholderFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsFrame(aContent, aIndexInParent, aParent)
|
||||
PlaceholderFrame::PlaceholderFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsFrame(aContent, aParent)
|
||||
{
|
||||
mAnchoredItem = nsnull;
|
||||
}
|
||||
@ -52,15 +49,6 @@ PlaceholderFrame::~PlaceholderFrame()
|
||||
{
|
||||
}
|
||||
|
||||
NS_METHOD PlaceholderFrame::SetIndexInParent(PRInt32 aIndexInParent)
|
||||
{
|
||||
if (nsnull != mAnchoredItem) {
|
||||
mAnchoredItem->SetIndexInParent(aIndexInParent);
|
||||
}
|
||||
|
||||
return nsFrame::SetIndexInParent(aIndexInParent);
|
||||
}
|
||||
|
||||
NS_METHOD PlaceholderFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||
nsReflowMetrics& aDesiredSize,
|
||||
const nsSize& aMaxSize,
|
||||
@ -82,8 +70,7 @@ NS_METHOD PlaceholderFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||
// Create the anchored item
|
||||
nsIContentDelegate* delegate = mContent->GetDelegate(aPresContext);
|
||||
|
||||
mAnchoredItem = delegate->CreateFrame(aPresContext, mContent, mIndexInParent,
|
||||
mGeometricParent);
|
||||
mAnchoredItem = delegate->CreateFrame(aPresContext, mContent, mGeometricParent);
|
||||
NS_RELEASE(delegate);
|
||||
|
||||
// Set the style context for the frame
|
||||
@ -106,6 +93,8 @@ NS_METHOD PlaceholderFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||
NS_METHOD PlaceholderFrame::ListTag(FILE* out) const
|
||||
{
|
||||
fputs("*placeholder", out);
|
||||
fprintf(out, "(%d)@%p", mIndexInParent, this);
|
||||
PRInt32 contentIndex;
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)@%p", contentIndex, this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -29,14 +29,11 @@ public:
|
||||
*/
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
// Returns the associated anchored item
|
||||
nsIFrame* GetAnchoredItem() const {return mAnchoredItem;}
|
||||
|
||||
NS_IMETHOD SetIndexInParent(PRInt32 aIndexInParent);
|
||||
|
||||
// Resize reflow methods
|
||||
NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext,
|
||||
nsReflowMetrics& aDesiredSize,
|
||||
@ -48,9 +45,7 @@ public:
|
||||
protected:
|
||||
// Constructor. Takes as arguments the content object, the index in parent,
|
||||
// and the Frame for the content parent
|
||||
PlaceholderFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
PlaceholderFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
virtual ~PlaceholderFrame();
|
||||
|
||||
|
@ -28,7 +28,6 @@ class nsInlineFrame : public nsHTMLContainerFrame
|
||||
public:
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext,
|
||||
@ -47,9 +46,7 @@ public:
|
||||
nsReflowMetrics& aMetrics);
|
||||
|
||||
protected:
|
||||
nsInlineFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
nsInlineFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
virtual ~nsInlineFrame();
|
||||
|
||||
|
@ -36,14 +36,13 @@ NS_DEF_PTR(nsIStyleContext);
|
||||
nsresult
|
||||
AbsoluteFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new AbsoluteFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new AbsoluteFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -51,10 +50,8 @@ AbsoluteFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
AbsoluteFrame::AbsoluteFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsFrame(aContent, aIndexInParent, aParent)
|
||||
AbsoluteFrame::AbsoluteFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsFrame(aContent, aParent)
|
||||
{
|
||||
mFrame = nsnull;
|
||||
}
|
||||
@ -63,15 +60,6 @@ AbsoluteFrame::~AbsoluteFrame()
|
||||
{
|
||||
}
|
||||
|
||||
NS_METHOD AbsoluteFrame::SetIndexInParent(PRInt32 aIndexInParent)
|
||||
{
|
||||
if (nsnull != mFrame) {
|
||||
mFrame->SetIndexInParent(aIndexInParent);
|
||||
}
|
||||
|
||||
return nsFrame::SetIndexInParent(aIndexInParent);
|
||||
}
|
||||
|
||||
nsIView* AbsoluteFrame::CreateView(nsIView* aContainingView,
|
||||
const nsRect& aRect,
|
||||
nsStylePosition* aPosition)
|
||||
@ -246,7 +234,7 @@ NS_METHOD AbsoluteFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||
if (nsnull == mFrame) {
|
||||
// If the content object is a container then wrap it in a body pseudo-frame
|
||||
if (mContent->CanContainChildren()) {
|
||||
nsBodyFrame::NewFrame(&mFrame, mContent, mIndexInParent, this);
|
||||
nsBodyFrame::NewFrame(&mFrame, mContent, this);
|
||||
|
||||
// Resolve style for the pseudo-frame. We can't use our style context
|
||||
nsIStyleContextPtr styleContext = aPresContext->ResolveStyleContextFor(mContent, this);
|
||||
@ -257,7 +245,7 @@ NS_METHOD AbsoluteFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||
// also create a view
|
||||
nsIContentDelegate* delegate = mContent->GetDelegate(aPresContext);
|
||||
|
||||
mFrame= delegate->CreateFrame(aPresContext, mContent, mIndexInParent, this);
|
||||
mFrame= delegate->CreateFrame(aPresContext, mContent, this);
|
||||
NS_RELEASE(delegate);
|
||||
|
||||
// Set the style context for the frame
|
||||
@ -328,7 +316,10 @@ NS_METHOD AbsoluteFrame::List(FILE* out, PRInt32 aIndent) const
|
||||
|
||||
// Output the tag
|
||||
fputs("*absolute", out);
|
||||
fprintf(out, "(%d)@%p ", mIndexInParent, this);
|
||||
|
||||
PRInt32 contentIndex;
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)@%p ", contentIndex, this);
|
||||
|
||||
// Output the rect
|
||||
out << mRect;
|
||||
|
@ -30,11 +30,8 @@ public:
|
||||
*/
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD SetIndexInParent(PRInt32 aIndexInParent);
|
||||
|
||||
// Resize reflow methods
|
||||
NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext,
|
||||
nsReflowMetrics& aDesiredSize,
|
||||
@ -49,9 +46,7 @@ protected:
|
||||
|
||||
// Constructor. Takes as arguments the content object, the index in parent,
|
||||
// and the Frame for the content parent
|
||||
AbsoluteFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
AbsoluteFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
virtual ~AbsoluteFrame();
|
||||
|
||||
|
@ -36,9 +36,7 @@ static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID);
|
||||
class BRFrame : public nsFrame
|
||||
{
|
||||
public:
|
||||
BRFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
BRFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
@ -56,9 +54,8 @@ protected:
|
||||
};
|
||||
|
||||
BRFrame::BRFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aIndexInParent, aParentFrame)
|
||||
nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
@ -138,7 +135,6 @@ public:
|
||||
virtual void UnsetAttribute(nsIAtom* aAttribute);
|
||||
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
PRInt32 GetClear() {
|
||||
@ -168,10 +164,9 @@ BRPart::~BRPart()
|
||||
}
|
||||
|
||||
nsIFrame* BRPart::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* rv = new BRFrame(this, aIndexInParent, aParentFrame);
|
||||
nsIFrame* rv = new BRFrame(this, aParentFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -145,14 +145,13 @@ nsBlockReflowState::Initialize(nsIPresContext* aPresContext,
|
||||
nsresult
|
||||
nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsBlockFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsBlockFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -160,10 +159,8 @@ nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aIndexInParent, aParent)
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -210,7 +207,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext* aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, mIndexInParent, aParent);
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aCX, aParent, cf);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
@ -227,7 +224,9 @@ nsBlockFrame::ListTag(FILE* out) const
|
||||
atom->ToString(tmp);
|
||||
fputs(tmp, out);
|
||||
}
|
||||
fprintf(out, ">(%d)@%p", mIndexInParent, this);
|
||||
PRInt32 contentIndex;
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, ">(%d)@%p", contentIndex, this);
|
||||
} else {
|
||||
nsHTMLContainerFrame::ListTag(out);
|
||||
}
|
||||
@ -357,7 +356,7 @@ nsBlockFrame::WillDeleteNextInFlowFrame(nsIFrame* aNextInFlow)
|
||||
nsIFrame* nextKid;
|
||||
aNextInFlow->GetNextSibling(nextKid);
|
||||
line->mFirstChild = nextKid;
|
||||
nextKid->GetIndexInParent(line->mFirstContentOffset);
|
||||
nextKid->GetContentIndex(line->mFirstContentOffset);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -399,7 +398,7 @@ nsBlockFrame::CreateLineForOverflowList(nsIFrame* aOverflowList)
|
||||
if (nsnull != newLine) {
|
||||
nsIFrame* kid = aOverflowList;
|
||||
newLine->mFirstChild = kid;
|
||||
kid->GetIndexInParent(newLine->mFirstContentOffset);
|
||||
kid->GetContentIndex(newLine->mFirstContentOffset);
|
||||
newLine->mLastContentOffset = -1;
|
||||
newLine->mLastContentIsComplete = PRPackedBool(0x255);
|
||||
PRInt32 kids = 0;
|
||||
@ -704,7 +703,7 @@ nsBlockFrame::PushLines(nsBlockReflowState& aState, nsLineData* aLine)
|
||||
nextInFlow->mLines = aLine;
|
||||
nextInFlow->mFirstChild = firstKid;
|
||||
nextInFlow->mChildCount += pushCount;
|
||||
firstKid->GetIndexInParent(nextInFlow->mFirstContentOffset);
|
||||
firstKid->GetContentIndex(nextInFlow->mFirstContentOffset);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
nextInFlow->VerifyLines(PR_FALSE);
|
||||
|
@ -144,7 +144,6 @@ public:
|
||||
*/
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
// nsISupports
|
||||
@ -224,9 +223,7 @@ public:
|
||||
nsIFrame* aFrame);
|
||||
|
||||
protected:
|
||||
nsBlockFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
nsBlockFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
virtual ~nsBlockFrame();
|
||||
|
||||
|
@ -145,14 +145,13 @@ nsBlockReflowState::Initialize(nsIPresContext* aPresContext,
|
||||
nsresult
|
||||
nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsBlockFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsBlockFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -160,10 +159,8 @@ nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aIndexInParent, aParent)
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -210,7 +207,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext* aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, mIndexInParent, aParent);
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aCX, aParent, cf);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
@ -227,7 +224,9 @@ nsBlockFrame::ListTag(FILE* out) const
|
||||
atom->ToString(tmp);
|
||||
fputs(tmp, out);
|
||||
}
|
||||
fprintf(out, ">(%d)@%p", mIndexInParent, this);
|
||||
PRInt32 contentIndex;
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, ">(%d)@%p", contentIndex, this);
|
||||
} else {
|
||||
nsHTMLContainerFrame::ListTag(out);
|
||||
}
|
||||
@ -357,7 +356,7 @@ nsBlockFrame::WillDeleteNextInFlowFrame(nsIFrame* aNextInFlow)
|
||||
nsIFrame* nextKid;
|
||||
aNextInFlow->GetNextSibling(nextKid);
|
||||
line->mFirstChild = nextKid;
|
||||
nextKid->GetIndexInParent(line->mFirstContentOffset);
|
||||
nextKid->GetContentIndex(line->mFirstContentOffset);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -399,7 +398,7 @@ nsBlockFrame::CreateLineForOverflowList(nsIFrame* aOverflowList)
|
||||
if (nsnull != newLine) {
|
||||
nsIFrame* kid = aOverflowList;
|
||||
newLine->mFirstChild = kid;
|
||||
kid->GetIndexInParent(newLine->mFirstContentOffset);
|
||||
kid->GetContentIndex(newLine->mFirstContentOffset);
|
||||
newLine->mLastContentOffset = -1;
|
||||
newLine->mLastContentIsComplete = PRPackedBool(0x255);
|
||||
PRInt32 kids = 0;
|
||||
@ -704,7 +703,7 @@ nsBlockFrame::PushLines(nsBlockReflowState& aState, nsLineData* aLine)
|
||||
nextInFlow->mLines = aLine;
|
||||
nextInFlow->mFirstChild = firstKid;
|
||||
nextInFlow->mChildCount += pushCount;
|
||||
firstKid->GetIndexInParent(nextInFlow->mFirstContentOffset);
|
||||
firstKid->GetContentIndex(nextInFlow->mFirstContentOffset);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
nextInFlow->VerifyLines(PR_FALSE);
|
||||
|
@ -145,14 +145,13 @@ nsBlockReflowState::Initialize(nsIPresContext* aPresContext,
|
||||
nsresult
|
||||
nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsBlockFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsBlockFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -160,10 +159,8 @@ nsBlockFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aIndexInParent, aParent)
|
||||
nsBlockFrame::nsBlockFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -210,7 +207,7 @@ nsBlockFrame::CreateContinuingFrame(nsIPresContext* aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, mIndexInParent, aParent);
|
||||
nsBlockFrame* cf = new nsBlockFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aCX, aParent, cf);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
@ -227,7 +224,9 @@ nsBlockFrame::ListTag(FILE* out) const
|
||||
atom->ToString(tmp);
|
||||
fputs(tmp, out);
|
||||
}
|
||||
fprintf(out, ">(%d)@%p", mIndexInParent, this);
|
||||
PRInt32 contentIndex;
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, ">(%d)@%p", contentIndex, this);
|
||||
} else {
|
||||
nsHTMLContainerFrame::ListTag(out);
|
||||
}
|
||||
@ -357,7 +356,7 @@ nsBlockFrame::WillDeleteNextInFlowFrame(nsIFrame* aNextInFlow)
|
||||
nsIFrame* nextKid;
|
||||
aNextInFlow->GetNextSibling(nextKid);
|
||||
line->mFirstChild = nextKid;
|
||||
nextKid->GetIndexInParent(line->mFirstContentOffset);
|
||||
nextKid->GetContentIndex(line->mFirstContentOffset);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -399,7 +398,7 @@ nsBlockFrame::CreateLineForOverflowList(nsIFrame* aOverflowList)
|
||||
if (nsnull != newLine) {
|
||||
nsIFrame* kid = aOverflowList;
|
||||
newLine->mFirstChild = kid;
|
||||
kid->GetIndexInParent(newLine->mFirstContentOffset);
|
||||
kid->GetContentIndex(newLine->mFirstContentOffset);
|
||||
newLine->mLastContentOffset = -1;
|
||||
newLine->mLastContentIsComplete = PRPackedBool(0x255);
|
||||
PRInt32 kids = 0;
|
||||
@ -704,7 +703,7 @@ nsBlockFrame::PushLines(nsBlockReflowState& aState, nsLineData* aLine)
|
||||
nextInFlow->mLines = aLine;
|
||||
nextInFlow->mFirstChild = firstKid;
|
||||
nextInFlow->mChildCount += pushCount;
|
||||
firstKid->GetIndexInParent(nextInFlow->mFirstContentOffset);
|
||||
firstKid->GetContentIndex(nextInFlow->mFirstContentOffset);
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
nextInFlow->VerifyLines(PR_FALSE);
|
||||
|
@ -36,14 +36,13 @@ static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID);
|
||||
|
||||
nsresult nsBodyFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsBodyFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsBodyFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -51,10 +50,8 @@ nsresult nsBodyFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsBodyFrame::nsBodyFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsHTMLContainerFrame(aContent, aIndexInParent, aParentFrame)
|
||||
nsBodyFrame::nsBodyFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsHTMLContainerFrame(aContent, aParentFrame)
|
||||
{
|
||||
mSpaceManager = new SpaceManager(this);
|
||||
NS_ADDREF(mSpaceManager);
|
||||
@ -84,7 +81,7 @@ void nsBodyFrame::CreateColumnFrame(nsIPresContext* aPresContext)
|
||||
// Do we have a prev-in-flow?
|
||||
if (nsnull == mPrevInFlow) {
|
||||
// No, create a column pseudo frame
|
||||
nsBlockFrame::NewFrame(&mFirstChild, mContent, mIndexInParent, this);
|
||||
nsBlockFrame::NewFrame(&mFirstChild, mContent, this);
|
||||
mChildCount = 1;
|
||||
|
||||
// Resolve style and set the style context
|
||||
@ -371,7 +368,7 @@ NS_METHOD nsBodyFrame::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsBodyFrame* cf = new nsBodyFrame(mContent, mIndexInParent, aParent);
|
||||
nsBodyFrame* cf = new nsBodyFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aPresContext, aParent, cf);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
|
@ -29,7 +29,6 @@ class nsBodyFrame : public nsHTMLContainerFrame, public nsIAnchoredItems {
|
||||
public:
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
||||
@ -69,9 +68,7 @@ public:
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
|
||||
protected:
|
||||
nsBodyFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsBodyFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
~nsBodyFrame();
|
||||
|
||||
|
@ -28,7 +28,6 @@ public:
|
||||
NS_IMETHOD_(nsrefcnt) AddRef();
|
||||
NS_IMETHOD_(nsrefcnt) Release();
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
protected:
|
||||
@ -59,12 +58,10 @@ nsrefcnt BodyPart::Release(void)
|
||||
}
|
||||
|
||||
nsIFrame* BodyPart::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* rv;
|
||||
nsresult status = nsBodyFrame::NewFrame(&rv, this, aIndexInParent,
|
||||
aParentFrame);
|
||||
nsresult status = nsBodyFrame::NewFrame(&rv, this, aParentFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,6 @@ public:
|
||||
virtual nsrefcnt Release(void);
|
||||
#endif
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue);
|
||||
@ -70,7 +69,6 @@ protected:
|
||||
class HRuleFrame : public nsLeafFrame {
|
||||
public:
|
||||
HRuleFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
@ -99,9 +97,8 @@ protected:
|
||||
};
|
||||
|
||||
HRuleFrame::HRuleFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsLeafFrame(aContent, aIndexInParent, aParentFrame)
|
||||
: nsLeafFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
@ -421,10 +418,9 @@ nsContentAttr HRulePart::AttributeToString(nsIAtom* aAttribute,
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
nsIFrame* HRulePart::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* rv = new HRuleFrame(this, aIndexInParent, aParentFrame);
|
||||
nsIFrame* rv = new HRuleFrame(this, aParentFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,6 @@ void nsHTMLContainer::Compact()
|
||||
}
|
||||
|
||||
nsIFrame* nsHTMLContainer::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
// Resolve style for the piece of content
|
||||
@ -199,18 +198,18 @@ nsIFrame* nsHTMLContainer::CreateFrame(nsIPresContext* aPresContext,
|
||||
nsresult fr;
|
||||
switch (styleDisplay->mDisplay) {
|
||||
case NS_STYLE_DISPLAY_BLOCK:
|
||||
fr = nsBlockFrame::NewFrame(&rv, this, aIndexInParent, aParentFrame);
|
||||
fr = nsBlockFrame::NewFrame(&rv, this, aParentFrame);
|
||||
break;
|
||||
case NS_STYLE_DISPLAY_INLINE:
|
||||
fr = nsInlineFrame::NewFrame(&rv, this, aIndexInParent, aParentFrame);
|
||||
fr = nsInlineFrame::NewFrame(&rv, this, aParentFrame);
|
||||
break;
|
||||
case NS_STYLE_DISPLAY_LIST_ITEM:
|
||||
fr = nsListItemFrame::NewFrame(&rv, this, aIndexInParent, aParentFrame);
|
||||
fr = nsListItemFrame::NewFrame(&rv, this, aParentFrame);
|
||||
break;
|
||||
default:
|
||||
// Create an empty frame for holding content that is not being
|
||||
// reflowed.
|
||||
fr = nsFrame::NewFrame(&rv, this, aIndexInParent, aParentFrame);
|
||||
fr = nsFrame::NewFrame(&rv, this, aParentFrame);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,6 @@ public:
|
||||
virtual void Compact();
|
||||
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue);
|
||||
|
@ -43,10 +43,8 @@ static NS_DEFINE_IID(kStyleDisplaySID, NS_STYLEDISPLAY_SID);
|
||||
|
||||
NS_DEF_PTR(nsIStyleContext);
|
||||
|
||||
nsHTMLContainerFrame::nsHTMLContainerFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aIndexInParent, aParent)
|
||||
nsHTMLContainerFrame::nsHTMLContainerFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -228,8 +226,9 @@ static void AdjustIndexInParents(nsIFrame* aContainerFrame,
|
||||
} else {
|
||||
PRInt32 index;
|
||||
|
||||
childFrame->GetIndexInParent(index);
|
||||
childFrame->GetContentIndex(index);
|
||||
|
||||
#if 0
|
||||
if (::ContentInserted == aChange) {
|
||||
if (index >= aIndexInParent) {
|
||||
childFrame->SetIndexInParent(index + 1);
|
||||
@ -239,13 +238,13 @@ static void AdjustIndexInParents(nsIFrame* aContainerFrame,
|
||||
childFrame->SetIndexInParent(index - 1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nsIFrame* nsHTMLContainerFrame::CreateFrameFor(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent)
|
||||
nsIContent* aContent)
|
||||
{
|
||||
// Get the style content for the frame
|
||||
nsIStyleContextPtr styleContext = aPresContext->ResolveStyleContextFor(aContent, this);
|
||||
@ -255,18 +254,18 @@ nsIFrame* nsHTMLContainerFrame::CreateFrameFor(nsIPresContext* aPresContext,
|
||||
|
||||
// See whether it wants any special handling
|
||||
if (NS_STYLE_POSITION_ABSOLUTE == position->mPosition) {
|
||||
AbsoluteFrame::NewFrame(&result, aContent, aIndexInParent, this);
|
||||
AbsoluteFrame::NewFrame(&result, aContent, this);
|
||||
} else if (display->mFloats != NS_STYLE_FLOAT_NONE) {
|
||||
PlaceholderFrame::NewFrame(&result, aContent, aIndexInParent, this);
|
||||
PlaceholderFrame::NewFrame(&result, aContent, this);
|
||||
} else if (NS_STYLE_DISPLAY_NONE == display->mDisplay) {
|
||||
nsFrame::NewFrame(&result, aContent, aIndexInParent, this);
|
||||
nsFrame::NewFrame(&result, aContent, this);
|
||||
} else {
|
||||
nsIContentDelegate* delegate;
|
||||
|
||||
// Ask the content delegate to create the frame
|
||||
// XXX The delegate will also resolve the style context...
|
||||
delegate = aContent->GetDelegate(aPresContext);
|
||||
result = delegate->CreateFrame(aPresContext, aContent, aIndexInParent, this);
|
||||
result = delegate->CreateFrame(aPresContext, aContent, this);
|
||||
NS_RELEASE(delegate);
|
||||
}
|
||||
|
||||
@ -331,7 +330,7 @@ NS_METHOD nsHTMLContainerFrame::ContentInserted(nsIPresShell* aShell,
|
||||
}
|
||||
|
||||
// Create the new frame
|
||||
nsIFrame* newFrame = parent->CreateFrameFor(aPresContext, aChild, aIndexInParent);
|
||||
nsIFrame* newFrame = parent->CreateFrameFor(aPresContext, aChild);
|
||||
|
||||
// Insert the frame
|
||||
if (nsnull == prevSibling) {
|
||||
|
@ -26,7 +26,6 @@ class nsString;
|
||||
class nsHTMLContainerFrame : public nsContainerFrame {
|
||||
public:
|
||||
nsHTMLContainerFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
@ -63,8 +62,7 @@ protected:
|
||||
const nsString& aTargetSpec);
|
||||
|
||||
nsIFrame* CreateFrameFor(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent);
|
||||
nsIContent* aContent);
|
||||
};
|
||||
|
||||
#endif /* nsHTMLContainerFrame_h___ */
|
||||
|
@ -46,7 +46,6 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
protected:
|
||||
~ContentDelegate();
|
||||
@ -65,7 +64,6 @@ ContentDelegate::~ContentDelegate()
|
||||
|
||||
nsIFrame* ContentDelegate::CreateFrame(nsIPresContext* aPresContext,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aContent, "null ptr");
|
||||
@ -78,12 +76,12 @@ nsIFrame* ContentDelegate::CreateFrame(nsIPresContext* aPresContext,
|
||||
// This means that *somehow* somebody which is not an html
|
||||
// content object got ahold of this delegate and tried to
|
||||
// create a frame with it. Give them back an nsFrame.
|
||||
status = nsFrame::NewFrame(&rv, aContent, aIndexInParent, aParentFrame);
|
||||
status = nsFrame::NewFrame(&rv, aContent, aParentFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Ask the content object to create the frame
|
||||
rv = hc->CreateFrame(aPresContext, aIndexInParent, aParentFrame);
|
||||
rv = hc->CreateFrame(aPresContext, aParentFrame);
|
||||
NS_RELEASE(hc);
|
||||
return rv;
|
||||
}
|
||||
|
@ -41,9 +41,7 @@ static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID);
|
||||
|
||||
class ImageFrame : public nsLeafFrame {
|
||||
public:
|
||||
ImageFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
ImageFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
@ -79,7 +77,6 @@ public:
|
||||
ImagePart(nsIAtom* aTag);
|
||||
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue);
|
||||
@ -117,10 +114,8 @@ protected:
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
ImageFrame::ImageFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsLeafFrame(aContent, aIndexInParent, aParentFrame)
|
||||
ImageFrame::ImageFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsLeafFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
@ -571,10 +566,9 @@ void ImagePart::MapAttributesInto(nsIStyleContext* aContext,
|
||||
}
|
||||
|
||||
nsIFrame* ImagePart::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
ImageFrame* rv = new ImageFrame(this, aIndexInParent, aParentFrame);
|
||||
ImageFrame* rv = new ImageFrame(this, aParentFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,6 @@ public:
|
||||
* for the content.
|
||||
*/
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame) = 0;
|
||||
};
|
||||
|
||||
|
@ -123,14 +123,13 @@ private:
|
||||
|
||||
nsresult nsInlineFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsInlineFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsInlineFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -138,10 +137,8 @@ nsresult nsInlineFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsInlineFrame::nsInlineFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aIndexInParent, aParent)
|
||||
nsInlineFrame::nsInlineFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsHTMLContainerFrame(aContent, aParent)
|
||||
{
|
||||
NS_PRECONDITION(!IsPseudoFrame(), "can not be a pseudo frame");
|
||||
}
|
||||
@ -304,7 +301,7 @@ PRBool nsInlineFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
|
||||
PRInt32 lastIndexInParent;
|
||||
|
||||
LastChild(lastChild);
|
||||
lastChild->GetIndexInParent(lastIndexInParent);
|
||||
lastChild->GetContentIndex(lastIndexInParent);
|
||||
NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset");
|
||||
VerifyLastIsComplete();
|
||||
#endif
|
||||
@ -572,10 +569,10 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||
|
||||
// Check whether it wants to floated or absolutely positioned
|
||||
if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) {
|
||||
AbsoluteFrame::NewFrame(&kidFrame, kid, kidIndex, this);
|
||||
AbsoluteFrame::NewFrame(&kidFrame, kid, this);
|
||||
kidFrame->SetStyleContext(aPresContext,kidStyleContext);
|
||||
} else if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) {
|
||||
PlaceholderFrame::NewFrame(&kidFrame, kid, kidIndex, this);
|
||||
PlaceholderFrame::NewFrame(&kidFrame, kid, this);
|
||||
kidFrame->SetStyleContext(aPresContext,kidStyleContext);
|
||||
} else if (nsnull == kidPrevInFlow) {
|
||||
nsIContentDelegate* kidDel;
|
||||
@ -593,13 +590,13 @@ nsInlineFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||
|
||||
case NS_STYLE_DISPLAY_INLINE:
|
||||
kidDel = kid->GetDelegate(aPresContext);
|
||||
kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this);
|
||||
kidFrame = kidDel->CreateFrame(aPresContext, kid, this);
|
||||
NS_RELEASE(kidDel);
|
||||
break;
|
||||
|
||||
default:
|
||||
NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow");
|
||||
nsFrame::NewFrame(&kidFrame, kid, kidIndex, this);
|
||||
nsFrame::NewFrame(&kidFrame, kid, this);
|
||||
break;
|
||||
}
|
||||
kidFrame->SetStyleContext(aPresContext,kidStyleContext);
|
||||
|
@ -23,10 +23,8 @@ static NS_DEFINE_IID(kStyleSpacingSID, NS_STYLESPACING_SID);
|
||||
static NS_DEFINE_IID(kStyleBorderSID, NS_STYLEBORDER_SID);
|
||||
static NS_DEFINE_IID(kStyleColorSID, NS_STYLECOLOR_SID);
|
||||
|
||||
nsLeafFrame::nsLeafFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aIndexInParent, aParentFrame)
|
||||
nsLeafFrame::nsLeafFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -49,9 +49,7 @@ public:
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
protected:
|
||||
nsLeafFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsLeafFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
virtual ~nsLeafFrame();
|
||||
|
||||
/**
|
||||
|
@ -116,7 +116,7 @@ nsLineData::Verify(PRBool aFinalCheck) const
|
||||
}
|
||||
while ((nsnull != child) && (child != nextLinesFirstChild)) {
|
||||
PRInt32 indexInParent;
|
||||
child->GetIndexInParent(indexInParent);
|
||||
child->GetContentIndex(indexInParent);
|
||||
NS_ASSERTION(indexInParent == offset, "bad line offsets");
|
||||
len++;
|
||||
if (len != mChildCount) {
|
||||
@ -585,7 +585,7 @@ nsLineLayout::SplitLine(PRInt32 aChildReflowStatus, PRInt32 aRemainingKids)
|
||||
}
|
||||
|
||||
PRInt32 kidIndexInParent;
|
||||
mKidFrame->GetIndexInParent(kidIndexInParent);
|
||||
mKidFrame->GetContentIndex(kidIndexInParent);
|
||||
to->mFirstChild = mKidFrame;
|
||||
to->mChildCount += aRemainingKids;
|
||||
to->mFirstContentOffset = kidIndexInParent;
|
||||
@ -757,7 +757,7 @@ nsLineLayout::PullUpChildren()
|
||||
// new first content offset.
|
||||
mKidFrame->GetNextSibling(line->mFirstChild);
|
||||
PRInt32 indexInParent;
|
||||
line->mFirstChild->GetIndexInParent(indexInParent);
|
||||
line->mFirstChild->GetContentIndex(indexInParent);
|
||||
line->mFirstContentOffset = indexInParent;
|
||||
#ifdef NS_DEBUG
|
||||
line->Verify();
|
||||
@ -843,10 +843,10 @@ nsLineLayout::CreateFrameFor(nsIContent* aKid)
|
||||
PRBool isBlock = PR_FALSE;
|
||||
nsIFrame* kidFrame;
|
||||
if (NS_STYLE_POSITION_ABSOLUTE == kidPosition->mPosition) {
|
||||
AbsoluteFrame::NewFrame(&kidFrame, aKid, mKidIndex, mBlock);
|
||||
AbsoluteFrame::NewFrame(&kidFrame, aKid, mBlock);
|
||||
kidFrame->SetStyleContext(mPresContext, kidSC);
|
||||
} else if (kidDisplay->mFloats != NS_STYLE_FLOAT_NONE) {
|
||||
PlaceholderFrame::NewFrame(&kidFrame, aKid, mKidIndex, mBlock);
|
||||
PlaceholderFrame::NewFrame(&kidFrame, aKid, mBlock);
|
||||
kidFrame->SetStyleContext(mPresContext, kidSC);
|
||||
} else if (nsnull == mKidPrevInFlow) {
|
||||
// Create initial frame for the child
|
||||
@ -872,7 +872,7 @@ nsLineLayout::CreateFrameFor(nsIContent* aKid)
|
||||
}
|
||||
#endif
|
||||
kidDel = aKid->GetDelegate(mPresContext);
|
||||
kidFrame = kidDel->CreateFrame(mPresContext, aKid, mKidIndex, mBlock);
|
||||
kidFrame = kidDel->CreateFrame(mPresContext, aKid, mBlock);
|
||||
NS_RELEASE(kidDel);
|
||||
isBlock = PR_TRUE;
|
||||
break;
|
||||
@ -881,12 +881,12 @@ nsLineLayout::CreateFrameFor(nsIContent* aKid)
|
||||
// XXX pass in kidSC to speed things up *alot*!
|
||||
// XXX fix CreateFrame API to return an nsresult!
|
||||
kidDel = aKid->GetDelegate(mPresContext);
|
||||
kidFrame = kidDel->CreateFrame(mPresContext, aKid, mKidIndex, mBlock);
|
||||
kidFrame = kidDel->CreateFrame(mPresContext, aKid, mBlock);
|
||||
NS_RELEASE(kidDel);
|
||||
break;
|
||||
|
||||
default:/* XXX bzzt! */
|
||||
nsFrame::NewFrame(&kidFrame, aKid, mKidIndex, mBlock);
|
||||
nsFrame::NewFrame(&kidFrame, aKid, mBlock);
|
||||
break;
|
||||
}
|
||||
kidFrame->SetStyleContext(mPresContext, kidSC);
|
||||
|
@ -49,9 +49,7 @@ static NS_DEFINE_IID(kStyleListSID, NS_STYLELIST_SID);
|
||||
*/
|
||||
class BulletFrame : public nsContainerFrame {
|
||||
public:
|
||||
BulletFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
BulletFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
virtual ~BulletFrame();
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext &aCX,
|
||||
@ -83,10 +81,8 @@ public:
|
||||
PRInt32 mOrdinal;
|
||||
};
|
||||
|
||||
BulletFrame::BulletFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsContainerFrame(aContent, aIndexInParent, aParentFrame)
|
||||
BulletFrame::BulletFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsContainerFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
@ -411,14 +407,13 @@ void BulletFrame::GetBulletSize(nsIPresContext* aCX,
|
||||
|
||||
nsresult nsListItemFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsListItemFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsListItemFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -426,10 +421,8 @@ nsresult nsListItemFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsListItemFrame::nsListItemFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsBlockFrame(aContent, aIndexInParent, aParent)
|
||||
nsListItemFrame::nsListItemFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsBlockFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -441,7 +434,7 @@ nsIFrame* nsListItemFrame::CreateBullet(nsIPresContext *aCX)
|
||||
{
|
||||
// Create bullet. The bullet shares the same style context as
|
||||
// ourselves.
|
||||
nsIFrame* bullet = new BulletFrame(mContent, mIndexInParent, this);
|
||||
nsIFrame* bullet = new BulletFrame(mContent, this);
|
||||
bullet->SetStyleContext(aCX,mStyleContext);
|
||||
return bullet;
|
||||
}
|
||||
@ -658,7 +651,7 @@ NS_METHOD nsListItemFrame::CreateContinuingFrame(nsIPresContext* aCX,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsListItemFrame* cf = new nsListItemFrame(mContent, mIndexInParent, aParent);
|
||||
nsListItemFrame* cf = new nsListItemFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aCX, aParent, cf);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
|
@ -25,7 +25,6 @@ class nsListItemFrame : public nsBlockFrame
|
||||
public:
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
// nsIFrame
|
||||
@ -48,7 +47,6 @@ public:
|
||||
|
||||
protected:
|
||||
nsListItemFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
virtual ~nsListItemFrame();
|
||||
|
@ -23,8 +23,8 @@
|
||||
#include "nsReflowCommand.h"
|
||||
#include "nsIRenderingContext.h"
|
||||
|
||||
PageFrame::PageFrame(nsIContent* aContent, PRInt32 aIndexInParent, nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aIndexInParent, aParent)
|
||||
PageFrame::PageFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aParent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ void PageFrame::CreateFirstChild(nsIPresContext* aPresContext)
|
||||
// Create a frame
|
||||
nsIContentDelegate* cd = child->GetDelegate(aPresContext);
|
||||
if (nsnull != cd) {
|
||||
mFirstChild = cd->CreateFrame(aPresContext, child, 0, this);
|
||||
mFirstChild = cd->CreateFrame(aPresContext, child, this);
|
||||
if (nsnull != mFirstChild) {
|
||||
mChildCount = 1;
|
||||
mLastContentOffset = mFirstContentOffset;
|
||||
@ -158,7 +158,7 @@ NS_METHOD PageFrame::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
PageFrame* cf = new PageFrame(mContent, mIndexInParent, aParent);
|
||||
PageFrame* cf = new PageFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aPresContext, aParent, cf);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
|
@ -23,7 +23,7 @@
|
||||
// Pseudo frame created by the root content frame
|
||||
class PageFrame : public nsContainerFrame {
|
||||
public:
|
||||
PageFrame(nsIContent* aContent, PRInt32 aIndexInParent, nsIFrame* aParent);
|
||||
PageFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext,
|
||||
nsReflowMetrics& aDesiredSize,
|
||||
|
@ -25,14 +25,13 @@ static NS_DEFINE_IID(kIFloaterContainerIID, NS_IFLOATERCONTAINER_IID);
|
||||
nsresult
|
||||
PlaceholderFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new PlaceholderFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new PlaceholderFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -40,10 +39,8 @@ PlaceholderFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PlaceholderFrame::PlaceholderFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsFrame(aContent, aIndexInParent, aParent)
|
||||
PlaceholderFrame::PlaceholderFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsFrame(aContent, aParent)
|
||||
{
|
||||
mAnchoredItem = nsnull;
|
||||
}
|
||||
@ -52,15 +49,6 @@ PlaceholderFrame::~PlaceholderFrame()
|
||||
{
|
||||
}
|
||||
|
||||
NS_METHOD PlaceholderFrame::SetIndexInParent(PRInt32 aIndexInParent)
|
||||
{
|
||||
if (nsnull != mAnchoredItem) {
|
||||
mAnchoredItem->SetIndexInParent(aIndexInParent);
|
||||
}
|
||||
|
||||
return nsFrame::SetIndexInParent(aIndexInParent);
|
||||
}
|
||||
|
||||
NS_METHOD PlaceholderFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||
nsReflowMetrics& aDesiredSize,
|
||||
const nsSize& aMaxSize,
|
||||
@ -82,8 +70,7 @@ NS_METHOD PlaceholderFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||
// Create the anchored item
|
||||
nsIContentDelegate* delegate = mContent->GetDelegate(aPresContext);
|
||||
|
||||
mAnchoredItem = delegate->CreateFrame(aPresContext, mContent, mIndexInParent,
|
||||
mGeometricParent);
|
||||
mAnchoredItem = delegate->CreateFrame(aPresContext, mContent, mGeometricParent);
|
||||
NS_RELEASE(delegate);
|
||||
|
||||
// Set the style context for the frame
|
||||
@ -106,6 +93,8 @@ NS_METHOD PlaceholderFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||
NS_METHOD PlaceholderFrame::ListTag(FILE* out) const
|
||||
{
|
||||
fputs("*placeholder", out);
|
||||
fprintf(out, "(%d)@%p", mIndexInParent, this);
|
||||
PRInt32 contentIndex;
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)@%p", contentIndex, this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -29,14 +29,11 @@ public:
|
||||
*/
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
// Returns the associated anchored item
|
||||
nsIFrame* GetAnchoredItem() const {return mAnchoredItem;}
|
||||
|
||||
NS_IMETHOD SetIndexInParent(PRInt32 aIndexInParent);
|
||||
|
||||
// Resize reflow methods
|
||||
NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext,
|
||||
nsReflowMetrics& aDesiredSize,
|
||||
@ -48,9 +45,7 @@ public:
|
||||
protected:
|
||||
// Constructor. Takes as arguments the content object, the index in parent,
|
||||
// and the Frame for the content parent
|
||||
PlaceholderFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
PlaceholderFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
virtual ~PlaceholderFrame();
|
||||
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
// Pseudo frame created by the root frame
|
||||
class RootContentFrame : public nsContainerFrame {
|
||||
public:
|
||||
RootContentFrame(nsIContent* aContent, PRInt32 aIndexInParent, nsIFrame* aParent);
|
||||
RootContentFrame(nsIContent* aContent, nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD ResizeReflow(nsIPresContext* aPresContext,
|
||||
nsReflowMetrics& aDesiredSize,
|
||||
@ -84,7 +84,7 @@ protected:
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
RootFrame::RootFrame(nsIContent* aContent)
|
||||
: nsContainerFrame(aContent, -1, nsnull)
|
||||
: nsContainerFrame(aContent, nsnull)
|
||||
{
|
||||
}
|
||||
|
||||
@ -102,7 +102,7 @@ NS_METHOD RootFrame::ResizeReflow(nsIPresContext* aPresContext,
|
||||
// Do we have any children?
|
||||
if (nsnull == mFirstChild) {
|
||||
// No. Create a pseudo frame
|
||||
mFirstChild = new RootContentFrame(mContent, mIndexInParent, this);
|
||||
mFirstChild = new RootContentFrame(mContent, this);
|
||||
mChildCount = 1;
|
||||
nsIStyleContext* style = aPresContext->ResolveStyleContextFor(mContent, this);
|
||||
mFirstChild->SetStyleContext(aPresContext,style);
|
||||
@ -208,10 +208,8 @@ NS_METHOD RootFrame::HandleEvent(nsIPresContext& aPresContext,
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
RootContentFrame::RootContentFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aIndexInParent, aParent)
|
||||
RootContentFrame::RootContentFrame(nsIContent* aContent, nsIFrame* aParent)
|
||||
: nsContainerFrame(aContent, aParent)
|
||||
{
|
||||
// Create a view
|
||||
nsIFrame* parent;
|
||||
@ -256,7 +254,7 @@ void RootContentFrame::CreateFirstChild(nsIPresContext* aPresContext)
|
||||
// Are we paginated?
|
||||
if (aPresContext->IsPaginated()) {
|
||||
// Yes. Create the first page frame
|
||||
mFirstChild = new PageFrame(mContent, mIndexInParent, this);
|
||||
mFirstChild = new PageFrame(mContent, this);
|
||||
mChildCount = 1;
|
||||
mLastContentOffset = mFirstContentOffset;
|
||||
|
||||
@ -269,7 +267,7 @@ void RootContentFrame::CreateFirstChild(nsIPresContext* aPresContext)
|
||||
// Create a frame
|
||||
nsIContentDelegate* cd = child->GetDelegate(aPresContext);
|
||||
if (nsnull != cd) {
|
||||
mFirstChild = cd->CreateFrame(aPresContext, child, 0, this);
|
||||
mFirstChild = cd->CreateFrame(aPresContext, child, this);
|
||||
if (nsnull != mFirstChild) {
|
||||
mChildCount = 1;
|
||||
mLastContentOffset = mFirstContentOffset;
|
||||
@ -451,7 +449,6 @@ public:
|
||||
NS_IMETHOD_(nsrefcnt) AddRef();
|
||||
NS_IMETHOD_(nsrefcnt) Release();
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
protected:
|
||||
@ -484,7 +481,6 @@ nsrefcnt RootPart::Release(void)
|
||||
}
|
||||
|
||||
nsIFrame* RootPart::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* rv = new RootFrame(this);
|
||||
|
@ -36,9 +36,7 @@
|
||||
class SpacerFrame : public nsFrame
|
||||
{
|
||||
public:
|
||||
SpacerFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
SpacerFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
virtual ReflowStatus ResizeReflow(nsIPresContext* aPresContext,
|
||||
nsReflowMetrics& aDesiredSize,
|
||||
@ -53,7 +51,6 @@ public:
|
||||
SpacerPart(nsIAtom* aTag);
|
||||
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue);
|
||||
@ -72,10 +69,8 @@ protected:
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
SpacerFrame::SpacerFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aIndexInParent, aParentFrame)
|
||||
SpacerFrame::SpacerFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
@ -205,11 +200,9 @@ SpacerPart::~SpacerPart()
|
||||
{
|
||||
}
|
||||
|
||||
nsIFrame* SpacerPart::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
nsIFrame* SpacerPart::CreateFrame(nsIPresContext* aPresContext, nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* rv = new SpacerFrame(this, aIndexInParent, aParentFrame);
|
||||
nsIFrame* rv = new SpacerFrame(this, aParentFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -108,9 +108,7 @@ public:
|
||||
|
||||
class TextFrame : public nsSplittableFrame {
|
||||
public:
|
||||
TextFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
TextFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
@ -220,9 +218,7 @@ public:
|
||||
|
||||
virtual void ToHTMLString(nsString& aBuf) const;
|
||||
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aCX,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aCX, nsIFrame* aParentFrame);
|
||||
|
||||
// nsIScriptObjectOwner interface
|
||||
virtual nsresult GetScriptObject(JSContext *aContext, void** aScriptObject);
|
||||
@ -357,10 +353,8 @@ void TextTimer::Notify(nsITimer *timer)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
TextFrame::TextFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsSplittableFrame(aContent, aIndexInParent, aParentFrame)
|
||||
TextFrame::TextFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsSplittableFrame(aContent, aParentFrame)
|
||||
{
|
||||
if (nsnull == gTextBlinker) {
|
||||
// Create text timer the first time out
|
||||
@ -1148,8 +1142,10 @@ NS_METHOD TextFrame::List(FILE* out, PRInt32 aIndent) const
|
||||
{
|
||||
PRInt32 i;
|
||||
for (i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
PRInt32 contentIndex;
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "Text(%d)@%p[%d,%d] ",
|
||||
mIndexInParent, this,
|
||||
contentIndex, this,
|
||||
mContentOffset, mContentOffset+mContentLength-1);
|
||||
out << mRect;
|
||||
aIndent++;
|
||||
@ -1312,11 +1308,9 @@ void Text::GetText(nsString& aBuf, PRInt32 aOffset, PRInt32 aCount)
|
||||
}
|
||||
#endif
|
||||
|
||||
nsIFrame* Text::CreateFrame(nsIPresContext* aCX,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
nsIFrame* Text::CreateFrame(nsIPresContext* aCX, nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* rv = new TextFrame(this, aIndexInParent, aParentFrame);
|
||||
nsIFrame* rv = new TextFrame(this, aParentFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,6 @@ public:
|
||||
WBRPart(nsIAtom* aTag);
|
||||
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
protected:
|
||||
@ -41,12 +40,10 @@ WBRPart::~WBRPart()
|
||||
{
|
||||
}
|
||||
|
||||
nsIFrame* WBRPart::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
nsIFrame* WBRPart::CreateFrame(nsIPresContext* aPresContext, nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* frame;
|
||||
nsresult rv = nsFrame::NewFrame(&frame, this, aIndexInParent, aParentFrame);
|
||||
nsresult rv = nsFrame::NewFrame(&frame, this, aParentFrame);
|
||||
if (NS_OK == rv) {
|
||||
return frame;
|
||||
}
|
||||
|
@ -165,7 +165,6 @@ nsrefcnt nsInput::Release()
|
||||
|
||||
nsIFrame*
|
||||
nsInput::CreateFrame(nsIPresContext *aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame *aParentFrame)
|
||||
{
|
||||
NS_ASSERTION(0, "frames must be created by subclasses of Input");
|
||||
|
@ -47,7 +47,6 @@ public:
|
||||
* @see nsIContentDelegate CreateFrame
|
||||
*/
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
virtual void MapAttributesInto(nsIStyleContext* aContext,
|
||||
|
@ -64,7 +64,6 @@ public:
|
||||
nsButtonType aType);
|
||||
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
virtual void GetDefaultLabel(nsString& aLabel);
|
||||
@ -93,9 +92,7 @@ public:
|
||||
class nsInputButtonFrame : public nsInputFrame {
|
||||
public:
|
||||
typedef nsInputFrame nsInputButtonFrameSuper;
|
||||
nsInputButtonFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsInputButtonFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
@ -211,16 +208,15 @@ nsInputButton::GetDefaultLabel(nsString& aString)
|
||||
|
||||
nsIFrame*
|
||||
nsInputButton::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
if (kButton_Hidden == mType) {
|
||||
nsIFrame* frame;
|
||||
nsFrame::NewFrame(&frame, this, aIndexInParent, aParentFrame);
|
||||
nsFrame::NewFrame(&frame, this, aParentFrame);
|
||||
return frame;
|
||||
}
|
||||
else {
|
||||
return new nsInputButtonFrame(this, aIndexInParent, aParentFrame);
|
||||
return new nsInputButtonFrame(this, aParentFrame);
|
||||
}
|
||||
|
||||
}
|
||||
@ -281,9 +277,8 @@ nsInputButton::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
|
||||
// nsInputButtonFrame Implementation
|
||||
|
||||
nsInputButtonFrame::nsInputButtonFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsInputFrame(aContent, aIndexInParent, aParentFrame)
|
||||
: nsInputFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -33,9 +33,7 @@
|
||||
|
||||
class nsInputCheckboxFrame : public nsInputFrame {
|
||||
public:
|
||||
nsInputCheckboxFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsInputCheckboxFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView);
|
||||
|
||||
@ -56,10 +54,8 @@ protected:
|
||||
nsSize& aDesiredWidgetSize);
|
||||
};
|
||||
|
||||
nsInputCheckboxFrame::nsInputCheckboxFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsInputFrame(aContent, aIndexInParent, aParentFrame)
|
||||
nsInputCheckboxFrame::nsInputCheckboxFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsInputFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
@ -200,11 +196,9 @@ nsInputCheckbox::Reset()
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
nsInputCheckbox::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
nsInputCheckbox::CreateFrame(nsIPresContext* aPresContext, nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* rv = new nsInputCheckboxFrame(this, aIndexInParent, aParentFrame);
|
||||
nsIFrame* rv = new nsInputCheckboxFrame(this, aParentFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,6 @@ public:
|
||||
nsInputCheckbox (nsIAtom* aTag, nsIFormManager* aManager);
|
||||
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue);
|
||||
|
@ -30,9 +30,7 @@
|
||||
|
||||
class nsInputFileFrame : public nsInputFrame {
|
||||
public:
|
||||
nsInputFileFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsInputFileFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView);
|
||||
|
||||
@ -40,10 +38,8 @@ protected:
|
||||
virtual ~nsInputFileFrame();
|
||||
};
|
||||
|
||||
nsInputFileFrame::nsInputFileFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsInputFrame(aContent, aIndexInParent, aParentFrame)
|
||||
nsInputFileFrame::nsInputFileFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsInputFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
@ -74,10 +70,9 @@ nsInputFile::~nsInputFile()
|
||||
|
||||
nsIFrame*
|
||||
nsInputFile::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* rv = new nsInputFileFrame(this, aIndexInParent, aParentFrame);
|
||||
nsIFrame* rv = new nsInputFileFrame(this, aParentFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,6 @@ public:
|
||||
nsInputFile (nsIAtom* aTag, nsIFormManager* aManager);
|
||||
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
protected:
|
||||
|
@ -60,10 +60,8 @@ struct nsInputCallbackData
|
||||
}
|
||||
};
|
||||
|
||||
nsInputFrame::nsInputFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsLeafFrame(aContent, aIndexInParent, aParentFrame)
|
||||
nsInputFrame::nsInputFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsLeafFrame(aContent, aParentFrame)
|
||||
{
|
||||
mCacheBounds.width = 0;
|
||||
mCacheBounds.height = 0;
|
||||
|
@ -80,12 +80,9 @@ public:
|
||||
/**
|
||||
* Main constructor
|
||||
* @param aContent the content representing this frame
|
||||
* @param aIndexInParent the position in the parent frame's children which this frame occupies
|
||||
* @param aParentFrame the parent frame
|
||||
*/
|
||||
nsInputFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsInputFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
static nscoord CalculateSize (nsIPresContext* aPresContext, nsInputFrame* aFrame,
|
||||
const nsSize& aCSSSize, nsInputDimensionSpec& aDimensionSpec,
|
||||
|
@ -35,9 +35,7 @@
|
||||
|
||||
class nsInputRadioFrame : public nsInputFrame {
|
||||
public:
|
||||
nsInputRadioFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsInputRadioFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView);
|
||||
|
||||
@ -59,10 +57,8 @@ protected:
|
||||
nsSize& aDesiredWidgetSize);
|
||||
};
|
||||
|
||||
nsInputRadioFrame::nsInputRadioFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsInputFrame(aContent, aIndexInParent, aParentFrame)
|
||||
nsInputRadioFrame::nsInputRadioFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsInputFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
@ -192,10 +188,9 @@ nsInputRadio::SetChecked(PRBool aValue, PRBool aSetInitialValue)
|
||||
|
||||
nsIFrame*
|
||||
nsInputRadio::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* rv = new nsInputRadioFrame(this, aIndexInParent, aParentFrame);
|
||||
nsIFrame* rv = new nsInputRadioFrame(this, aParentFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,6 @@ public:
|
||||
nsInputRadio (nsIAtom* aTag, nsIFormManager* aManager);
|
||||
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue);
|
||||
|
@ -37,7 +37,6 @@
|
||||
class nsInputTextFrame : public nsInputFrame {
|
||||
public:
|
||||
nsInputTextFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
virtual nsInputWidgetData* GetWidgetInitData();
|
||||
@ -61,9 +60,8 @@ protected:
|
||||
};
|
||||
|
||||
nsInputTextFrame::nsInputTextFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsInputFrame(aContent, aIndexInParent, aParentFrame)
|
||||
: nsInputFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
@ -206,10 +204,9 @@ nsInputText::GetTextType() const
|
||||
|
||||
nsIFrame*
|
||||
nsInputText::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
return new nsInputTextFrame(this, aIndexInParent, aParentFrame);
|
||||
return new nsInputTextFrame(this, aParentFrame);
|
||||
}
|
||||
|
||||
PRInt32
|
||||
|
@ -39,7 +39,6 @@ public:
|
||||
nsInputText (nsIAtom* aTag, nsIFormManager* aManager, nsInputTextType aType);
|
||||
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue);
|
||||
|
@ -46,9 +46,7 @@ static NS_DEFINE_IID(kListBoxIID, NS_ILISTBOX_IID);
|
||||
|
||||
class nsSelectFrame : public nsInputFrame {
|
||||
public:
|
||||
nsSelectFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsSelectFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
virtual nsInputWidgetData* GetWidgetInitData();
|
||||
|
||||
@ -77,7 +75,6 @@ public:
|
||||
nsSelect (nsIAtom* aTag, nsIFormManager* aFormMan);
|
||||
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue);
|
||||
@ -112,7 +109,6 @@ public:
|
||||
nsOption (nsIAtom* aTag);
|
||||
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue);
|
||||
@ -140,9 +136,8 @@ protected:
|
||||
|
||||
|
||||
nsSelectFrame::nsSelectFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsInputFrame(aContent, aIndexInParent, aParentFrame)
|
||||
: nsInputFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
@ -306,10 +301,9 @@ void nsSelect::GetType(nsString& aResult) const
|
||||
|
||||
nsIFrame*
|
||||
nsSelect::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* rv = new nsSelectFrame(this, aIndexInParent, aParentFrame);
|
||||
nsIFrame* rv = new nsSelectFrame(this, aParentFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
@ -468,11 +462,10 @@ void nsOption::GetType(nsString& aResult) const
|
||||
|
||||
nsIFrame*
|
||||
nsOption::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* frame;
|
||||
nsFrame::NewFrame(&frame, this, aIndexInParent, aParentFrame);
|
||||
nsFrame::NewFrame(&frame, this, aParentFrame);
|
||||
return frame;
|
||||
}
|
||||
|
||||
|
@ -77,13 +77,11 @@ int nsTableCaption::GetType()
|
||||
}
|
||||
|
||||
nsIFrame* nsTableCaption::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
NS_PRECONDITION(nsnull!=aPresContext, "bad arg");
|
||||
nsIFrame* rv;
|
||||
nsresult status = nsTableCaptionFrame::NewFrame(&rv, this, aIndexInParent,
|
||||
aParentFrame);
|
||||
nsresult status = nsTableCaptionFrame::NewFrame(&rv, this, aParentFrame);
|
||||
NS_ASSERTION(nsnull!=rv, "bad arg");
|
||||
return rv;
|
||||
}
|
||||
|
@ -59,9 +59,7 @@ public:
|
||||
virtual int GetType();
|
||||
|
||||
/** @see nsIHTMLContent::CreateFrame */
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext, nsIFrame* aParentFrame);
|
||||
|
||||
};
|
||||
|
||||
|
@ -41,9 +41,8 @@ static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID);
|
||||
/**
|
||||
*/
|
||||
nsTableCaptionFrame::nsTableCaptionFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsContainerFrame(aContent, aIndexInParent, aParentFrame),
|
||||
: nsContainerFrame(aContent, aParentFrame),
|
||||
mMinWidth(0),
|
||||
mMaxWidth(0)
|
||||
{
|
||||
@ -76,7 +75,7 @@ void nsTableCaptionFrame::CreatePsuedoFrame(nsIPresContext* aPresContext)
|
||||
// Do we have a prev-in-flow?
|
||||
if (nsnull == mPrevInFlow) {
|
||||
// No, create a column pseudo frame
|
||||
nsBodyFrame::NewFrame(&mFirstChild, mContent, mIndexInParent, this);
|
||||
nsBodyFrame::NewFrame(&mFirstChild, mContent, this);
|
||||
mChildCount = 1;
|
||||
|
||||
// Resolve style and set the style context
|
||||
@ -330,7 +329,7 @@ NS_METHOD nsTableCaptionFrame::CreateContinuingFrame(nsIPresContext* aPresContex
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
if (PR_TRUE==gsDebug) printf("nsTableCaptionFrame::CreateContinuingFrame called\n");
|
||||
nsTableCaptionFrame* cf = new nsTableCaptionFrame(mContent, mIndexInParent, aParent);
|
||||
nsTableCaptionFrame* cf = new nsTableCaptionFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aPresContext, aParent, cf);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
@ -340,14 +339,13 @@ NS_METHOD nsTableCaptionFrame::CreateContinuingFrame(nsIPresContext* aPresContex
|
||||
|
||||
nsresult nsTableCaptionFrame::NewFrame( nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsTableCaptionFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsTableCaptionFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
@ -33,7 +33,6 @@ class nsTableCaptionFrame : public nsContainerFrame
|
||||
public:
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
@ -79,9 +78,7 @@ protected:
|
||||
/** protected constructor.
|
||||
* @see NewFrame
|
||||
*/
|
||||
nsTableCaptionFrame( nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsTableCaptionFrame( nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
/** Create a psuedo-frame for this caption. Handles continuing frames as needed.
|
||||
*/
|
||||
|
@ -144,13 +144,11 @@ void nsTableCell::SetColIndex (int aColIndex)
|
||||
}
|
||||
|
||||
nsIFrame* nsTableCell::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
NS_PRECONDITION(nsnull!=aPresContext, "bad arg");
|
||||
nsIFrame* rv;
|
||||
nsresult status = nsTableCellFrame::NewFrame(&rv, this, aIndexInParent,
|
||||
aParentFrame);
|
||||
nsresult status = nsTableCellFrame::NewFrame(&rv, this, aParentFrame);
|
||||
NS_ASSERTION(nsnull!=rv, "bad arg");
|
||||
return rv;
|
||||
}
|
||||
|
@ -87,7 +87,6 @@ public:
|
||||
|
||||
/** @see nsIHTMLContent::CreateFrame */
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
virtual void SetAttribute(nsIAtom* aAttribute, const nsString& aValue);
|
||||
|
@ -44,9 +44,8 @@ static NS_DEFINE_IID(kStyleTextSID, NS_STYLETEXT_SID);
|
||||
/**
|
||||
*/
|
||||
nsTableCellFrame::nsTableCellFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsContainerFrame(aContent, aIndexInParent, aParentFrame)
|
||||
: nsContainerFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
@ -180,7 +179,7 @@ void nsTableCellFrame::CreatePsuedoFrame(nsIPresContext* aPresContext)
|
||||
// Do we have a prev-in-flow?
|
||||
if (nsnull == mPrevInFlow) {
|
||||
// No, create a column pseudo frame
|
||||
nsBodyFrame::NewFrame(&mFirstChild, mContent, mIndexInParent, this);
|
||||
nsBodyFrame::NewFrame(&mFirstChild, mContent, this);
|
||||
mChildCount = 1;
|
||||
|
||||
// Resolve style and set the style context
|
||||
@ -339,7 +338,7 @@ NS_METHOD nsTableCellFrame::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsTableCellFrame* cf = new nsTableCellFrame(mContent, mIndexInParent, aParent);
|
||||
nsTableCellFrame* cf = new nsTableCellFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aPresContext, aParent, cf);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
@ -491,14 +490,13 @@ NS_METHOD nsTableCellFrame::DidSetStyleContext(nsIPresContext* aPresContext)
|
||||
|
||||
nsresult nsTableCellFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsTableCellFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsTableCellFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
@ -33,7 +33,6 @@ class nsTableCellFrame : public nsContainerFrame
|
||||
public:
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
@ -79,7 +78,6 @@ protected:
|
||||
* @see NewFrame
|
||||
*/
|
||||
nsTableCellFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
/** Create a psuedo-frame for this caption. Handles continuing frames as needed.
|
||||
|
@ -39,7 +39,6 @@ class nsTableColFrame : public nsFrame {
|
||||
public:
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
@ -60,9 +59,7 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
nsTableColFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsTableColFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
~nsTableColFrame();
|
||||
|
||||
@ -70,10 +67,8 @@ protected:
|
||||
|
||||
|
||||
|
||||
nsTableColFrame::nsTableColFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aIndexInParent, aParentFrame)
|
||||
nsTableColFrame::nsTableColFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
@ -126,14 +121,13 @@ NS_METHOD nsTableColFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
||||
|
||||
nsresult nsTableColFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsTableColFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsTableColFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
@ -326,12 +320,10 @@ nsString * nsTableCol::GetAllInternalAttributeNames ()
|
||||
}
|
||||
|
||||
nsIFrame* nsTableCol::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* rv;
|
||||
nsresult status = nsTableColFrame::NewFrame(&rv, this, aIndexInParent,
|
||||
aParentFrame);
|
||||
nsresult status = nsTableColFrame::NewFrame(&rv, this, aParentFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,6 @@ public:
|
||||
|
||||
/** @see nsIHTMLContent::CreateFrame */
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
/** return the number of columns this content object represents. always >= 1*/
|
||||
|
@ -332,12 +332,10 @@ PRBool nsTableColGroup::IsCol(nsIContent * aContent) const
|
||||
}
|
||||
|
||||
nsIFrame* nsTableColGroup::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* rv;
|
||||
nsresult status = nsTableColGroupFrame::NewFrame(&rv, this, aIndexInParent,
|
||||
aParentFrame);
|
||||
nsresult status = nsTableColGroupFrame::NewFrame(&rv, this, aParentFrame);
|
||||
NS_ASSERTION(nsnull!=rv, "can't allocate a new frame");
|
||||
return rv;
|
||||
}
|
||||
|
@ -78,7 +78,6 @@ public:
|
||||
|
||||
/** @see nsIHTMLContent::CreateFrame */
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
/** returns nsITableContent::kTableColGroupType */
|
||||
|
@ -25,9 +25,8 @@ static PRBool gsDebug = PR_FALSE;
|
||||
|
||||
|
||||
nsTableColGroupFrame::nsTableColGroupFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsContainerFrame(aContent, aIndexInParent, aParentFrame)
|
||||
: nsContainerFrame(aContent, aParentFrame)
|
||||
{
|
||||
}
|
||||
|
||||
@ -79,14 +78,13 @@ nsTableColGroupFrame::IncrementalReflow(nsIPresContext* aPresContext,
|
||||
|
||||
nsresult nsTableColGroupFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsTableColGroupFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsTableColGroupFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
@ -33,7 +33,6 @@ class nsTableColGroupFrame : public nsContainerFrame
|
||||
public:
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
NS_IMETHOD Paint(nsIPresContext& aPresContext,
|
||||
@ -54,9 +53,7 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
nsTableColGroupFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsTableColGroupFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
~nsTableColGroupFrame();
|
||||
|
||||
|
@ -142,10 +142,8 @@ struct InnerTableReflowState {
|
||||
/* ----------- nsTableFrame ---------- */
|
||||
|
||||
|
||||
nsTableFrame::nsTableFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsContainerFrame(aContent, aIndexInParent, aParentFrame),
|
||||
nsTableFrame::nsTableFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsContainerFrame(aContent, aParentFrame),
|
||||
mColumnLayoutData(nsnull),
|
||||
mColumnWidths(nsnull),
|
||||
mTableLayoutStrategy(nsnull),
|
||||
@ -639,7 +637,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont
|
||||
{
|
||||
nsIContentDelegate* kidDel;
|
||||
kidDel = kid->GetDelegate(aPresContext);
|
||||
kidFrame = kidDel->CreateFrame(aPresContext, kid, contentOffset, this);
|
||||
kidFrame = kidDel->CreateFrame(aPresContext, kid, this);
|
||||
NS_RELEASE(kidDel);
|
||||
kidFrame->SetStyleContext(aPresContext,kidStyleContext);
|
||||
}
|
||||
@ -1105,7 +1103,7 @@ PRBool nsTableFrame::ReflowMappedChildren( nsIPresContext* aPresContext,
|
||||
PRInt32 lastIndexInParent;
|
||||
|
||||
LastChild(lastChild);
|
||||
lastChild->GetIndexInParent(lastIndexInParent);
|
||||
lastChild->GetContentIndex(lastIndexInParent);
|
||||
NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset");
|
||||
#endif
|
||||
|
||||
@ -1414,7 +1412,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||
if (nsnull == kidPrevInFlow) {
|
||||
nsIContentDelegate* kidDel = nsnull;
|
||||
kidDel = kid->GetDelegate(aPresContext);
|
||||
kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this);
|
||||
kidFrame = kidDel->CreateFrame(aPresContext, kid, this);
|
||||
NS_RELEASE(kidDel);
|
||||
kidFrame->SetStyleContext(aPresContext, kidStyleContext);
|
||||
} else {
|
||||
@ -2045,7 +2043,7 @@ NS_METHOD nsTableFrame::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsTableFrame* cf = new nsTableFrame(mContent, mIndexInParent, aParent);
|
||||
nsTableFrame* cf = new nsTableFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aPresContext, aParent, cf);
|
||||
if (PR_TRUE==gsDebug) printf("nsTableFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf);
|
||||
// set my width, because all frames in a table flow are the same width
|
||||
@ -2076,7 +2074,7 @@ NS_METHOD nsTableFrame::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
aPresContext->ResolveStyleContextFor(content, cf); // kidStyleContext: REFCNT++
|
||||
nsIContentDelegate* kidDel = nsnull;
|
||||
kidDel = content->GetDelegate(aPresContext); // kidDel: REFCNT++
|
||||
nsIFrame * duplicateFrame = kidDel->CreateFrame(aPresContext, content, index, cf);
|
||||
nsIFrame * duplicateFrame = kidDel->CreateFrame(aPresContext, content, cf);
|
||||
NS_RELEASE(kidDel); // kidDel: REFCNT--
|
||||
duplicateFrame->SetStyleContext(aPresContext,kidStyleContext);
|
||||
NS_RELEASE(kidStyleContext); // kidStyleContenxt: REFCNT--
|
||||
@ -2161,14 +2159,13 @@ NS_METHOD nsTableFrame::DidSetStyleContext(nsIPresContext* aPresContext)
|
||||
|
||||
nsresult nsTableFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsTableFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsTableFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
@ -50,14 +50,12 @@ public:
|
||||
/** instantiate a new instance of nsTableFrame.
|
||||
* @param aInstancePtrResult the new object is returned in this out-param
|
||||
* @param aContent the table object to map
|
||||
* @param aIndexInParent which child is the new frame?
|
||||
* @param aParent the parent of the new frame
|
||||
*
|
||||
* @return NS_OK if the frame was properly allocated, otherwise an error code
|
||||
*/
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
/** @see nsIFrame::Paint */
|
||||
@ -173,9 +171,7 @@ protected:
|
||||
/** protected constructor.
|
||||
* @see NewFrame
|
||||
*/
|
||||
nsTableFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsTableFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
/** destructor, responsible for mColumnLayoutData and mColumnWidths */
|
||||
virtual ~nsTableFrame();
|
||||
|
@ -101,10 +101,8 @@ struct OuterTableReflowState {
|
||||
|
||||
/**
|
||||
*/
|
||||
nsTableOuterFrame::nsTableOuterFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsContainerFrame(aContent, aIndexInParent, aParentFrame),
|
||||
nsTableOuterFrame::nsTableOuterFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsContainerFrame(aContent, aParentFrame),
|
||||
mInnerTableFrame(nsnull),
|
||||
mCaptionFrames(nsnull),
|
||||
mBottomCaptions(nsnull),
|
||||
@ -939,7 +937,7 @@ nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame,
|
||||
void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext)
|
||||
{
|
||||
nsIFrame *prevKidFrame = nsnull;
|
||||
nsresult frameCreated = nsTableFrame::NewFrame((nsIFrame **)(&mInnerTableFrame), mContent, 0, this);
|
||||
nsresult frameCreated = nsTableFrame::NewFrame((nsIFrame **)(&mInnerTableFrame), mContent, this);
|
||||
if (NS_OK!=frameCreated)
|
||||
return; // SEC: an error!!!!
|
||||
// Resolve style
|
||||
@ -966,7 +964,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext)
|
||||
if (contentType==nsITableContent::kTableCaptionType)
|
||||
{
|
||||
nsIFrame *captionFrame=nsnull;
|
||||
frameCreated = nsTableCaptionFrame::NewFrame(&captionFrame, caption, 0, this);
|
||||
frameCreated = nsTableCaptionFrame::NewFrame(&captionFrame, caption, this);
|
||||
if (NS_OK!=frameCreated)
|
||||
return; // SEC: an error!!!!
|
||||
// Resolve style
|
||||
@ -1084,7 +1082,7 @@ nsTableOuterFrame::ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext,
|
||||
mInnerTableFrame->MoveTo(0, topCaptionY);
|
||||
PRInt32 captionIndexInParent;
|
||||
|
||||
captionFrame->GetIndexInParent(captionIndexInParent);
|
||||
captionFrame->GetContentIndex(captionIndexInParent);
|
||||
if (0==captionIndexInParent)
|
||||
{
|
||||
SetFirstContentOffset(captionFrame);
|
||||
@ -1208,7 +1206,7 @@ NS_METHOD nsTableOuterFrame::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsTableOuterFrame* cf = new nsTableOuterFrame(mContent, mIndexInParent, aParent);
|
||||
nsTableOuterFrame* cf = new nsTableOuterFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aPresContext, aParent, cf);
|
||||
cf->SetFirstPassValid(PR_TRUE);
|
||||
if (PR_TRUE==gsDebug)
|
||||
@ -1358,7 +1356,7 @@ void nsTableOuterFrame::CreateInnerTableFrame(nsIPresContext* aPresContext)
|
||||
// Do we have a prev-in-flow?
|
||||
if (nsnull == mPrevInFlow) {
|
||||
// No, create a column pseudo frame
|
||||
mInnerTableFrame = new nsTableFrame(mContent, mIndexInParent, this);
|
||||
mInnerTableFrame = new nsTableFrame(mContent, this);
|
||||
mChildCount++;
|
||||
|
||||
// Resolve style and set the style context
|
||||
@ -1387,14 +1385,13 @@ void nsTableOuterFrame::CreateInnerTableFrame(nsIPresContext* aPresContext)
|
||||
|
||||
nsresult nsTableOuterFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsTableOuterFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsTableOuterFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
@ -45,14 +45,12 @@ public:
|
||||
/** instantiate a new instance of nsTableFrame.
|
||||
* @param aInstancePtrResult the new object is returned in this out-param
|
||||
* @param aContent the table object to map
|
||||
* @param aIndexInParent which child is the new frame?
|
||||
* @param aParent the parent of the new frame
|
||||
*
|
||||
* @return NS_OK if the frame was properly allocated, otherwise an error code
|
||||
*/
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
/** @see nsIFrame::Paint */
|
||||
@ -110,9 +108,7 @@ protected:
|
||||
/** protected constructor
|
||||
* @see NewFrame
|
||||
*/
|
||||
nsTableOuterFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsTableOuterFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
/** return PR_TRUE if the table needs to be reflowed.
|
||||
* the outer table needs to be reflowed if the table content has changed,
|
||||
|
@ -998,13 +998,10 @@ PRInt32 nsTablePart::GetEffectiveRowSpan (PRInt32 aRowIndex, nsTableCell *aCell)
|
||||
/**
|
||||
* Create a frame object that will layout this table.
|
||||
*/
|
||||
nsIFrame* nsTablePart::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
nsIFrame* nsTablePart::CreateFrame(nsIPresContext* aPresContext, nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* rv;
|
||||
nsresult status = nsTableOuterFrame::NewFrame(&rv, this, aIndexInParent,
|
||||
aParentFrame);
|
||||
nsresult status = nsTableOuterFrame::NewFrame(&rv, this, aParentFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,6 @@ public:
|
||||
virtual PRBool RemoveChildAt(PRInt32 aIndex);
|
||||
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
/** called when the input stream knows that the input has been completely consumed.
|
||||
|
@ -241,12 +241,10 @@ PRBool nsTableRow::RemoveChildAt (int aIndex)
|
||||
|
||||
// nsTableRowFrame checks args
|
||||
nsIFrame* nsTableRow::CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* rv;
|
||||
nsresult status = nsTableRowFrame::NewFrame(&rv, this, aIndexInParent,
|
||||
aParentFrame);
|
||||
nsresult status = nsTableRowFrame::NewFrame(&rv, this, aParentFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,6 @@ public:
|
||||
|
||||
/** @see nsIHTMLContent::CreateFrame */
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
/** return the row group that contains me (my parent) */
|
||||
|
@ -87,9 +87,8 @@ struct RowReflowState {
|
||||
/* ----------- nsTableRowpFrame ---------- */
|
||||
|
||||
nsTableRowFrame::nsTableRowFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsContainerFrame(aContent, aIndexInParent, aParentFrame),
|
||||
: nsContainerFrame(aContent, aParentFrame),
|
||||
mTallestCell(0)
|
||||
{
|
||||
}
|
||||
@ -444,7 +443,7 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
|
||||
PRInt32 lastIndexInParent;
|
||||
|
||||
LastChild(lastChild);
|
||||
lastChild->GetIndexInParent(lastIndexInParent);
|
||||
lastChild->GetContentIndex(lastIndexInParent);
|
||||
NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset");
|
||||
#endif
|
||||
|
||||
@ -809,7 +808,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
|
||||
if (nsnull == kidPrevInFlow) {
|
||||
nsIContentDelegate* kidDel = nsnull;
|
||||
kidDel = cell->GetDelegate(aPresContext);
|
||||
kidFrame = kidDel->CreateFrame(aPresContext, cell, kidIndex, this);
|
||||
kidFrame = kidDel->CreateFrame(aPresContext, cell, this);
|
||||
NS_RELEASE(kidDel);
|
||||
kidFrame->SetStyleContext(aPresContext,kidStyleContext);
|
||||
} else {
|
||||
@ -1036,7 +1035,7 @@ NS_METHOD nsTableRowFrame::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
if (gsDebug1==PR_TRUE) printf("nsTableRowFrame::CreateContinuingFrame\n");
|
||||
nsTableRowFrame* cf = new nsTableRowFrame(mContent, mIndexInParent, aParent);
|
||||
nsTableRowFrame* cf = new nsTableRowFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aPresContext, aParent, cf);
|
||||
aContinuingFrame = cf;
|
||||
return NS_OK;
|
||||
@ -1044,14 +1043,13 @@ NS_METHOD nsTableRowFrame::CreateContinuingFrame(nsIPresContext* aPresContext,
|
||||
|
||||
nsresult nsTableRowFrame::NewFrame( nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsTableRowFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsTableRowFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
@ -43,14 +43,12 @@ public:
|
||||
/** instantiate a new instance of nsTableRowFrame.
|
||||
* @param aInstancePtrResult the new object is returned in this out-param
|
||||
* @param aContent the table object to map
|
||||
* @param aIndexInParent which child is the new frame?
|
||||
* @param aParent the parent of the new frame
|
||||
*
|
||||
* @return NS_OK if the frame was properly allocated, otherwise an error code
|
||||
*/
|
||||
static nsresult NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent);
|
||||
|
||||
/** @see nsIFrame::Paint */
|
||||
@ -112,9 +110,7 @@ protected:
|
||||
/** protected constructor.
|
||||
* @see NewFrame
|
||||
*/
|
||||
nsTableRowFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
nsTableRowFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
||||
/** destructor */
|
||||
virtual ~nsTableRowFrame();
|
||||
|
@ -96,12 +96,10 @@ nsrefcnt nsTableRowGroup::Release(void)
|
||||
|
||||
// nsTableRowGroupFrame checks arguments
|
||||
nsIFrame* nsTableRowGroup::CreateFrame( nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
{
|
||||
nsIFrame* rv;
|
||||
nsresult status = nsTableRowGroupFrame::NewFrame(&rv, this, aIndexInParent,
|
||||
aParentFrame);
|
||||
nsresult status = nsTableRowGroupFrame::NewFrame(&rv, this, aParentFrame);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,6 @@ public:
|
||||
|
||||
/** @see nsIHTMLContent::CreateFrame */
|
||||
virtual nsIFrame* CreateFrame(nsIPresContext* aPresContext,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame);
|
||||
|
||||
/** return the number of contained rows */
|
||||
|
@ -88,10 +88,8 @@ struct RowGroupReflowState {
|
||||
|
||||
/* ----------- nsTableRowGroupFrame ---------- */
|
||||
|
||||
nsTableRowGroupFrame::nsTableRowGroupFrame(nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParentFrame)
|
||||
: nsContainerFrame(aContent, aIndexInParent, aParentFrame)
|
||||
nsTableRowGroupFrame::nsTableRowGroupFrame(nsIContent* aContent, nsIFrame* aParentFrame)
|
||||
: nsContainerFrame(aContent, aParentFrame)
|
||||
{
|
||||
mType = aContent->GetTag(); // mType: REFCNT++
|
||||
}
|
||||
@ -411,7 +409,7 @@ PRBool nsTableRowGroupFrame::ReflowMappedChildren( nsIPresContext* aPresCon
|
||||
PRInt32 lastIndexInParent;
|
||||
|
||||
LastChild(lastChild);
|
||||
lastChild->GetIndexInParent(lastIndexInParent);
|
||||
lastChild->GetContentIndex(lastIndexInParent);
|
||||
NS_POSTCONDITION(lastIndexInParent == mLastContentOffset, "bad last content offset");
|
||||
#endif
|
||||
|
||||
@ -741,7 +739,7 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
|
||||
if (nsnull == kidPrevInFlow) {
|
||||
nsIContentDelegate* kidDel = nsnull;
|
||||
kidDel = kid->GetDelegate(aPresContext);
|
||||
kidFrame = kidDel->CreateFrame(aPresContext, kid, kidIndex, this);
|
||||
kidFrame = kidDel->CreateFrame(aPresContext, kid, this);
|
||||
NS_RELEASE(kidDel);
|
||||
kidFrame->SetStyleContext(aPresContext,kidSC);
|
||||
} else {
|
||||
@ -928,7 +926,7 @@ NS_METHOD nsTableRowGroupFrame::CreateContinuingFrame(nsIPresContext* aPresConte
|
||||
nsIFrame* aParent,
|
||||
nsIFrame*& aContinuingFrame)
|
||||
{
|
||||
nsTableRowGroupFrame* cf = new nsTableRowGroupFrame(mContent, mIndexInParent, aParent);
|
||||
nsTableRowGroupFrame* cf = new nsTableRowGroupFrame(mContent, aParent);
|
||||
PrepareContinuingFrame(aPresContext, aParent, cf);
|
||||
if (PR_TRUE==gsDebug1) printf("nsTableRowGroupFrame::CCF parent = %p, this=%p, cf=%p\n", aParent, this, cf);
|
||||
aContinuingFrame = cf;
|
||||
@ -939,14 +937,13 @@ NS_METHOD nsTableRowGroupFrame::CreateContinuingFrame(nsIPresContext* aPresConte
|
||||
|
||||
nsresult nsTableRowGroupFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
||||
nsIContent* aContent,
|
||||
PRInt32 aIndexInParent,
|
||||
nsIFrame* aParent)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtrResult, "null ptr");
|
||||
if (nsnull == aInstancePtrResult) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsIFrame* it = new nsTableRowGroupFrame(aContent, aIndexInParent, aParent);
|
||||
nsIFrame* it = new nsTableRowGroupFrame(aContent, aParent);
|
||||
if (nsnull == it) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user