diff --git a/mozilla/layout/generic/nsFrame.h b/mozilla/layout/generic/nsFrame.h index ef54dcb6807..28a5bbd4009 100644 --- a/mozilla/layout/generic/nsFrame.h +++ b/mozilla/layout/generic/nsFrame.h @@ -304,7 +304,7 @@ public: * override ComputeSize to enforce their width/height invariants. * * Implementations may optimize by returning a garbage width if - * GetStylePosition()->mWidth.GetUnit() != eStyleUnit_Auto, and + * GetStylePosition()->mWidth.GetUnit() == eStyleUnit_Auto, and * likewise for height, since in such cases the result is guaranteed * to be unused. */ diff --git a/mozilla/layout/generic/nsLeafFrame.cpp b/mozilla/layout/generic/nsLeafFrame.cpp index 12e359ae613..06aab0492fe 100644 --- a/mozilla/layout/generic/nsLeafFrame.cpp +++ b/mozilla/layout/generic/nsLeafFrame.cpp @@ -67,15 +67,6 @@ nsLeafFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext) return result; } -/* virtual */ nsSize -nsLeafFrame::ComputeAutoSize(nsIRenderingContext *aRenderingContext, - nsSize aCBSize, nscoord aAvailableWidth, - nsSize aMargin, nsSize aBorder, - nsSize aPadding, PRBool aShrinkWrap) -{ - return nsSize(GetIntrinsicWidth(), GetIntrinsicHeight()); -} - NS_IMETHODIMP nsLeafFrame::Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aMetrics, @@ -89,12 +80,11 @@ nsLeafFrame::Reflow(nsPresContext* aPresContext, NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow"); + // XXX add in code to check for width/height being set via css + // and if set use them instead of calling GetDesiredSize. + NS_ASSERTION(aReflowState.ComputedWidth() != NS_UNCONSTRAINEDSIZE, - "Shouldn't have unconstrained stuff here " - "Thanks to the rules of reflow"); - NS_ASSERTION(NS_INTRINSICSIZE != aReflowState.ComputedHeight(), - "Shouldn't have unconstrained stuff here " - "thanks to ComputeAutoSize"); + "Shouldn't have unconstrained stuff here"); DoReflow(aPresContext, aMetrics, aReflowState, aStatus); @@ -109,7 +99,15 @@ nsLeafFrame::DoReflow(nsPresContext* aPresContext, nsReflowStatus& aStatus) { aMetrics.width = aReflowState.ComputedWidth(); - aMetrics.height = aReflowState.ComputedHeight(); + if (NS_INTRINSICSIZE != aReflowState.ComputedHeight()) { + aMetrics.height = aReflowState.ComputedHeight(); + } else { + aMetrics.height = GetIntrinsicHeight(); + // XXXbz using NS_CSS_MINMAX like this presupposes content-box sizing. + aMetrics.height = NS_CSS_MINMAX(aMetrics.height, + aReflowState.mComputedMinHeight, + aReflowState.mComputedMaxHeight); + } AddBordersAndPadding(aReflowState, aMetrics); aStatus = NS_FRAME_COMPLETE; diff --git a/mozilla/layout/generic/nsLeafFrame.h b/mozilla/layout/generic/nsLeafFrame.h index d2788b2f3a7..6ca23fad7fc 100644 --- a/mozilla/layout/generic/nsLeafFrame.h +++ b/mozilla/layout/generic/nsLeafFrame.h @@ -67,14 +67,6 @@ public: virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext); virtual nscoord GetPrefWidth(nsIRenderingContext *aRenderingContext); - /** - * Our auto size is just intrinsic width and intrinsic height. - */ - virtual nsSize ComputeAutoSize(nsIRenderingContext *aRenderingContext, - nsSize aCBSize, nscoord aAvailableWidth, - nsSize aMargin, nsSize aBorder, - nsSize aPadding, PRBool aShrinkWrap); - /** * Reflow our frame. This will use the computed width plus borderpadding for * the desired width, and use the return value of GetIntrinsicHeight plus diff --git a/mozilla/layout/reftests/bugs/412679-1-ref.html b/mozilla/layout/reftests/bugs/412679-1-ref.html deleted file mode 100644 index 6e8afb45994..00000000000 --- a/mozilla/layout/reftests/bugs/412679-1-ref.html +++ /dev/null @@ -1,51 +0,0 @@ - - -
-