diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp index 93159516afb..b7df9c7272d 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp @@ -409,6 +409,15 @@ void ButtonHack(nsHTMLReflowState& aReflowState, char* aMessage) } } +NS_IMETHODIMP +nsHTMLButtonControlFrame::AddComputedBorderPaddingToDesiredSize(nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aSuggestedReflowState) +{ + aDesiredSize.width += aSuggestedReflowState.mComputedBorderPadding.left + aSuggestedReflowState.mComputedBorderPadding.right; + aDesiredSize.height += aSuggestedReflowState.mComputedBorderPadding.top + aSuggestedReflowState.mComputedBorderPadding.bottom; + return NS_OK; +} + NS_IMETHODIMP nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext, nsHTMLReflowMetrics& aDesiredSize, @@ -514,8 +523,9 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext, else aDesiredSize.height += focusPadding.top + focusPadding.bottom; - aDesiredSize.width += aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right; - aDesiredSize.height += aReflowState.mComputedBorderPadding.top + aReflowState.mComputedBorderPadding.bottom; + AddComputedBorderPaddingToDesiredSize(aDesiredSize, aReflowState); + //aDesiredSize.width += aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right; + //aDesiredSize.height += aReflowState.mComputedBorderPadding.top + aReflowState.mComputedBorderPadding.bottom; //adjust our max element size, if necessary if (aDesiredSize.maxElementSize) { diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.h b/mozilla/layout/forms/nsHTMLButtonControlFrame.h index 3ca00c4b2b1..279ea071eae 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.h +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.h @@ -135,6 +135,8 @@ public: NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight); protected: + NS_IMETHOD AddComputedBorderPaddingToDesiredSize(nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aSuggestedReflowState); NS_IMETHOD_(nsrefcnt) AddRef(void); NS_IMETHOD_(nsrefcnt) Release(void); void GetTranslatedRect(nsRect& aRect); diff --git a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp index 93159516afb..b7df9c7272d 100644 --- a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp @@ -409,6 +409,15 @@ void ButtonHack(nsHTMLReflowState& aReflowState, char* aMessage) } } +NS_IMETHODIMP +nsHTMLButtonControlFrame::AddComputedBorderPaddingToDesiredSize(nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aSuggestedReflowState) +{ + aDesiredSize.width += aSuggestedReflowState.mComputedBorderPadding.left + aSuggestedReflowState.mComputedBorderPadding.right; + aDesiredSize.height += aSuggestedReflowState.mComputedBorderPadding.top + aSuggestedReflowState.mComputedBorderPadding.bottom; + return NS_OK; +} + NS_IMETHODIMP nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext, nsHTMLReflowMetrics& aDesiredSize, @@ -514,8 +523,9 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext& aPresContext, else aDesiredSize.height += focusPadding.top + focusPadding.bottom; - aDesiredSize.width += aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right; - aDesiredSize.height += aReflowState.mComputedBorderPadding.top + aReflowState.mComputedBorderPadding.bottom; + AddComputedBorderPaddingToDesiredSize(aDesiredSize, aReflowState); + //aDesiredSize.width += aReflowState.mComputedBorderPadding.left + aReflowState.mComputedBorderPadding.right; + //aDesiredSize.height += aReflowState.mComputedBorderPadding.top + aReflowState.mComputedBorderPadding.bottom; //adjust our max element size, if necessary if (aDesiredSize.maxElementSize) { diff --git a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.h b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.h index 3ca00c4b2b1..279ea071eae 100644 --- a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.h +++ b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.h @@ -135,6 +135,8 @@ public: NS_IMETHOD SetSuggestedSize(nscoord aWidth, nscoord aHeight); protected: + NS_IMETHOD AddComputedBorderPaddingToDesiredSize(nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aSuggestedReflowState); NS_IMETHOD_(nsrefcnt) AddRef(void); NS_IMETHOD_(nsrefcnt) Release(void); void GetTranslatedRect(nsRect& aRect);