fixed IsNested to account for outer table frame

removed obsolete debug code
This commit is contained in:
buster%netscape.com 1999-03-01 06:40:24 +00:00
parent 1bf8790f66
commit e03330c847
4 changed files with 20 additions and 20 deletions

View File

@ -4832,21 +4832,16 @@ NS_METHOD nsTableFrame::GetTableFrame(nsIFrame *aSourceFrame, nsTableFrame *& aT
}
/* helper method for determining if this is a nested table or not */
// aReflowState must be the reflow state for this inner table frame, should have an assertion here for that
PRBool nsTableFrame::IsNested(const nsHTMLReflowState& aReflowState, const nsStylePosition *& aPosition) const
{
PRBool result = PR_FALSE;
#ifdef NS_DEBUG
PRInt32 counter=0;
#endif
// Walk up the reflow state chain until we find a cell or the root
const nsReflowState* rs = aReflowState.parentReflowState;
const nsReflowState* rs = aReflowState.parentReflowState; // this is for the outer frame
if (rs)
rs = rs->parentReflowState; // and this is the parent of the outer frame
while (nsnull != rs)
{
#ifdef NS_DEBUG
counter++;
NS_ASSERTION(counter<100000, "infinite loop in IsNested");
break;
#endif
const nsStyleDisplay *display;
rs->frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE==display->mDisplay)

View File

@ -91,7 +91,12 @@ public:
/** @see nsIFrame::DeleteFrame */
NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext);
/** helper method for determining if this is a nested table or not */
/** helper method for determining if this is a nested table or not
* @param aReflowState The reflow state for this inner table frame
* @param aPosition [OUT] The position style struct for the parent table, if nested.
* If not nested, undefined.
* @return PR_TRUE if this table is nested inside another table.
*/
PRBool IsNested(const nsHTMLReflowState& aReflowState, const nsStylePosition *& aPosition) const;
/** helper method to find the table parent of any table frame object */

View File

@ -4832,21 +4832,16 @@ NS_METHOD nsTableFrame::GetTableFrame(nsIFrame *aSourceFrame, nsTableFrame *& aT
}
/* helper method for determining if this is a nested table or not */
// aReflowState must be the reflow state for this inner table frame, should have an assertion here for that
PRBool nsTableFrame::IsNested(const nsHTMLReflowState& aReflowState, const nsStylePosition *& aPosition) const
{
PRBool result = PR_FALSE;
#ifdef NS_DEBUG
PRInt32 counter=0;
#endif
// Walk up the reflow state chain until we find a cell or the root
const nsReflowState* rs = aReflowState.parentReflowState;
const nsReflowState* rs = aReflowState.parentReflowState; // this is for the outer frame
if (rs)
rs = rs->parentReflowState; // and this is the parent of the outer frame
while (nsnull != rs)
{
#ifdef NS_DEBUG
counter++;
NS_ASSERTION(counter<100000, "infinite loop in IsNested");
break;
#endif
const nsStyleDisplay *display;
rs->frame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)display);
if (NS_STYLE_DISPLAY_TABLE==display->mDisplay)

View File

@ -91,7 +91,12 @@ public:
/** @see nsIFrame::DeleteFrame */
NS_IMETHOD DeleteFrame(nsIPresContext& aPresContext);
/** helper method for determining if this is a nested table or not */
/** helper method for determining if this is a nested table or not
* @param aReflowState The reflow state for this inner table frame
* @param aPosition [OUT] The position style struct for the parent table, if nested.
* If not nested, undefined.
* @return PR_TRUE if this table is nested inside another table.
*/
PRBool IsNested(const nsHTMLReflowState& aReflowState, const nsStylePosition *& aPosition) const;
/** helper method to find the table parent of any table frame object */