Bug 389462 - columns don't reflow on resize r=roc

This commit is contained in:
fantasai 2009-07-06 18:23:24 -07:00
parent a42bca591e
commit ed9e1a5bd5
8 changed files with 141 additions and 2 deletions

View File

@ -1777,7 +1777,17 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
PRBool selfDirty = (GetStateBits() & NS_FRAME_IS_DIRTY) ||
(aState.mReflowState.mFlags.mVResize &&
(GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_HEIGHT));
// Reflow our last line if our availableHeight has increased
// so that we (and our last child) pull up content as necessary
if (aState.mReflowState.availableHeight != NS_UNCONSTRAINEDSIZE
&& GetNextInFlow() && aState.mReflowState.availableHeight > mRect.height) {
line_iterator lastLine = end_lines();
if (lastLine != begin_lines()) {
--lastLine;
lastLine->MarkDirty();
}
}
// the amount by which we will slide the current line if it is not
// dirty
nscoord deltaY = 0;

View File

@ -591,7 +591,7 @@ nsColumnSetFrame::ReflowChildren(nsHTMLReflowMetrics& aDesiredSize,
// content from its next sibling. (Note that it might be the last
// column, but not be the last child because the desired number of columns
// has changed.)
PRBool skipIncremental = !(GetStateBits() & NS_FRAME_IS_DIRTY)
PRBool skipIncremental = !aReflowState.ShouldReflowAllKids()
&& !NS_SUBTREE_DIRTY(child)
&& child->GetNextSibling()
&& !(aUnboundedLastColumn && columnCount == aConfig.mBalanceColCount - 1)
@ -907,6 +907,16 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
// Initialize OUT parameter
aStatus = NS_FRAME_COMPLETE;
// Our children depend on our height if we have a fixed height.
if (aReflowState.ComputedHeight() != NS_AUTOHEIGHT) {
NS_ASSERTION(aReflowState.ComputedHeight() != NS_INTRINSICSIZE,
"Unexpected mComputedHeight");
AddStateBits(NS_FRAME_CONTAINS_RELATIVE_HEIGHT);
}
else {
RemoveStateBits(NS_FRAME_CONTAINS_RELATIVE_HEIGHT);
}
//------------ Handle Incremental Reflow -----------------
ReflowConfig config = ChooseColumnStrategy(aReflowState);

View File

@ -23,3 +23,5 @@ fails == border-breaking-004-cols.xhtml border-breaking-002-cols.ref.xhtml
== abspos-breaking-000.xhtml abspos-breaking-000.ref.xhtml
== abspos-breaking-001.xhtml abspos-breaking-000.ref.xhtml
== abspos-breaking-002.xhtml abspos-breaking-000.ref.xhtml
== resize-reflow-000.html resize-reflow-000.ref.html
== resize-reflow-001.html resize-reflow-001.ref.html

View File

@ -0,0 +1,28 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Resize Reflow Test</title>
</head>
<body>
<div style="-moz-column-width: 12em;
border: silver solid;
width: 30em" id="outer">
x <div style="border: dotted;
background: aqua;
color: gray;">
blah<br>
blah<br>
blah<br>
blah
</div>
</div>
<script>
document.body.offsetWidth;
n = document.getElementById("outer").firstChild;
n.data = ' ';
</script>
</body>
</html>

View File

@ -0,0 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Resize Reflow Test</title>
</head>
<body>
<div style="-moz-column-width: 12em;
border: silver solid;
width: 30em" id="outer">
<div style="border: dotted;
background: aqua;
color: gray;">
blah<br>
blah<br>
blah<br>
blah
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<html class="reftest-wait">
<title>Resize Reflow Harness</title>
<style>
html,body { height: 100%; }
</style>
<body onload="
var iframe = document.getElementById('outer')
iframe.style.width = '50em';
iframe.contentDocument.body.offsetWidth;
iframe.style.width = '28em';
document.documentElement.className = '';
">
<iframe id="outer" src="resize-reflow-001.inner.html" height="90%" frameborder=0></iframe>
<script>
</script>

View File

@ -0,0 +1,26 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Resize Reflow Test</title>
<style>
html, body { margin: 0; padding: 0; }
html { overflow: hidden }
</style>
</head>
<body>
<div style="-moz-column-width: 12em;
border: silver solid;
height: 3em;">
<div style="border: dotted;
background: aqua;
color: gray;">
blah<br>
blah<br>
blah<br>
blah
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Resize Reflow Test</title>
</head>
<body style="width: 28em">
<div style="-moz-column-width: 12em;
border: silver solid;
height: 3em;">
<div style="border: dotted;
background: aqua;
color: gray;">
blah<br>
blah<br>
blah<br>
blah
</div>
</div>
</body>
</html>