Temporarily forget the line container while calculating widths for next-in-flow children. b=477928 r+sr=roc

This commit is contained in:
Mats Palmgren 2009-02-19 21:18:52 +01:00
parent ba3d343cb3
commit f1bdfe1672
3 changed files with 26 additions and 3 deletions

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<script>
function boom()
{
document.getElementById("a").appendChild(document.createTextNode("\n"));
}
</script>
</head>
<body onload="boom();">
<div id="a" style="max-width: -moz-max-content; -moz-column-count: 2;"><span style="white-space: pre-line;"><span>
</span>
</span></div>
</body>
</html>

View File

@ -193,3 +193,4 @@ load 465651-1.html
load 467487-1.html
load 468207-1.html
load 472950-1.html
load 477928.html

View File

@ -717,10 +717,11 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
}
const nsLineList_iterator* savedLine = aData->line;
nsIFrame* const savedLineContainer = aData->lineContainer;
nsContainerFrame *lastInFlow;
for (nsContainerFrame *nif = this; nif;
nif = (nsContainerFrame*) nif->GetNextInFlow()) {
nif = static_cast<nsContainerFrame*>(nif->GetNextInFlow())) {
for (nsIFrame *kid = nif->mFrames.FirstChild(); kid;
kid = kid->GetNextSibling()) {
if (aType == nsLayoutUtils::MIN_WIDTH)
@ -731,13 +732,16 @@ nsContainerFrame::DoInlineIntrinsicWidth(nsIRenderingContext *aRenderingContext,
static_cast<InlinePrefWidthData*>(aData));
}
// After we advance to our next-in-flow, the stored line may not
// longer be the correct line. Just forget it.
// After we advance to our next-in-flow, the stored line and line container
// may no longer be correct. Just forget them.
aData->line = nsnull;
aData->lineContainer = nsnull;
lastInFlow = nif;
}
aData->line = savedLine;
aData->lineContainer = savedLineContainer;
// This goes at the end no matter how things are broken and how
// messy the bidi situations are, since per CSS2.1 section 8.6