Fix incorrect check of position property in IsPercentageBase. b=180845 r=roc sr=bzbarsky

This commit is contained in:
dbaron%fas.harvard.edu 2002-12-11 02:29:35 +00:00
Родитель 5a50d2c541
Коммит 47a8d26973
2 изменённых файлов: 22 добавлений и 30 удалений

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

@ -2079,6 +2079,10 @@ nsFrame::GetFrameForPoint(nsIPresContext* aPresContext,
NS_IMETHODIMP NS_IMETHODIMP
nsFrame::WillReflow(nsIPresContext* aPresContext) nsFrame::WillReflow(nsIPresContext* aPresContext)
{ {
// bug 81268
NS_ASSERTION(!(mState & NS_FRAME_IN_REFLOW),
"nsFrame::WillReflow: frame is already in reflow");
NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS, NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS,
("WillReflow: oldState=%x", mState)); ("WillReflow: oldState=%x", mState));
mState |= NS_FRAME_IN_REFLOW; mState |= NS_FRAME_IN_REFLOW;
@ -2625,21 +2629,13 @@ nsFrame::IsFrameTreeTooDeep(const nsHTMLReflowState& aReflowState,
NS_IMETHODIMP nsFrame::IsPercentageBase(PRBool& aBase) const NS_IMETHODIMP nsFrame::IsPercentageBase(PRBool& aBase) const
{ {
const nsStyleDisplay* display; const nsStyleDisplay* display;
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display); ::GetStyleData(mStyleContext, &display);
if (display->mPosition != NS_STYLE_POSITION_STATIC) { // Absolute positioning causes |display->mDisplay| to be set to block,
aBase = PR_TRUE; // if needed.
} aBase = display->mDisplay == NS_STYLE_DISPLAY_BLOCK ||
else { display->mDisplay == NS_STYLE_DISPLAY_LIST_ITEM ||
if ((display->mDisplay == NS_STYLE_DISPLAY_BLOCK) || display->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL;
(display->mDisplay == NS_STYLE_DISPLAY_LIST_ITEM) ||
(display->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL)) {
aBase = PR_TRUE;
}
else {
aBase = PR_FALSE;
}
}
return NS_OK; return NS_OK;
} }

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

@ -2079,6 +2079,10 @@ nsFrame::GetFrameForPoint(nsIPresContext* aPresContext,
NS_IMETHODIMP NS_IMETHODIMP
nsFrame::WillReflow(nsIPresContext* aPresContext) nsFrame::WillReflow(nsIPresContext* aPresContext)
{ {
// bug 81268
NS_ASSERTION(!(mState & NS_FRAME_IN_REFLOW),
"nsFrame::WillReflow: frame is already in reflow");
NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS, NS_FRAME_TRACE_MSG(NS_FRAME_TRACE_CALLS,
("WillReflow: oldState=%x", mState)); ("WillReflow: oldState=%x", mState));
mState |= NS_FRAME_IN_REFLOW; mState |= NS_FRAME_IN_REFLOW;
@ -2625,21 +2629,13 @@ nsFrame::IsFrameTreeTooDeep(const nsHTMLReflowState& aReflowState,
NS_IMETHODIMP nsFrame::IsPercentageBase(PRBool& aBase) const NS_IMETHODIMP nsFrame::IsPercentageBase(PRBool& aBase) const
{ {
const nsStyleDisplay* display; const nsStyleDisplay* display;
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display); ::GetStyleData(mStyleContext, &display);
if (display->mPosition != NS_STYLE_POSITION_STATIC) { // Absolute positioning causes |display->mDisplay| to be set to block,
aBase = PR_TRUE; // if needed.
} aBase = display->mDisplay == NS_STYLE_DISPLAY_BLOCK ||
else { display->mDisplay == NS_STYLE_DISPLAY_LIST_ITEM ||
if ((display->mDisplay == NS_STYLE_DISPLAY_BLOCK) || display->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL;
(display->mDisplay == NS_STYLE_DISPLAY_LIST_ITEM) ||
(display->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL)) {
aBase = PR_TRUE;
}
else {
aBase = PR_FALSE;
}
}
return NS_OK; return NS_OK;
} }