From 7dd2fd3ff957a70abdd5a64aec8f2132c618ca7b Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Sun, 11 Mar 2007 20:34:15 +0000 Subject: [PATCH] Bug 372237. Never set TRUNCATED reflow status if the available height is unconstrained, even if the height happens to exceed the constant we use to indicate unconstrained height. r+sr=dbaron git-svn-id: svn://10.0.0.236/trunk@221756 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsHTMLReflowState.cpp | 13 +++++++++++++ mozilla/layout/generic/nsHTMLReflowState.h | 2 ++ mozilla/layout/generic/nsIFrame.h | 6 +----- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/mozilla/layout/generic/nsHTMLReflowState.cpp b/mozilla/layout/generic/nsHTMLReflowState.cpp index 5ff8d4ca864..ab387643f07 100644 --- a/mozilla/layout/generic/nsHTMLReflowState.cpp +++ b/mozilla/layout/generic/nsHTMLReflowState.cpp @@ -2106,3 +2106,16 @@ nsHTMLReflowState::ComputeMinMaxValues(nscoord aContainingBlockWidth, mComputedMaxHeight = mComputedMinHeight; } } + +void +nsHTMLReflowState::SetTruncated(const nsHTMLReflowMetrics& aMetrics, + nsReflowStatus* aStatus) const +{ + if (availableHeight != NS_UNCONSTRAINEDSIZE && + availableHeight < aMetrics.height && + !mFlags.mIsTopOfPage) { + *aStatus |= NS_FRAME_TRUNCATED; + } else { + *aStatus &= ~NS_FRAME_TRUNCATED; + } +} diff --git a/mozilla/layout/generic/nsHTMLReflowState.h b/mozilla/layout/generic/nsHTMLReflowState.h index 89a2e170c95..4f2d7c52205 100644 --- a/mozilla/layout/generic/nsHTMLReflowState.h +++ b/mozilla/layout/generic/nsHTMLReflowState.h @@ -419,6 +419,8 @@ public: nscoord ComputedWidth() const { return mComputedWidth; } void SetComputedWidth(nscoord aComputedWidth); + void SetTruncated(const nsHTMLReflowMetrics& aMetrics, nsReflowStatus* aStatus) const; + protected: void InitCBReflowState(); diff --git a/mozilla/layout/generic/nsIFrame.h b/mozilla/layout/generic/nsIFrame.h index 7e5a83c82a1..37d7924c6c7 100644 --- a/mozilla/layout/generic/nsIFrame.h +++ b/mozilla/layout/generic/nsIFrame.h @@ -367,11 +367,7 @@ typedef PRUint32 nsReflowStatus; #define NS_FRAME_IS_TRUNCATED(status) \ (0 != ((status) & NS_FRAME_TRUNCATED)) #define NS_FRAME_SET_TRUNCATION(status, aReflowState, aMetrics) \ - if (!aReflowState.mFlags.mIsTopOfPage && \ - aReflowState.availableHeight < aMetrics.height) \ - status |= NS_FRAME_TRUNCATED; \ - else \ - status &= ~NS_FRAME_TRUNCATED; + aReflowState.SetTruncated(aMetrics, &status); //----------------------------------------------------------------------