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
Родитель 0875a55f81
Коммит 9cce6dd738
4 изменённых файлов: 20 добавлений и 20 удалений

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

@ -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)

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

@ -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 */

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

@ -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)

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

@ -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 */