зеркало из https://github.com/mozilla/pjs.git
expanded nsIFrame::List to include nsIListFilter *aFilter param, by default nsnull.
aFilter is useful for determining if a frame should output itself during a List(). In any event, the children of the frame are always processed. added nsIListFilter, an interface for any object that wants to act like a filter for frame dumps added static NS_LAYOUT nsIListFilter * GetFilter(nsString *aFilterName); currently, only TableListFilter implements nsIListFilter. in response to List(...TableListFilter), the frame model is dumped in a way that is useful for table layout regression testing. Currently this is controlled by command line switches on the viewer app.
This commit is contained in:
Родитель
d851355460
Коммит
a8906329f4
|
@ -36,6 +36,9 @@ class nsIStyleContext;
|
|||
class nsIView;
|
||||
class nsIWidget;
|
||||
class nsIReflowCommand;
|
||||
class nsIListFilter;
|
||||
class nsAutoString;
|
||||
class nsString;
|
||||
|
||||
struct nsPoint;
|
||||
struct nsRect;
|
||||
|
@ -620,9 +623,10 @@ public:
|
|||
NS_IMETHOD IsTransparent(PRBool& aTransparent) const = 0;
|
||||
|
||||
// Debugging
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const= 0;
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const= 0;
|
||||
NS_IMETHOD ListTag(FILE* out = stdout) const = 0;
|
||||
NS_IMETHOD VerifyTree() const = 0;
|
||||
static NS_LAYOUT nsIListFilter * GetFilter(nsString *aFilterName);
|
||||
|
||||
/**
|
||||
* See if tree verification is enabled. To enable tree verification add
|
||||
|
@ -735,4 +739,11 @@ inline nsReflowState::nsReflowState(nsIFrame* aFrame,
|
|||
minSize.height = 0;
|
||||
}
|
||||
|
||||
/* ----- nsIListFilter definition ----- */
|
||||
class nsIListFilter
|
||||
{
|
||||
public:
|
||||
virtual PRBool OutputTag(nsAutoString *aTag) const = 0;
|
||||
};
|
||||
|
||||
#endif /* nsIFrame_h___ */
|
||||
|
|
|
@ -949,48 +949,67 @@ void nsContainerFrame::AdjustOffsetOfEmptyNextInFlows()
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Debugging
|
||||
|
||||
NS_METHOD nsContainerFrame::List(FILE* out, PRInt32 aIndent) const
|
||||
NS_METHOD nsContainerFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
nsIAtom* tag;
|
||||
nsAutoString tagString;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull)
|
||||
tag->ToString(tagString);
|
||||
PRBool outputMe = (PRBool)((nsnull==aFilter) || ((PR_TRUE==aFilter->OutputTag(&tagString)) && (!IsPseudoFrame())));
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Output the tag
|
||||
ListTag(out);
|
||||
nsIView* view;
|
||||
GetView(view);
|
||||
if (nsnull != view) {
|
||||
fprintf(out, " [view=%p]", view);
|
||||
}
|
||||
// Output the tag
|
||||
ListTag(out);
|
||||
nsIView* view;
|
||||
GetView(view);
|
||||
if (nsnull != view) {
|
||||
fprintf(out, " [view=%p]", view);
|
||||
}
|
||||
|
||||
// Output the first/last content offset
|
||||
fprintf(out, "[%d,%d,%c] ", mFirstContentOffset, mLastContentOffset,
|
||||
(mLastContentIsComplete ? 'T' : 'F'));
|
||||
if (nsnull != mPrevInFlow) {
|
||||
fprintf(out, "prev-in-flow=%p ", mPrevInFlow);
|
||||
}
|
||||
if (nsnull != mNextInFlow) {
|
||||
fprintf(out, "next-in-flow=%p ", mNextInFlow);
|
||||
}
|
||||
// Output the first/last content offset
|
||||
fprintf(out, "[%d,%d,%c] ", mFirstContentOffset, mLastContentOffset,
|
||||
(mLastContentIsComplete ? 'T' : 'F'));
|
||||
if (nsnull != mPrevInFlow) {
|
||||
fprintf(out, "prev-in-flow=%p ", mPrevInFlow);
|
||||
}
|
||||
if (nsnull != mNextInFlow) {
|
||||
fprintf(out, "next-in-flow=%p ", mNextInFlow);
|
||||
}
|
||||
|
||||
// Output the rect
|
||||
out << mRect;
|
||||
// Output the rect
|
||||
out << mRect;
|
||||
}
|
||||
|
||||
// Output the children
|
||||
if (mChildCount > 0) {
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("<\n", out);
|
||||
}
|
||||
fputs("<\n", out);
|
||||
for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) {
|
||||
child->List(out, aIndent + 1);
|
||||
child->List(out, aIndent + 1, aFilter);
|
||||
}
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
fputs(">\n", out);
|
||||
}
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
fputs(">\n", out);
|
||||
} else {
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("<>\n", out);
|
||||
}
|
||||
fputs("<>\n", out);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -174,7 +174,7 @@ public:
|
|||
PRBool IsPseudoFrame() const;
|
||||
|
||||
// Debugging
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
NS_IMETHOD ListTag(FILE* out = stdout) const;
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
|
||||
|
|
|
@ -99,6 +99,70 @@ NS_LAYOUT PRBool nsIFrame::GetShowFrameBorders()
|
|||
return gShowFrameBorders;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////
|
||||
// Debug Listing Helper Class
|
||||
////////////////////////////////////////////////
|
||||
class TableListFilter : public nsIListFilter
|
||||
{
|
||||
private:
|
||||
static char* kTagTable[];
|
||||
|
||||
public:
|
||||
|
||||
TableListFilter()
|
||||
{};
|
||||
|
||||
virtual ~TableListFilter()
|
||||
{};
|
||||
|
||||
virtual PRBool OutputTag(nsAutoString *aTag) const
|
||||
{
|
||||
PRBool result = PR_FALSE;
|
||||
if (nsnull!=aTag && 0!=aTag->Length())
|
||||
{
|
||||
for (PRInt32 i=0; ; i++)
|
||||
{
|
||||
const char *tableTag = kTagTable[i];
|
||||
if (nsnull==tableTag)
|
||||
break;
|
||||
if (aTag->EqualsIgnoreCase(tableTag))
|
||||
{
|
||||
result = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
char* TableListFilter::kTagTable[] = {
|
||||
"table",
|
||||
"tbody", "thead", "tfoot",
|
||||
"tr", "td", "th",
|
||||
"colgroup", "col",
|
||||
//"caption", captions are left out because there's no caption frame
|
||||
// to hang a decent output method on.
|
||||
""
|
||||
};
|
||||
|
||||
NS_LAYOUT nsIListFilter * nsIFrame::GetFilter(nsString *aFilterName)
|
||||
{
|
||||
nsIListFilter *result = nsnull;
|
||||
if (nsnull!=aFilterName)
|
||||
{
|
||||
if (aFilterName->EqualsIgnoreCase("table"))
|
||||
{
|
||||
static nsIListFilter * tableListFilter;
|
||||
if (nsnull==tableListFilter)
|
||||
tableListFilter = new TableListFilter();
|
||||
result = tableListFilter;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: the log module is created during library initialization which
|
||||
* means that you cannot perform logging before then.
|
||||
|
@ -1389,22 +1453,34 @@ NS_METHOD nsFrame::IsTransparent(PRBool& aTransparent) const
|
|||
}
|
||||
|
||||
// Debugging
|
||||
NS_METHOD nsFrame::List(FILE* out, PRInt32 aIndent) const
|
||||
NS_METHOD nsFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
nsIAtom* tag;
|
||||
nsAutoString tagString;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull)
|
||||
{
|
||||
tag->ToString(tagString);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
if ((nsnull==aFilter) || (PR_TRUE==aFilter->OutputTag(&tagString)))
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Output the tag and rect
|
||||
ListTag(out);
|
||||
if (nsnull != mView) {
|
||||
fprintf(out, " [view=%p]", mView);
|
||||
// Output the tag and rect
|
||||
ListTag(out);
|
||||
if (nsnull != mView) {
|
||||
fprintf(out, " [view=%p]", mView);
|
||||
}
|
||||
fputs(" ", out);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("<>\n", out);
|
||||
}
|
||||
fputs(" ", out);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("<>\n", out);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -201,7 +201,7 @@ public:
|
|||
NS_IMETHOD GetNextSibling(nsIFrame*& aNextSibling) const;
|
||||
NS_IMETHOD SetNextSibling(nsIFrame* aNextSibling);
|
||||
NS_IMETHOD IsTransparent(PRBool& aTransparent) const;
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const;
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
NS_IMETHOD ListTag(FILE* out = stdout) const;
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
|
||||
|
|
|
@ -77,6 +77,8 @@
|
|||
// XXX Tuneup: if mNoWrap is true and we are given a ResizeReflow we
|
||||
// can just return because there's nothing to do!; this is true in
|
||||
// nsCSSInlineFrame too!
|
||||
// Except that noWrap is ignored if the containers width is too small
|
||||
// (like a table cell with a fixed width.)
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// XXX It's really important that blocks strip out extra whitespace;
|
||||
|
@ -144,7 +146,7 @@ public:
|
|||
NS_IMETHOD DidReflow(nsIPresContext& aPresContext,
|
||||
nsDidReflowStatus aStatus);
|
||||
#endif
|
||||
NS_IMETHOD List(FILE* out, PRInt32 aIndent) const;
|
||||
NS_IMETHOD List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter = nsnull) const;
|
||||
NS_IMETHOD ListTag(FILE* out) const;
|
||||
NS_IMETHOD VerifyTree() const;
|
||||
// XXX implement regular reflow method too!
|
||||
|
@ -302,7 +304,8 @@ struct LineData {
|
|||
|
||||
~LineData();
|
||||
|
||||
void List(FILE* out, PRInt32 aIndent) const;
|
||||
void List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter = nsnull,
|
||||
PRBool aOutputMe=PR_TRUE) const;
|
||||
|
||||
nsIFrame* LastChild() const;
|
||||
|
||||
|
@ -432,30 +435,39 @@ LineData::StateToString(char* aBuf, PRInt32 aBufSize) const
|
|||
}
|
||||
|
||||
void
|
||||
LineData::List(FILE* out, PRInt32 aIndent) const
|
||||
LineData::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter,
|
||||
PRBool aOutputMe) const
|
||||
{
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
PRInt32 i;
|
||||
for (i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
char cbuf[100];
|
||||
fprintf(out, "line %p: count=%d state=%s {%d,%d,%d,%d} ibm=%d obm=%d <\n",
|
||||
this, mChildCount, StateToString(cbuf, sizeof(cbuf)),
|
||||
mBounds.x, mBounds.y, mBounds.width, mBounds.height,
|
||||
mInnerBottomMargin, mOuterBottomMargin);
|
||||
|
||||
if (PR_TRUE==aOutputMe)
|
||||
{
|
||||
for (i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
char cbuf[100];
|
||||
fprintf(out, "line %p: count=%d state=%s {%d,%d,%d,%d} ibm=%d obm=%d <\n",
|
||||
this, mChildCount, StateToString(cbuf, sizeof(cbuf)),
|
||||
mBounds.x, mBounds.y, mBounds.width, mBounds.height,
|
||||
mInnerBottomMargin, mOuterBottomMargin);
|
||||
}
|
||||
|
||||
nsIFrame* frame = mFirstChild;
|
||||
PRInt32 n = mChildCount;
|
||||
while (--n >= 0) {
|
||||
frame->List(out, aIndent + 1);
|
||||
frame->List(out, aIndent + 1, aFilter);
|
||||
frame->GetNextSibling(frame);
|
||||
}
|
||||
|
||||
for (i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
if (PR_TRUE==aOutputMe)
|
||||
{
|
||||
for (i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
if (nsnull != mFloaters) {
|
||||
fputs("> bcl-floaters=<", out);
|
||||
ListFloaters(out, mFloaters);
|
||||
if (nsnull != mFloaters) {
|
||||
fputs("> bcl-floaters=<", out);
|
||||
ListFloaters(out, mFloaters);
|
||||
}
|
||||
fputs(">\n", out);
|
||||
}
|
||||
fputs(">\n", out);
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
|
@ -1053,73 +1065,95 @@ nsCSSBlockFrame::ListTag(FILE* out) const
|
|||
}
|
||||
|
||||
NS_METHOD
|
||||
nsCSSBlockFrame::List(FILE* out, PRInt32 aIndent) const
|
||||
nsCSSBlockFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
nsIAtom* tag;
|
||||
nsAutoString tagString;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull)
|
||||
{
|
||||
tag->ToString(tagString);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
|
||||
PRInt32 i;
|
||||
|
||||
// Indent
|
||||
for (i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Output the tag
|
||||
ListTag(out);
|
||||
nsIView* view;
|
||||
GetView(view);
|
||||
if (nsnull != view) {
|
||||
fprintf(out, " [view=%p]", view);
|
||||
}
|
||||
|
||||
// Output the first/last content offset
|
||||
fprintf(out, "[%d,%d,%c] ",
|
||||
GetFirstContentOffset(), GetLastContentOffset(),
|
||||
(GetLastContentIsComplete() ? 'T' : 'F'));
|
||||
if (nsnull != mPrevInFlow) {
|
||||
fprintf(out, "prev-in-flow=%p ", mPrevInFlow);
|
||||
}
|
||||
if (nsnull != mNextInFlow) {
|
||||
fprintf(out, "next-in-flow=%p ", mNextInFlow);
|
||||
}
|
||||
|
||||
// Output the rect and state
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
|
||||
#if XXX
|
||||
// Dump run-in floaters
|
||||
if (nsnull != mRunInFloaters) {
|
||||
fputs(" run-in-floaters=<", out);
|
||||
ListFloaters(out, mRunInFloaters);
|
||||
PRBool outputMe = (PRBool)((nsnull==aFilter) || ((PR_TRUE==aFilter->OutputTag(&tagString)) && (!IsPseudoFrame())));
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
// Indent
|
||||
for (i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
fputs(">", out);
|
||||
|
||||
// Output the tag
|
||||
ListTag(out);
|
||||
nsIView* view;
|
||||
GetView(view);
|
||||
if (nsnull != view) {
|
||||
fprintf(out, " [view=%p]", view);
|
||||
}
|
||||
|
||||
// Output the first/last content offset
|
||||
fprintf(out, "[%d,%d,%c] ",
|
||||
GetFirstContentOffset(), GetLastContentOffset(),
|
||||
(GetLastContentIsComplete() ? 'T' : 'F'));
|
||||
if (nsnull != mPrevInFlow) {
|
||||
fprintf(out, "prev-in-flow=%p ", mPrevInFlow);
|
||||
}
|
||||
if (nsnull != mNextInFlow) {
|
||||
fprintf(out, "next-in-flow=%p ", mNextInFlow);
|
||||
}
|
||||
|
||||
// Output the rect and state
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
|
||||
#if XXX
|
||||
// Dump run-in floaters
|
||||
if (nsnull != mRunInFloaters) {
|
||||
fputs(" run-in-floaters=<", out);
|
||||
ListFloaters(out, mRunInFloaters);
|
||||
for (i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
fputs(">", out);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// Output the children, one line at a time
|
||||
if (nsnull != mLines) {
|
||||
fputs("<\n", out);
|
||||
if (PR_TRUE==outputMe)
|
||||
fputs("<\n", out);
|
||||
aIndent++;
|
||||
LineData* line = mLines;
|
||||
while (nsnull != line) {
|
||||
line->List(out, aIndent);
|
||||
line->List(out, aIndent, aFilter, outputMe);
|
||||
line = line->mNext;
|
||||
}
|
||||
aIndent--;
|
||||
for (i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
fputs(">", out);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
for (i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
fputs(">", out);
|
||||
}
|
||||
}
|
||||
else {
|
||||
fputs("<>", out);
|
||||
if (PR_TRUE==outputMe)
|
||||
fputs("<>", out);
|
||||
}
|
||||
|
||||
// Output the text-runs
|
||||
if (nsnull != mTextRuns) {
|
||||
fputs(" text-runs=<\n", out);
|
||||
ListTextRuns(out, aIndent + 1, mTextRuns);
|
||||
for (i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
fputs(">", out);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
// Output the text-runs
|
||||
if (nsnull != mTextRuns) {
|
||||
fputs(" text-runs=<\n", out);
|
||||
ListTextRuns(out, aIndent + 1, mTextRuns);
|
||||
for (i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
fputs(">", out);
|
||||
}
|
||||
fputs("\n", out);
|
||||
}
|
||||
fputs("\n", out);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -36,6 +36,9 @@ class nsIStyleContext;
|
|||
class nsIView;
|
||||
class nsIWidget;
|
||||
class nsIReflowCommand;
|
||||
class nsIListFilter;
|
||||
class nsAutoString;
|
||||
class nsString;
|
||||
|
||||
struct nsPoint;
|
||||
struct nsRect;
|
||||
|
@ -620,9 +623,10 @@ public:
|
|||
NS_IMETHOD IsTransparent(PRBool& aTransparent) const = 0;
|
||||
|
||||
// Debugging
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0) const= 0;
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const= 0;
|
||||
NS_IMETHOD ListTag(FILE* out = stdout) const = 0;
|
||||
NS_IMETHOD VerifyTree() const = 0;
|
||||
static NS_LAYOUT nsIListFilter * GetFilter(nsString *aFilterName);
|
||||
|
||||
/**
|
||||
* See if tree verification is enabled. To enable tree verification add
|
||||
|
@ -735,4 +739,11 @@ inline nsReflowState::nsReflowState(nsIFrame* aFrame,
|
|||
minSize.height = 0;
|
||||
}
|
||||
|
||||
/* ----- nsIListFilter definition ----- */
|
||||
class nsIListFilter
|
||||
{
|
||||
public:
|
||||
virtual PRBool OutputTag(nsAutoString *aTag) const = 0;
|
||||
};
|
||||
|
||||
#endif /* nsIFrame_h___ */
|
||||
|
|
|
@ -92,7 +92,12 @@ public:
|
|||
const nsReflowState& aReflowState,
|
||||
nscoord aMaxWidth);
|
||||
|
||||
// these accessors are mostly for debugging purposes
|
||||
nscoord GetTableMinWidth() const;
|
||||
nscoord GetTableMaxWidth() const;
|
||||
nscoord GetTableFixedWidth() const;
|
||||
nscoord GetCOLSAttribute() const;
|
||||
nscoord GetNumCols() const;
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -253,8 +258,22 @@ protected:
|
|||
|
||||
};
|
||||
|
||||
// these accessors are mostly for debugging purposes
|
||||
inline nscoord BasicTableLayoutStrategy::GetTableMinWidth() const
|
||||
{ return mMinTableWidth; };
|
||||
|
||||
inline nscoord BasicTableLayoutStrategy::GetTableMaxWidth() const
|
||||
{ return mMaxTableWidth; };
|
||||
|
||||
inline nscoord BasicTableLayoutStrategy::GetTableFixedWidth() const
|
||||
{ return mFixedTableWidth; };
|
||||
|
||||
inline nscoord BasicTableLayoutStrategy::GetCOLSAttribute() const
|
||||
{ return mCols; };
|
||||
|
||||
inline nscoord BasicTableLayoutStrategy::GetNumCols() const
|
||||
{ return mNumCols; };
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -53,6 +53,26 @@ public:
|
|||
*/
|
||||
virtual nscoord GetTableMaxWidth() const = 0;
|
||||
|
||||
/** return the computed minimum possible size of the table.
|
||||
* this is the sum of the minimum sizes of the content taking into account table
|
||||
* attributes, but NOT factoring in the available size the table is laying out into.
|
||||
* the actual table width in a given situation will depend on the available size
|
||||
* provided by the parent (especially for percent-width tables.)
|
||||
*/
|
||||
virtual nscoord GetTableMinWidth() const = 0;
|
||||
|
||||
/** return the portion of the table width that is specified as "fixed" aka
|
||||
* the amount of table width that does not vary with available width or other
|
||||
* inputs to the table balancing algorithm.
|
||||
*/
|
||||
virtual nscoord GetTableFixedWidth() const = 0;
|
||||
|
||||
/** return the value of the COLS attribute, used for balancing column widths */
|
||||
virtual nscoord GetCOLSAttribute() const = 0;
|
||||
|
||||
/** return the total number of columns in the table */
|
||||
virtual nscoord GetNumCols() const = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1030,48 +1030,138 @@ void nsTableCellFrame::RecalcLayoutData(nsTableFrame* aTableFrame,
|
|||
mCalculated = NS_OK;
|
||||
}
|
||||
|
||||
/* ----- debugging methods ----- */
|
||||
NS_METHOD nsTableCellFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
// since this could be any "tag" with the right display type, we'll
|
||||
// just pretend it's a cell
|
||||
if (nsnull==aFilter)
|
||||
return nsContainerFrame::List(out, aIndent, aFilter);
|
||||
|
||||
nsAutoString tagString("td");
|
||||
PRBool outputMe = aFilter->OutputTag(&tagString);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Output the tag and rect
|
||||
nsIAtom* tag;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
nsAutoString buf;
|
||||
tag->ToString(buf);
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
PRInt32 contentIndex;
|
||||
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)", contentIndex);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("\n", out);
|
||||
}
|
||||
// Output the children
|
||||
if (mChildCount > 0) {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) {
|
||||
child->List(out, aIndent + 1, aFilter);
|
||||
}
|
||||
} else {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#if 0 //QQQ
|
||||
void nsTableCellFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
PRInt32 indent;
|
||||
|
||||
nsIContent* cell;
|
||||
|
||||
this->GetContent(cell);
|
||||
if (cell != nsnull)
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
nsIAtom* tag;
|
||||
nsAutoString tagString;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull)
|
||||
tag->ToString(tagString);
|
||||
if ((nsnull==aFilter) || (PR_TRUE==aFilter->OutputTag(&tagString)))
|
||||
{
|
||||
/*
|
||||
for (indent = aIndent; --indent >= 0; ) fputs(" ", out);
|
||||
fprintf(out,"RowSpan = %d ColSpan = %d \n",cell->GetRowSpan(),cell->GetColSpan());
|
||||
*/
|
||||
for (indent = aIndent; --indent >= 0; ) fputs(" ", out);
|
||||
fprintf(out,"Margin -- Top: %d Left: %d Bottom: %d Right: %d \n",
|
||||
NSTwipsToIntPoints(mMargin.top),
|
||||
NSTwipsToIntPoints(mMargin.left),
|
||||
NSTwipsToIntPoints(mMargin.bottom),
|
||||
NSTwipsToIntPoints(mMargin.right));
|
||||
PRInt32 indent;
|
||||
|
||||
nsIContent* cell;
|
||||
|
||||
this->GetContent(cell);
|
||||
if (cell != nsnull)
|
||||
{
|
||||
/*
|
||||
for (indent = aIndent; --indent >= 0; ) fputs(" ", out);
|
||||
fprintf(out,"RowSpan = %d ColSpan = %d \n",cell->GetRowSpan(),cell->GetColSpan());
|
||||
*/
|
||||
for (indent = aIndent; --indent >= 0; ) fputs(" ", out);
|
||||
fprintf(out,"Margin -- Top: %d Left: %d Bottom: %d Right: %d \n",
|
||||
NSTwipsToIntPoints(mMargin.top),
|
||||
NSTwipsToIntPoints(mMargin.left),
|
||||
NSTwipsToIntPoints(mMargin.bottom),
|
||||
NSTwipsToIntPoints(mMargin.right));
|
||||
|
||||
|
||||
for (indent = aIndent; --indent >= 0; ) fputs(" ", out);
|
||||
for (indent = aIndent; --indent >= 0; ) fputs(" ", out);
|
||||
|
||||
nscoord top,left,bottom,right;
|
||||
nscoord top,left,bottom,right;
|
||||
|
||||
top = (mBorderFrame[NS_SIDE_TOP] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_TOP], NS_SIDE_TOP) : 0);
|
||||
left = (mBorderFrame[NS_SIDE_LEFT] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_LEFT], NS_SIDE_LEFT) : 0);
|
||||
bottom = (mBorderFrame[NS_SIDE_BOTTOM] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_BOTTOM], NS_SIDE_BOTTOM) : 0);
|
||||
right = (mBorderFrame[NS_SIDE_RIGHT] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_RIGHT], NS_SIDE_RIGHT) : 0);
|
||||
top = (mBorderFrame[NS_SIDE_TOP] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_TOP], NS_SIDE_TOP) : 0);
|
||||
left = (mBorderFrame[NS_SIDE_LEFT] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_LEFT], NS_SIDE_LEFT) : 0);
|
||||
bottom = (mBorderFrame[NS_SIDE_BOTTOM] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_BOTTOM], NS_SIDE_BOTTOM) : 0);
|
||||
right = (mBorderFrame[NS_SIDE_RIGHT] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_RIGHT], NS_SIDE_RIGHT) : 0);
|
||||
|
||||
|
||||
fprintf(out,"Border -- Top: %d Left: %d Bottom: %d Right: %d \n",
|
||||
NSTwipsToIntPoints(top),
|
||||
NSTwipsToIntPoints(left),
|
||||
NSTwipsToIntPoints(bottom),
|
||||
NSTwipsToIntPoints(right));
|
||||
fprintf(out,"Border -- Top: %d Left: %d Bottom: %d Right: %d \n",
|
||||
NSTwipsToIntPoints(top),
|
||||
NSTwipsToIntPoints(left),
|
||||
NSTwipsToIntPoints(bottom),
|
||||
NSTwipsToIntPoints(right));
|
||||
|
||||
|
||||
|
||||
cell->List(out,aIndent);
|
||||
NS_RELEASE(cell);
|
||||
cell->List(out,aIndent);
|
||||
NS_RELEASE(cell);
|
||||
}
|
||||
}
|
||||
|
||||
// Output the children
|
||||
if (mChildCount > 0) {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
}
|
||||
for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) {
|
||||
child->List(out, aIndent + 1, aFilter);
|
||||
}
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
}
|
||||
} else {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -185,6 +185,8 @@ private:
|
|||
void CalculateMargins(nsTableFrame* aTableFrame,
|
||||
nsVoidArray* aBoundaryCells[4]);
|
||||
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
|
||||
protected:
|
||||
|
||||
/** protected constructor.
|
||||
|
|
|
@ -97,3 +97,40 @@ nsresult nsTableColFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* ----- debugging methods ----- */
|
||||
NS_METHOD nsTableColFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
// since this could be any "tag" with the right display type, we'll
|
||||
// just pretend it's a cell
|
||||
if (nsnull==aFilter)
|
||||
return nsFrame::List(out, aIndent, aFilter);
|
||||
|
||||
nsAutoString tagString("col");
|
||||
if (PR_TRUE==aFilter->OutputTag(&tagString))
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Output the tag and rect
|
||||
nsIAtom* tag;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
nsAutoString buf;
|
||||
tag->ToString(buf);
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
PRInt32 contentIndex;
|
||||
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)", contentIndex);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("\n", out);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
|
@ -77,6 +77,8 @@ public:
|
|||
/** convenience method, calls into cellmap */
|
||||
PRInt32 Count() const;
|
||||
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
|
||||
protected:
|
||||
|
||||
nsTableColFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
|
|
@ -256,4 +256,61 @@ nsresult nsTableColGroupFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* ----- debugging methods ----- */
|
||||
NS_METHOD nsTableColGroupFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
// since this could be any "tag" with the right display type, we'll
|
||||
// just pretend it's a colgroup
|
||||
if (nsnull==aFilter)
|
||||
return nsContainerFrame::List(out, aIndent, aFilter);
|
||||
|
||||
nsAutoString tagString("colgroup");
|
||||
PRBool outputMe = aFilter->OutputTag(&tagString);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Output the tag and rect
|
||||
nsIAtom* tag;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
nsAutoString buf;
|
||||
tag->ToString(buf);
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
PRInt32 contentIndex;
|
||||
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)", contentIndex);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("\n", out);
|
||||
}
|
||||
// Output the children
|
||||
if (mChildCount > 0) {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) {
|
||||
child->List(out, aIndent + 1, aFilter);
|
||||
}
|
||||
} else {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -60,6 +60,8 @@ public:
|
|||
|
||||
virtual void SetStartColumnIndex (PRInt32 aIndex);
|
||||
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
|
||||
protected:
|
||||
|
||||
nsTableColGroupFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
|
|
@ -3463,3 +3463,70 @@ PRBool nsTableFrame::TableIsAutoWidth(nsTableFrame *aTableFrame,
|
|||
return result;
|
||||
}
|
||||
|
||||
/* ----- debugging methods ----- */
|
||||
NS_METHOD nsTableFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
// since this could be any "tag" with the right display type, we'll
|
||||
// just pretend it's a table
|
||||
if (nsnull==aFilter)
|
||||
return nsContainerFrame::List(out, aIndent, aFilter);
|
||||
|
||||
nsAutoString tagString("table");
|
||||
PRBool outputMe = aFilter->OutputTag(&tagString);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Output the tag and rect
|
||||
nsIAtom* tag;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
nsAutoString buf;
|
||||
tag->ToString(buf);
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
PRInt32 contentIndex;
|
||||
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)", contentIndex);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("\n", out);
|
||||
if (nsnull!=mTableLayoutStrategy)
|
||||
{
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
fprintf(out, "min=%d, max=%d, fixed=%d, cols=%d, numCols=%d\n",
|
||||
mTableLayoutStrategy->GetTableMinWidth(),
|
||||
mTableLayoutStrategy->GetTableMaxWidth(),
|
||||
mTableLayoutStrategy->GetTableFixedWidth(),
|
||||
mTableLayoutStrategy->GetCOLSAttribute(),
|
||||
mTableLayoutStrategy->GetNumCols()
|
||||
);
|
||||
}
|
||||
}
|
||||
// Output the children
|
||||
if (mChildCount > 0) {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) {
|
||||
child->List(out, aIndent + 1, aFilter);
|
||||
}
|
||||
} else {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -233,6 +233,8 @@ public:
|
|||
|
||||
virtual void AddColumnFrame (nsTableColFrame *aColFrame);
|
||||
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
|
||||
protected:
|
||||
|
||||
/** protected constructor.
|
||||
|
|
|
@ -866,3 +866,61 @@ nsresult nsTableOuterFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
|||
*aInstancePtrResult = it;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* ----- debugging methods ----- */
|
||||
NS_METHOD nsTableOuterFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
// since this could be any "tag" with the right display type, we'll
|
||||
// just pretend it's a tbody
|
||||
if (nsnull==aFilter)
|
||||
return nsContainerFrame::List(out, aIndent, aFilter);
|
||||
|
||||
nsAutoString tagString("tbody");
|
||||
PRBool outputMe = aFilter->OutputTag(&tagString);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Output the tag and rect
|
||||
nsIAtom* tag;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
nsAutoString buf;
|
||||
tag->ToString(buf);
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
PRInt32 contentIndex;
|
||||
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)", contentIndex);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("\n", out);
|
||||
}
|
||||
// Output the children
|
||||
if (mChildCount > 0) {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) {
|
||||
child->List(out, aIndent + 1, aFilter);
|
||||
}
|
||||
} else {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,6 +65,8 @@ public:
|
|||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
|
||||
protected:
|
||||
|
||||
/** protected constructor
|
||||
|
|
|
@ -1005,3 +1005,61 @@ nsresult nsTableRowFrame::NewFrame( nsIFrame** aInstancePtrResult,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* ----- debugging methods ----- */
|
||||
NS_METHOD nsTableRowFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
// since this could be any "tag" with the right display type, we'll
|
||||
// just pretend it's a row
|
||||
if (nsnull==aFilter)
|
||||
return nsContainerFrame::List(out, aIndent, aFilter);
|
||||
|
||||
nsAutoString tagString("tr");
|
||||
PRBool outputMe = aFilter->OutputTag(&tagString);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Output the tag and rect
|
||||
nsIAtom* tag;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
nsAutoString buf;
|
||||
tag->ToString(buf);
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
PRInt32 contentIndex;
|
||||
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)", contentIndex);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("\n", out);
|
||||
}
|
||||
// Output the children
|
||||
if (mChildCount > 0) {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) {
|
||||
child->List(out, aIndent + 1, aFilter);
|
||||
}
|
||||
} else {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -111,6 +111,8 @@ public:
|
|||
/** set this row's starting row index */
|
||||
virtual void SetRowIndex (int aRowIndex);
|
||||
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
|
||||
protected:
|
||||
|
||||
/** protected constructor.
|
||||
|
|
|
@ -1210,45 +1210,68 @@ nsresult nsTableRowGroupFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// For Debugging ONLY
|
||||
NS_METHOD nsTableRowGroupFrame::MoveTo(nscoord aX, nscoord aY)
|
||||
/* ----- debugging methods ----- */
|
||||
NS_METHOD nsTableRowGroupFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
if ((aX != mRect.x) || (aY != mRect.y)) {
|
||||
mRect.x = aX;
|
||||
mRect.y = aY;
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
// since this could be any "tag" with the right display type, we'll
|
||||
// just pretend it's a tbody
|
||||
if (nsnull==aFilter)
|
||||
return nsContainerFrame::List(out, aIndent, aFilter);
|
||||
|
||||
nsIView* view;
|
||||
GetView(view);
|
||||
nsAutoString tagString("tbody");
|
||||
PRBool outputMe = aFilter->OutputTag(&tagString);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Let the view know
|
||||
if (nsnull != view) {
|
||||
// Position view relative to it's parent, not relative to our
|
||||
// parent frame (our parent frame may not have a view).
|
||||
nsIView* parentWithView;
|
||||
nsPoint origin;
|
||||
GetOffsetFromView(origin, parentWithView);
|
||||
view->SetPosition(origin.x, origin.y);
|
||||
// Output the tag and rect
|
||||
nsIAtom* tag;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
nsAutoString buf;
|
||||
tag->ToString(buf);
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
PRInt32 contentIndex;
|
||||
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)", contentIndex);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("\n", out);
|
||||
}
|
||||
|
||||
// Output the children
|
||||
if (mChildCount > 0) {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) {
|
||||
child->List(out, aIndent + 1, aFilter);
|
||||
}
|
||||
} else {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsTableRowGroupFrame::SizeTo(nscoord aWidth, nscoord aHeight)
|
||||
{
|
||||
mRect.width = aWidth;
|
||||
mRect.height = aHeight;
|
||||
|
||||
nsIView* view;
|
||||
GetView(view);
|
||||
|
||||
// Let the view know
|
||||
if (nsnull != view) {
|
||||
view->SetDimensions(aWidth, aHeight);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -94,9 +94,8 @@ public:
|
|||
/** return the number of contained rows */
|
||||
PRInt32 GetRowCount ();
|
||||
|
||||
// For DEBUGGING Purposes Only
|
||||
NS_IMETHOD MoveTo(nscoord aX, nscoord aY);
|
||||
NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight);
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -92,7 +92,12 @@ public:
|
|||
const nsReflowState& aReflowState,
|
||||
nscoord aMaxWidth);
|
||||
|
||||
// these accessors are mostly for debugging purposes
|
||||
nscoord GetTableMinWidth() const;
|
||||
nscoord GetTableMaxWidth() const;
|
||||
nscoord GetTableFixedWidth() const;
|
||||
nscoord GetCOLSAttribute() const;
|
||||
nscoord GetNumCols() const;
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -253,8 +258,22 @@ protected:
|
|||
|
||||
};
|
||||
|
||||
// these accessors are mostly for debugging purposes
|
||||
inline nscoord BasicTableLayoutStrategy::GetTableMinWidth() const
|
||||
{ return mMinTableWidth; };
|
||||
|
||||
inline nscoord BasicTableLayoutStrategy::GetTableMaxWidth() const
|
||||
{ return mMaxTableWidth; };
|
||||
|
||||
inline nscoord BasicTableLayoutStrategy::GetTableFixedWidth() const
|
||||
{ return mFixedTableWidth; };
|
||||
|
||||
inline nscoord BasicTableLayoutStrategy::GetCOLSAttribute() const
|
||||
{ return mCols; };
|
||||
|
||||
inline nscoord BasicTableLayoutStrategy::GetNumCols() const
|
||||
{ return mNumCols; };
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -53,6 +53,26 @@ public:
|
|||
*/
|
||||
virtual nscoord GetTableMaxWidth() const = 0;
|
||||
|
||||
/** return the computed minimum possible size of the table.
|
||||
* this is the sum of the minimum sizes of the content taking into account table
|
||||
* attributes, but NOT factoring in the available size the table is laying out into.
|
||||
* the actual table width in a given situation will depend on the available size
|
||||
* provided by the parent (especially for percent-width tables.)
|
||||
*/
|
||||
virtual nscoord GetTableMinWidth() const = 0;
|
||||
|
||||
/** return the portion of the table width that is specified as "fixed" aka
|
||||
* the amount of table width that does not vary with available width or other
|
||||
* inputs to the table balancing algorithm.
|
||||
*/
|
||||
virtual nscoord GetTableFixedWidth() const = 0;
|
||||
|
||||
/** return the value of the COLS attribute, used for balancing column widths */
|
||||
virtual nscoord GetCOLSAttribute() const = 0;
|
||||
|
||||
/** return the total number of columns in the table */
|
||||
virtual nscoord GetNumCols() const = 0;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1030,48 +1030,138 @@ void nsTableCellFrame::RecalcLayoutData(nsTableFrame* aTableFrame,
|
|||
mCalculated = NS_OK;
|
||||
}
|
||||
|
||||
/* ----- debugging methods ----- */
|
||||
NS_METHOD nsTableCellFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
// since this could be any "tag" with the right display type, we'll
|
||||
// just pretend it's a cell
|
||||
if (nsnull==aFilter)
|
||||
return nsContainerFrame::List(out, aIndent, aFilter);
|
||||
|
||||
nsAutoString tagString("td");
|
||||
PRBool outputMe = aFilter->OutputTag(&tagString);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Output the tag and rect
|
||||
nsIAtom* tag;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
nsAutoString buf;
|
||||
tag->ToString(buf);
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
PRInt32 contentIndex;
|
||||
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)", contentIndex);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("\n", out);
|
||||
}
|
||||
// Output the children
|
||||
if (mChildCount > 0) {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) {
|
||||
child->List(out, aIndent + 1, aFilter);
|
||||
}
|
||||
} else {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#if 0 //QQQ
|
||||
void nsTableCellFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
PRInt32 indent;
|
||||
|
||||
nsIContent* cell;
|
||||
|
||||
this->GetContent(cell);
|
||||
if (cell != nsnull)
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
nsIAtom* tag;
|
||||
nsAutoString tagString;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull)
|
||||
tag->ToString(tagString);
|
||||
if ((nsnull==aFilter) || (PR_TRUE==aFilter->OutputTag(&tagString)))
|
||||
{
|
||||
/*
|
||||
for (indent = aIndent; --indent >= 0; ) fputs(" ", out);
|
||||
fprintf(out,"RowSpan = %d ColSpan = %d \n",cell->GetRowSpan(),cell->GetColSpan());
|
||||
*/
|
||||
for (indent = aIndent; --indent >= 0; ) fputs(" ", out);
|
||||
fprintf(out,"Margin -- Top: %d Left: %d Bottom: %d Right: %d \n",
|
||||
NSTwipsToIntPoints(mMargin.top),
|
||||
NSTwipsToIntPoints(mMargin.left),
|
||||
NSTwipsToIntPoints(mMargin.bottom),
|
||||
NSTwipsToIntPoints(mMargin.right));
|
||||
PRInt32 indent;
|
||||
|
||||
nsIContent* cell;
|
||||
|
||||
this->GetContent(cell);
|
||||
if (cell != nsnull)
|
||||
{
|
||||
/*
|
||||
for (indent = aIndent; --indent >= 0; ) fputs(" ", out);
|
||||
fprintf(out,"RowSpan = %d ColSpan = %d \n",cell->GetRowSpan(),cell->GetColSpan());
|
||||
*/
|
||||
for (indent = aIndent; --indent >= 0; ) fputs(" ", out);
|
||||
fprintf(out,"Margin -- Top: %d Left: %d Bottom: %d Right: %d \n",
|
||||
NSTwipsToIntPoints(mMargin.top),
|
||||
NSTwipsToIntPoints(mMargin.left),
|
||||
NSTwipsToIntPoints(mMargin.bottom),
|
||||
NSTwipsToIntPoints(mMargin.right));
|
||||
|
||||
|
||||
for (indent = aIndent; --indent >= 0; ) fputs(" ", out);
|
||||
for (indent = aIndent; --indent >= 0; ) fputs(" ", out);
|
||||
|
||||
nscoord top,left,bottom,right;
|
||||
nscoord top,left,bottom,right;
|
||||
|
||||
top = (mBorderFrame[NS_SIDE_TOP] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_TOP], NS_SIDE_TOP) : 0);
|
||||
left = (mBorderFrame[NS_SIDE_LEFT] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_LEFT], NS_SIDE_LEFT) : 0);
|
||||
bottom = (mBorderFrame[NS_SIDE_BOTTOM] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_BOTTOM], NS_SIDE_BOTTOM) : 0);
|
||||
right = (mBorderFrame[NS_SIDE_RIGHT] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_RIGHT], NS_SIDE_RIGHT) : 0);
|
||||
top = (mBorderFrame[NS_SIDE_TOP] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_TOP], NS_SIDE_TOP) : 0);
|
||||
left = (mBorderFrame[NS_SIDE_LEFT] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_LEFT], NS_SIDE_LEFT) : 0);
|
||||
bottom = (mBorderFrame[NS_SIDE_BOTTOM] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_BOTTOM], NS_SIDE_BOTTOM) : 0);
|
||||
right = (mBorderFrame[NS_SIDE_RIGHT] ? GetBorderWidth((nsIFrame*)mBorderFrame[NS_SIDE_RIGHT], NS_SIDE_RIGHT) : 0);
|
||||
|
||||
|
||||
fprintf(out,"Border -- Top: %d Left: %d Bottom: %d Right: %d \n",
|
||||
NSTwipsToIntPoints(top),
|
||||
NSTwipsToIntPoints(left),
|
||||
NSTwipsToIntPoints(bottom),
|
||||
NSTwipsToIntPoints(right));
|
||||
fprintf(out,"Border -- Top: %d Left: %d Bottom: %d Right: %d \n",
|
||||
NSTwipsToIntPoints(top),
|
||||
NSTwipsToIntPoints(left),
|
||||
NSTwipsToIntPoints(bottom),
|
||||
NSTwipsToIntPoints(right));
|
||||
|
||||
|
||||
|
||||
cell->List(out,aIndent);
|
||||
NS_RELEASE(cell);
|
||||
cell->List(out,aIndent);
|
||||
NS_RELEASE(cell);
|
||||
}
|
||||
}
|
||||
|
||||
// Output the children
|
||||
if (mChildCount > 0) {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
}
|
||||
for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) {
|
||||
child->List(out, aIndent + 1, aFilter);
|
||||
}
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
}
|
||||
} else {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -185,6 +185,8 @@ private:
|
|||
void CalculateMargins(nsTableFrame* aTableFrame,
|
||||
nsVoidArray* aBoundaryCells[4]);
|
||||
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
|
||||
protected:
|
||||
|
||||
/** protected constructor.
|
||||
|
|
|
@ -97,3 +97,40 @@ nsresult nsTableColFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* ----- debugging methods ----- */
|
||||
NS_METHOD nsTableColFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
// since this could be any "tag" with the right display type, we'll
|
||||
// just pretend it's a cell
|
||||
if (nsnull==aFilter)
|
||||
return nsFrame::List(out, aIndent, aFilter);
|
||||
|
||||
nsAutoString tagString("col");
|
||||
if (PR_TRUE==aFilter->OutputTag(&tagString))
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Output the tag and rect
|
||||
nsIAtom* tag;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
nsAutoString buf;
|
||||
tag->ToString(buf);
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
PRInt32 contentIndex;
|
||||
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)", contentIndex);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("\n", out);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
|
@ -77,6 +77,8 @@ public:
|
|||
/** convenience method, calls into cellmap */
|
||||
PRInt32 Count() const;
|
||||
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
|
||||
protected:
|
||||
|
||||
nsTableColFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
|
|
@ -256,4 +256,61 @@ nsresult nsTableColGroupFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* ----- debugging methods ----- */
|
||||
NS_METHOD nsTableColGroupFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
// since this could be any "tag" with the right display type, we'll
|
||||
// just pretend it's a colgroup
|
||||
if (nsnull==aFilter)
|
||||
return nsContainerFrame::List(out, aIndent, aFilter);
|
||||
|
||||
nsAutoString tagString("colgroup");
|
||||
PRBool outputMe = aFilter->OutputTag(&tagString);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Output the tag and rect
|
||||
nsIAtom* tag;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
nsAutoString buf;
|
||||
tag->ToString(buf);
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
PRInt32 contentIndex;
|
||||
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)", contentIndex);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("\n", out);
|
||||
}
|
||||
// Output the children
|
||||
if (mChildCount > 0) {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) {
|
||||
child->List(out, aIndent + 1, aFilter);
|
||||
}
|
||||
} else {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -60,6 +60,8 @@ public:
|
|||
|
||||
virtual void SetStartColumnIndex (PRInt32 aIndex);
|
||||
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
|
||||
protected:
|
||||
|
||||
nsTableColGroupFrame(nsIContent* aContent, nsIFrame* aParentFrame);
|
||||
|
|
|
@ -3463,3 +3463,70 @@ PRBool nsTableFrame::TableIsAutoWidth(nsTableFrame *aTableFrame,
|
|||
return result;
|
||||
}
|
||||
|
||||
/* ----- debugging methods ----- */
|
||||
NS_METHOD nsTableFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
// since this could be any "tag" with the right display type, we'll
|
||||
// just pretend it's a table
|
||||
if (nsnull==aFilter)
|
||||
return nsContainerFrame::List(out, aIndent, aFilter);
|
||||
|
||||
nsAutoString tagString("table");
|
||||
PRBool outputMe = aFilter->OutputTag(&tagString);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Output the tag and rect
|
||||
nsIAtom* tag;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
nsAutoString buf;
|
||||
tag->ToString(buf);
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
PRInt32 contentIndex;
|
||||
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)", contentIndex);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("\n", out);
|
||||
if (nsnull!=mTableLayoutStrategy)
|
||||
{
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
fprintf(out, "min=%d, max=%d, fixed=%d, cols=%d, numCols=%d\n",
|
||||
mTableLayoutStrategy->GetTableMinWidth(),
|
||||
mTableLayoutStrategy->GetTableMaxWidth(),
|
||||
mTableLayoutStrategy->GetTableFixedWidth(),
|
||||
mTableLayoutStrategy->GetCOLSAttribute(),
|
||||
mTableLayoutStrategy->GetNumCols()
|
||||
);
|
||||
}
|
||||
}
|
||||
// Output the children
|
||||
if (mChildCount > 0) {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) {
|
||||
child->List(out, aIndent + 1, aFilter);
|
||||
}
|
||||
} else {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -233,6 +233,8 @@ public:
|
|||
|
||||
virtual void AddColumnFrame (nsTableColFrame *aColFrame);
|
||||
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
|
||||
protected:
|
||||
|
||||
/** protected constructor.
|
||||
|
|
|
@ -866,3 +866,61 @@ nsresult nsTableOuterFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
|||
*aInstancePtrResult = it;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* ----- debugging methods ----- */
|
||||
NS_METHOD nsTableOuterFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
// since this could be any "tag" with the right display type, we'll
|
||||
// just pretend it's a tbody
|
||||
if (nsnull==aFilter)
|
||||
return nsContainerFrame::List(out, aIndent, aFilter);
|
||||
|
||||
nsAutoString tagString("tbody");
|
||||
PRBool outputMe = aFilter->OutputTag(&tagString);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Output the tag and rect
|
||||
nsIAtom* tag;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
nsAutoString buf;
|
||||
tag->ToString(buf);
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
PRInt32 contentIndex;
|
||||
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)", contentIndex);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("\n", out);
|
||||
}
|
||||
// Output the children
|
||||
if (mChildCount > 0) {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) {
|
||||
child->List(out, aIndent + 1, aFilter);
|
||||
}
|
||||
} else {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,6 +65,8 @@ public:
|
|||
nsIStyleContext* aStyleContext,
|
||||
nsIFrame*& aContinuingFrame);
|
||||
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
|
||||
protected:
|
||||
|
||||
/** protected constructor
|
||||
|
|
|
@ -1005,3 +1005,61 @@ nsresult nsTableRowFrame::NewFrame( nsIFrame** aInstancePtrResult,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* ----- debugging methods ----- */
|
||||
NS_METHOD nsTableRowFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
// since this could be any "tag" with the right display type, we'll
|
||||
// just pretend it's a row
|
||||
if (nsnull==aFilter)
|
||||
return nsContainerFrame::List(out, aIndent, aFilter);
|
||||
|
||||
nsAutoString tagString("tr");
|
||||
PRBool outputMe = aFilter->OutputTag(&tagString);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Output the tag and rect
|
||||
nsIAtom* tag;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
nsAutoString buf;
|
||||
tag->ToString(buf);
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
PRInt32 contentIndex;
|
||||
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)", contentIndex);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("\n", out);
|
||||
}
|
||||
// Output the children
|
||||
if (mChildCount > 0) {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) {
|
||||
child->List(out, aIndent + 1, aFilter);
|
||||
}
|
||||
} else {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -111,6 +111,8 @@ public:
|
|||
/** set this row's starting row index */
|
||||
virtual void SetRowIndex (int aRowIndex);
|
||||
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
|
||||
protected:
|
||||
|
||||
/** protected constructor.
|
||||
|
|
|
@ -1210,45 +1210,68 @@ nsresult nsTableRowGroupFrame::NewFrame(nsIFrame** aInstancePtrResult,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// For Debugging ONLY
|
||||
NS_METHOD nsTableRowGroupFrame::MoveTo(nscoord aX, nscoord aY)
|
||||
/* ----- debugging methods ----- */
|
||||
NS_METHOD nsTableRowGroupFrame::List(FILE* out, PRInt32 aIndent, nsIListFilter *aFilter) const
|
||||
{
|
||||
if ((aX != mRect.x) || (aY != mRect.y)) {
|
||||
mRect.x = aX;
|
||||
mRect.y = aY;
|
||||
// if a filter is present, only output this frame if the filter says we should
|
||||
// since this could be any "tag" with the right display type, we'll
|
||||
// just pretend it's a tbody
|
||||
if (nsnull==aFilter)
|
||||
return nsContainerFrame::List(out, aIndent, aFilter);
|
||||
|
||||
nsIView* view;
|
||||
GetView(view);
|
||||
nsAutoString tagString("tbody");
|
||||
PRBool outputMe = aFilter->OutputTag(&tagString);
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
// Indent
|
||||
for (PRInt32 i = aIndent; --i >= 0; ) fputs(" ", out);
|
||||
|
||||
// Let the view know
|
||||
if (nsnull != view) {
|
||||
// Position view relative to it's parent, not relative to our
|
||||
// parent frame (our parent frame may not have a view).
|
||||
nsIView* parentWithView;
|
||||
nsPoint origin;
|
||||
GetOffsetFromView(origin, parentWithView);
|
||||
view->SetPosition(origin.x, origin.y);
|
||||
// Output the tag and rect
|
||||
nsIAtom* tag;
|
||||
mContent->GetTag(tag);
|
||||
if (tag != nsnull) {
|
||||
nsAutoString buf;
|
||||
tag->ToString(buf);
|
||||
fputs(buf, out);
|
||||
NS_RELEASE(tag);
|
||||
}
|
||||
PRInt32 contentIndex;
|
||||
|
||||
GetContentIndex(contentIndex);
|
||||
fprintf(out, "(%d)", contentIndex);
|
||||
out << mRect;
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]", mState);
|
||||
}
|
||||
fputs("\n", out);
|
||||
}
|
||||
|
||||
// Output the children
|
||||
if (mChildCount > 0) {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
for (nsIFrame* child = mFirstChild; child; NextChild(child, child)) {
|
||||
child->List(out, aIndent + 1, aFilter);
|
||||
}
|
||||
} else {
|
||||
if (PR_TRUE==outputMe)
|
||||
{
|
||||
if (0 != mState) {
|
||||
fprintf(out, " [state=%08x]\n", mState);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_METHOD nsTableRowGroupFrame::SizeTo(nscoord aWidth, nscoord aHeight)
|
||||
{
|
||||
mRect.width = aWidth;
|
||||
mRect.height = aHeight;
|
||||
|
||||
nsIView* view;
|
||||
GetView(view);
|
||||
|
||||
// Let the view know
|
||||
if (nsnull != view) {
|
||||
view->SetDimensions(aWidth, aHeight);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -94,9 +94,8 @@ public:
|
|||
/** return the number of contained rows */
|
||||
PRInt32 GetRowCount ();
|
||||
|
||||
// For DEBUGGING Purposes Only
|
||||
NS_IMETHOD MoveTo(nscoord aX, nscoord aY);
|
||||
NS_IMETHOD SizeTo(nscoord aWidth, nscoord aHeight);
|
||||
NS_IMETHOD List(FILE* out = stdout, PRInt32 aIndent = 0, nsIListFilter *aFilter = nsnull) const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче