From 33e9dec8c92012c53eeae949dd035940f366f37d Mon Sep 17 00:00:00 2001 From: "dbaron%dbaron.org" Date: Sat, 5 May 2007 17:06:04 +0000 Subject: [PATCH] Remove special handling of empty continuations, which should no longer be needed. b=238473 Based on patch by Hideo Saito . r=dbaron sr=roc git-svn-id: svn://10.0.0.236/trunk@225964 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsInlineFrame.cpp | 77 +++++++++++------------- 1 file changed, 34 insertions(+), 43 deletions(-) diff --git a/mozilla/layout/generic/nsInlineFrame.cpp b/mozilla/layout/generic/nsInlineFrame.cpp index 023ab76fa68..bf74d446624 100644 --- a/mozilla/layout/generic/nsInlineFrame.cpp +++ b/mozilla/layout/generic/nsInlineFrame.cpp @@ -548,51 +548,42 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext, // whitespace in an inline element don't affect the line-height. nsSize size; lineLayout->EndSpan(this, size); - if ((0 == size.height) && (0 == size.width) && - ((nsnull != GetPrevInFlow()) || (nsnull != GetNextInFlow()))) { - // This is a continuation of a previous inline. Therefore make - // sure we don't affect the line-height. - aMetrics.width = 0; - aMetrics.height = 0; - aMetrics.ascent = 0; - } - else { - // Compute final width - aMetrics.width = size.width; - if (nsnull == GetPrevContinuation()) { - aMetrics.width += ltr ? aReflowState.mComputedBorderPadding.left - : aReflowState.mComputedBorderPadding.right; - } - if (NS_FRAME_IS_COMPLETE(aStatus) && (!GetNextContinuation() || GetNextInFlow())) { - aMetrics.width += ltr ? aReflowState.mComputedBorderPadding.right - : aReflowState.mComputedBorderPadding.left; - } - nsLayoutUtils::SetFontFromStyle(aReflowState.rendContext, mStyleContext); - nsCOMPtr fm; - aReflowState.rendContext->GetFontMetrics(*getter_AddRefs(fm)); - - if (fm) { - // Compute final height of the frame. - // - // Do things the standard css2 way -- though it's hard to find it - // in the css2 spec! It's actually found in the css1 spec section - // 4.4 (you will have to read between the lines to really see - // it). - // - // The height of our box is the sum of our font size plus the top - // and bottom border and padding. The height of children do not - // affect our height. - fm->GetMaxAscent(aMetrics.ascent); - fm->GetHeight(aMetrics.height); - } else { - NS_WARNING("Cannot get font metrics - defaulting sizes to 0"); - aMetrics.ascent = aMetrics.height = 0; - } - aMetrics.ascent += aReflowState.mComputedBorderPadding.top; - aMetrics.height += aReflowState.mComputedBorderPadding.top + - aReflowState.mComputedBorderPadding.bottom; + // Compute final width + aMetrics.width = size.width; + if (nsnull == GetPrevContinuation()) { + aMetrics.width += ltr ? aReflowState.mComputedBorderPadding.left + : aReflowState.mComputedBorderPadding.right; } + if (NS_FRAME_IS_COMPLETE(aStatus) && (!GetNextContinuation() || GetNextInFlow())) { + aMetrics.width += ltr ? aReflowState.mComputedBorderPadding.right + : aReflowState.mComputedBorderPadding.left; + } + + nsLayoutUtils::SetFontFromStyle(aReflowState.rendContext, mStyleContext); + nsCOMPtr fm; + aReflowState.rendContext->GetFontMetrics(*getter_AddRefs(fm)); + + if (fm) { + // Compute final height of the frame. + // + // Do things the standard css2 way -- though it's hard to find it + // in the css2 spec! It's actually found in the css1 spec section + // 4.4 (you will have to read between the lines to really see + // it). + // + // The height of our box is the sum of our font size plus the top + // and bottom border and padding. The height of children do not + // affect our height. + fm->GetMaxAscent(aMetrics.ascent); + fm->GetHeight(aMetrics.height); + } else { + NS_WARNING("Cannot get font metrics - defaulting sizes to 0"); + aMetrics.ascent = aMetrics.height = 0; + } + aMetrics.ascent += aReflowState.mComputedBorderPadding.top; + aMetrics.height += aReflowState.mComputedBorderPadding.top + + aReflowState.mComputedBorderPadding.bottom; // For now our overflow area is zero. The real value will be // computed during vertical alignment of the line we are on.