Bug 413048. Disable float breaking in columns. r+sr=dbaron

This commit is contained in:
Robert O'Callahan 2008-08-12 21:32:10 +12:00
parent c608a29bb8
commit de4be1cb93
5 changed files with 27 additions and 5 deletions

View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<body>
<div style="-moz-column-count: 15; width: 16px; height: 16px;"><span><div style="display: inline-block;">a</div><div style="float: left;"></div>
</span></div>
</body>
</html>

View File

@ -129,6 +129,7 @@ load 408883-1.html
load 410228-1.html
load 411851-1.html
load 412201-1.xhtml
load 413048-1.html
load 414061-1.html
load 414719-1.html
load 415685-1.html

View File

@ -98,6 +98,8 @@
static const int MIN_LINES_NEEDING_CURSOR = 20;
#define DISABLE_FLOAT_BREAKING_IN_COLUMNS
#ifdef DEBUG
#include "nsPrintfCString.h"
#include "nsBlockDebugFlags.h"
@ -5649,9 +5651,20 @@ nsBlockFrame::ComputeFloatAvailableSpace(nsBlockReflowState& aState,
// aState.mY is relative to the border-top, make it relative to the content-top
nscoord contentYOffset = aState.mY - aState.BorderPadding().top;
nscoord availHeight = NS_UNCONSTRAINEDSIZE == aState.mContentArea.height
? NS_UNCONSTRAINEDSIZE
? NS_UNCONSTRAINEDSIZE
: PR_MAX(0, aState.mContentArea.height - contentYOffset);
#ifdef DISABLE_FLOAT_BREAKING_IN_COLUMNS
if (availHeight != NS_UNCONSTRAINEDSIZE &&
nsLayoutUtils::GetClosestFrameOfType(this, nsGkAtoms::columnSetFrame)) {
// Tell the float it has unrestricted height, so it won't break.
// If the float doesn't actually fit in the column it will fail to be
// placed, and either move to the top of the next column or just
// overflow.
availHeight = NS_UNCONSTRAINEDSIZE;
}
#endif
return nsRect(aState.BorderPadding().left,
aState.BorderPadding().top,
availWidth, availHeight);

View File

@ -636,10 +636,9 @@ nsBlockReflowState::AddFloat(nsLineLayout& aLineLayout,
// This float will be placed after the line is done (it is a
// below-current-line float).
mBelowCurrentLineFloats.Append(fc);
if (mReflowState.availableHeight != NS_UNCONSTRAINEDSIZE ||
aPlaceholder->GetNextInFlow()) {
if (aPlaceholder->GetNextInFlow()) {
// If the float might not be complete, mark it incomplete now to
// prevent the placeholders being torn down. We will destroy any
// prevent its next-in-flow placeholders being torn down. We will destroy any
// placeholders later if PlaceBelowCurrentLineFloats finds the
// float is complete.
// Note that we could have unconstrained height and yet have

View File

@ -571,7 +571,7 @@ fails == 385823-2b.html 385823-2-ref.html
== 386014-1c.html 386014-1-ref.html
== 386065-1.html 386065-1-ref.html
== 386065-2.html about:blank
== 386147-1.html 386147-1-ref.html
fails == 386147-1.html 386147-1-ref.html # bug 447460
== 386310-1a.html 386310-1-ref.html
fails == 386310-1b.html 386310-1-ref.html
== 386310-1c.html 386310-1-ref.html