From 11867185b821b2e2076cd677d13390e2d7475fd7 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Fri, 27 Aug 1999 21:50:06 +0000 Subject: [PATCH] Fixed computation of max-element-size for bug #12384; don't compute line-height in this class git-svn-id: svn://10.0.0.236/trunk@44928 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsLineLayout.cpp | 15 +++++++++++---- mozilla/layout/html/base/src/nsLineLayout.cpp | 15 +++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/mozilla/layout/generic/nsLineLayout.cpp b/mozilla/layout/generic/nsLineLayout.cpp index b533f3e74ba..4c6825d2bd1 100644 --- a/mozilla/layout/generic/nsLineLayout.cpp +++ b/mozilla/layout/generic/nsLineLayout.cpp @@ -96,14 +96,13 @@ nsLineLayout::nsLineLayout(nsIPresContext& aPresContext, mSpaceManager(aSpaceManager), mBlockReflowState(aOuterReflowState), mBlockRS(nsnull),/* XXX temporary */ + mMinLineHeight(0), mComputeMaxElementSize(aComputeMaxElementSize) { // Stash away some style data that we need aOuterReflowState->frame->GetStyleData(eStyleStruct_Text, (const nsStyleStruct*&) mStyleText); mTextAlign = mStyleText->mTextAlign; - mMinLineHeight = nsHTMLReflowState::CalcLineHeight(mPresContext, - aOuterReflowState->frame); mLineNumber = 0; mColumn = 0; mEndsInWhiteSpace = PR_TRUE; @@ -511,8 +510,16 @@ nsLineLayout::EndSpan(nsIFrame* aFrame, aSizeResult.width = width; aSizeResult.height = maxHeight; if (aMaxElementSize) { - aMaxElementSize->width = maxElementWidth; - aMaxElementSize->height = maxElementHeight; + if (psd->mNoWrap) { + // When we have a non-breakable span, it's max-element-size + // width is its entire width. + aMaxElementSize->width = width; + aMaxElementSize->height = maxHeight; + } + else { + aMaxElementSize->width = maxElementWidth; + aMaxElementSize->height = maxElementHeight; + } } mSpanDepth--; diff --git a/mozilla/layout/html/base/src/nsLineLayout.cpp b/mozilla/layout/html/base/src/nsLineLayout.cpp index b533f3e74ba..4c6825d2bd1 100644 --- a/mozilla/layout/html/base/src/nsLineLayout.cpp +++ b/mozilla/layout/html/base/src/nsLineLayout.cpp @@ -96,14 +96,13 @@ nsLineLayout::nsLineLayout(nsIPresContext& aPresContext, mSpaceManager(aSpaceManager), mBlockReflowState(aOuterReflowState), mBlockRS(nsnull),/* XXX temporary */ + mMinLineHeight(0), mComputeMaxElementSize(aComputeMaxElementSize) { // Stash away some style data that we need aOuterReflowState->frame->GetStyleData(eStyleStruct_Text, (const nsStyleStruct*&) mStyleText); mTextAlign = mStyleText->mTextAlign; - mMinLineHeight = nsHTMLReflowState::CalcLineHeight(mPresContext, - aOuterReflowState->frame); mLineNumber = 0; mColumn = 0; mEndsInWhiteSpace = PR_TRUE; @@ -511,8 +510,16 @@ nsLineLayout::EndSpan(nsIFrame* aFrame, aSizeResult.width = width; aSizeResult.height = maxHeight; if (aMaxElementSize) { - aMaxElementSize->width = maxElementWidth; - aMaxElementSize->height = maxElementHeight; + if (psd->mNoWrap) { + // When we have a non-breakable span, it's max-element-size + // width is its entire width. + aMaxElementSize->width = width; + aMaxElementSize->height = maxHeight; + } + else { + aMaxElementSize->width = maxElementWidth; + aMaxElementSize->height = maxElementHeight; + } } mSpanDepth--;