Bug 363391. nsSubdocumentFrame::Reflow should not call nsLeafFrame::Reflow directly because we don't want to call FinishAndStoreOverflow twice. patch by Andrew Smith, r+sr=roc

This commit is contained in:
roc+@cs.cmu.edu 2008-01-20 18:03:08 -08:00
Родитель 6e7fb01b78
Коммит 1f70a081a8
3 изменённых файлов: 24 добавлений и 4 удалений

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

@ -486,7 +486,7 @@ nsSubDocumentFrame::Reflow(nsPresContext* aPresContext,
if (IsInline()) {
// XUL <iframe> or <browser>, or HTML <iframe>, <object> or <embed>
nsresult rv = nsLeafFrame::Reflow(aPresContext, aDesiredSize, aReflowState,
nsresult rv = nsLeafFrame::DoReflow(aPresContext, aDesiredSize, aReflowState,
aStatus);
NS_ENSURE_SUCCESS(rv, rv);

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

@ -86,6 +86,18 @@ nsLeafFrame::Reflow(nsPresContext* aPresContext,
NS_ASSERTION(aReflowState.ComputedWidth() != NS_UNCONSTRAINEDSIZE,
"Shouldn't have unconstrained stuff here");
DoReflow(aPresContext, aMetrics, aReflowState, aStatus);
FinishAndStoreOverflow(&aMetrics);
return NS_OK;
}
NS_IMETHODIMP
nsLeafFrame::DoReflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aMetrics,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
aMetrics.width = aReflowState.ComputedWidth();
if (NS_INTRINSICSIZE != aReflowState.ComputedHeight()) {
aMetrics.height = aReflowState.ComputedHeight();
@ -101,13 +113,13 @@ nsLeafFrame::Reflow(nsPresContext* aPresContext,
aStatus = NS_FRAME_COMPLETE;
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("exit nsLeafFrame::Reflow: size=%d,%d",
("exit nsLeafFrame::DoReflow: size=%d,%d",
aMetrics.width, aMetrics.height));
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
aMetrics.mOverflowArea =
nsRect(0, 0, aMetrics.width, aMetrics.height);
FinishAndStoreOverflow(&aMetrics);
return NS_OK;
}

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

@ -78,6 +78,14 @@ public:
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
/**
* This method does most of the work that Reflow() above need done.
*/
NS_IMETHOD DoReflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
virtual PRBool IsFrameOfType(PRUint32 aFlags) const
{
// We don't actually contain a block, but we do always want a