Don't call CalculateContentBottom inside PR_MAX(), which evaluates its arguments twice. (Bug 511482) r=dbaron

This commit is contained in:
Mats Palmgren 2009-08-22 10:10:11 -07:00
parent fe67eb2e36
commit 96372404b6
3 changed files with 47 additions and 4 deletions

View File

@ -2650,11 +2650,11 @@ CalculateBlockContentBottom(nsBlockFrame* aFrame)
if (line->IsBlock()) {
nsIFrame* child = line->mFirstChild;
nscoord offset = child->GetRect().y - child->GetRelativeOffset().y;
contentBottom = PR_MAX(contentBottom,
contentBottom = NS_MAX(contentBottom,
nsLayoutUtils::CalculateContentBottom(child) + offset);
}
else {
contentBottom = PR_MAX(contentBottom, line->mBounds.YMost());
contentBottom = NS_MAX(contentBottom, line->mBounds.YMost());
}
}
return contentBottom;
@ -2673,7 +2673,7 @@ nsLayoutUtils::CalculateContentBottom(nsIFrame* aFrame)
PRIntn nextListID = 0;
do {
if (childList == nsnull && blockFrame) {
contentBottom = PR_MAX(contentBottom, CalculateBlockContentBottom(blockFrame));
contentBottom = NS_MAX(contentBottom, CalculateBlockContentBottom(blockFrame));
}
else if (childList != nsGkAtoms::overflowList &&
childList != nsGkAtoms::excessOverflowContainersList &&
@ -2683,7 +2683,7 @@ nsLayoutUtils::CalculateContentBottom(nsIFrame* aFrame)
child; child = child->GetNextSibling())
{
nscoord offset = child->GetRect().y - child->GetRelativeOffset().y;
contentBottom = PR_MAX(contentBottom,
contentBottom = NS_MAX(contentBottom,
CalculateContentBottom(child) + offset);
}
}

View File

@ -0,0 +1,42 @@
<html>
<body>
<div style="border: 5px solid blue;">
<div style="-moz-column-width: 530px;height:300px; border: 5px solid red;">
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
<div style="width:128px; height:128px;border: 5px solid green" >
</div>
</div>
</body>
</html>

View File

@ -244,3 +244,4 @@ load 494332-1.html
load 501535-1.html
load 505912-1.html
# load 508115-1.html
load 511482.html