From 2816caa04c7787b1d1c107e80e8c973b66a2988b Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Fri, 17 Jun 2005 02:46:36 +0000 Subject: [PATCH] Bug 297537. Line layout should not set an available-height constraint on the inline frames, because they can't break vertically ... and it certainly shouldn't set the constraint based on the band dimensions. Fixes Gmail rich text toolbar layout issue. r+sr=dbaron,a=asa git-svn-id: svn://10.0.0.236/trunk@174750 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsCSSFrameConstructor.cpp | 9 +++++-- mozilla/layout/generic/nsLineLayout.cpp | 24 ++++--------------- mozilla/layout/generic/nsLineLayout.h | 1 - 3 files changed, 12 insertions(+), 22 deletions(-) diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index efbdcabbd6a..eb7e588988e 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -13138,15 +13138,20 @@ nsCSSFrameConstructor::ProcessInlineChildren(nsFrameConstructorState& aState, } } - *aKidsAllInline = allKidsInline; - // process the current pseudo frame state if (!aState.mPseudoFrames.IsEmpty()) { ProcessPseudoFrames(aState, aFrameItems); + // recompute allKidsInline to take into account new child frames + // XXX we DON'T do this yet because anonymous table children should + // be accepted as inline children, until we turn on inline-table. + // See bug 297537. + // allKidsInline = AreAllKidsInline(aFrameItems.childList); } // restore the pseudo frame state aState.mPseudoFrames = prevPseudoFrames; + *aKidsAllInline = allKidsInline; + return rv; } diff --git a/mozilla/layout/generic/nsLineLayout.cpp b/mozilla/layout/generic/nsLineLayout.cpp index d501aaceb99..21d3e056cd0 100644 --- a/mozilla/layout/generic/nsLineLayout.cpp +++ b/mozilla/layout/generic/nsLineLayout.cpp @@ -172,7 +172,7 @@ nsLineLayout::nsLineLayout(nsPresContext* aPresContext, SetFlag(LL_ENDSINWHITESPACE, PR_TRUE); mPlacedFloats = 0; mTotalPlacedFrames = 0; - mTopEdge = mBottomEdge = 0; + mTopEdge = 0; // Instead of always pre-initializing the free-lists for frames and // spans, we do it on demand so that situations that only use a few @@ -297,12 +297,6 @@ nsLineLayout::BeginLineReflow(nscoord aX, nscoord aY, } mTopEdge = aY; - if (NS_UNCONSTRAINEDSIZE == aHeight) { - mBottomEdge = NS_UNCONSTRAINEDSIZE; - } - else { - mBottomEdge = aY + aHeight; - } switch (mStyleText->mWhiteSpace) { case NS_STYLE_WHITESPACE_PRE: @@ -427,12 +421,6 @@ nsLineLayout::UpdateBand(nscoord aX, nscoord aY, psd->mRightEdge = aX + aWidth; } mTopEdge = aY; - if (NS_UNCONSTRAINEDSIZE == aHeight) { - mBottomEdge = NS_UNCONSTRAINEDSIZE; - } - else { - mBottomEdge = aY + aHeight; - } SetFlag(LL_UPDATEDBAND, PR_TRUE); mPlacedFloats |= (aPlacedLeftFloat ? PLACED_LEFT : PLACED_RIGHT); SetFlag(LL_IMPACTEDBYFLOATS, PR_TRUE); @@ -852,12 +840,10 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame, availSize.width = psd->mReflowState->availableWidth; } } - if (NS_UNCONSTRAINEDSIZE == mBottomEdge) { - availSize.height = NS_UNCONSTRAINEDSIZE; - } - else { - availSize.height = mBottomEdge - mTopEdge; - } + // For now, set the available height to unconstrained always. + // XXX inline blocks and tables won't be able to break across pages/ + // columns, but it's not clear how to handle that anyway + availSize.height = NS_UNCONSTRAINEDSIZE; // Get reflow reason set correctly. It's possible that a child was // created and then it was decided that it could not be reflowed diff --git a/mozilla/layout/generic/nsLineLayout.h b/mozilla/layout/generic/nsLineLayout.h index bbaafbecee4..30022312820 100644 --- a/mozilla/layout/generic/nsLineLayout.h +++ b/mozilla/layout/generic/nsLineLayout.h @@ -324,7 +324,6 @@ protected: PRBool AllocateDeque(); nscoord mTopEdge; - nscoord mBottomEdge; nscoord mMaxTopBoxHeight; nscoord mMaxBottomBoxHeight;