From 487a041f858e0b3abc2ca5ef2e267a0cb346e538 Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Thu, 7 Oct 1999 21:07:38 +0000 Subject: [PATCH] Added macro to help in figuring Nav Quirks default size for all controls ifdef for just me r=kmcclusk --- layout/forms/nsGfxButtonControlFrame.cpp | 15 ++++++++++----- layout/forms/nsGfxCheckboxControlFrame.cpp | 14 +++++++++++++- layout/forms/nsGfxCheckboxControlFrame.h | 8 +++++++- layout/forms/nsGfxRadioControlFrame.cpp | 14 ++++++++++++++ layout/forms/nsGfxRadioControlFrame.h | 6 ++++++ layout/html/forms/src/nsGfxButtonControlFrame.cpp | 15 ++++++++++----- .../html/forms/src/nsGfxCheckboxControlFrame.cpp | 14 +++++++++++++- layout/html/forms/src/nsGfxCheckboxControlFrame.h | 8 +++++++- layout/html/forms/src/nsGfxRadioControlFrame.cpp | 14 ++++++++++++++ layout/html/forms/src/nsGfxRadioControlFrame.h | 6 ++++++ 10 files changed, 100 insertions(+), 14 deletions(-) diff --git a/layout/forms/nsGfxButtonControlFrame.cpp b/layout/forms/nsGfxButtonControlFrame.cpp index 9d52d1ad814..c7ad23b60f8 100644 --- a/layout/forms/nsGfxButtonControlFrame.cpp +++ b/layout/forms/nsGfxButtonControlFrame.cpp @@ -159,11 +159,12 @@ nsGfxButtonControlFrame::AddComputedBorderPaddingToDesiredSize(nsHTMLReflowMetri NS_IMETHODIMP nsGfxButtonControlFrame::Reflow(nsIPresContext& aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) { // The mFormFrame is set in the initial reflow within nsHTMLButtonControlFrame + nsresult rv = NS_OK; if ((kSuggestedNotSet != mSuggestedWidth) || (kSuggestedNotSet != mSuggestedHeight)) { @@ -179,11 +180,15 @@ nsGfxButtonControlFrame::Reflow(nsIPresContext& aPresContext, suggestedReflowState.mComputedHeight = mSuggestedHeight; } - return nsHTMLButtonControlFrame::Reflow(aPresContext, aDesiredSize, suggestedReflowState, aStatus); + rv = nsHTMLButtonControlFrame::Reflow(aPresContext, aDesiredSize, suggestedReflowState, aStatus); } else { // Normal reflow. - return nsHTMLButtonControlFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); + rv = nsHTMLButtonControlFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); } + + COMPARE_QUIRK_SIZE("nsGfxButtonControlFrame", 36, 24) //with the text "one" in it + + return rv; } NS_IMETHODIMP diff --git a/layout/forms/nsGfxCheckboxControlFrame.cpp b/layout/forms/nsGfxCheckboxControlFrame.cpp index 6876ad27311..949d951a7ee 100644 --- a/layout/forms/nsGfxCheckboxControlFrame.cpp +++ b/layout/forms/nsGfxCheckboxControlFrame.cpp @@ -174,7 +174,6 @@ nsGfxCheckboxControlFrame :: GetCheckboxState ( ) return mChecked; } - void nsGfxCheckboxControlFrame :: SetCheckboxState ( nsCheckboxControlFrame::CheckState aValue ) { @@ -182,3 +181,16 @@ nsGfxCheckboxControlFrame :: SetCheckboxState ( nsCheckboxControlFrame::CheckSta nsFormControlHelper::ForceDrawFrame(this); } +#ifdef DEBUG_rods +NS_IMETHODIMP +nsGfxCheckboxControlFrame::Reflow(nsIPresContext& aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) +{ + nsresult rv = nsNativeFormControlFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); + + COMPARE_QUIRK_SIZE("nsGfxCheckboxControlFrame", 13, 13) + return rv; +} +#endif diff --git a/layout/forms/nsGfxCheckboxControlFrame.h b/layout/forms/nsGfxCheckboxControlFrame.h index e0d420480e7..81f728258a0 100644 --- a/layout/forms/nsGfxCheckboxControlFrame.h +++ b/layout/forms/nsGfxCheckboxControlFrame.h @@ -36,7 +36,13 @@ public: nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect, nsFramePaintLayer aWhichLayer); - +#ifdef DEBUG_rods + NS_IMETHOD Reflow(nsIPresContext& aCX, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); +#endif + protected: virtual CheckState GetCheckboxState(); virtual void SetCheckboxState(CheckState aValue); diff --git a/layout/forms/nsGfxRadioControlFrame.cpp b/layout/forms/nsGfxRadioControlFrame.cpp index b1fd132f81d..85b31e3ccdc 100644 --- a/layout/forms/nsGfxRadioControlFrame.cpp +++ b/layout/forms/nsGfxRadioControlFrame.cpp @@ -168,3 +168,17 @@ void nsGfxRadioControlFrame::SetRadioState(PRBool aValue) mChecked = aValue; nsFormControlHelper::ForceDrawFrame(this); } + +#ifdef DEBUG_rods +NS_IMETHODIMP +nsGfxRadioControlFrame::Reflow(nsIPresContext& aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) +{ + nsresult rv = nsNativeFormControlFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); + + COMPARE_QUIRK_SIZE("nsGfxRadioControlFrame", 12, 11) + return rv; +} +#endif diff --git a/layout/forms/nsGfxRadioControlFrame.h b/layout/forms/nsGfxRadioControlFrame.h index 553add19e3e..e2b9f73e7ae 100644 --- a/layout/forms/nsGfxRadioControlFrame.h +++ b/layout/forms/nsGfxRadioControlFrame.h @@ -60,6 +60,12 @@ public: const nsRect& aDirtyRect); ///XXX: End o the temporary methods +#ifdef DEBUG_rods + NS_IMETHOD Reflow(nsIPresContext& aCX, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); +#endif protected: diff --git a/layout/html/forms/src/nsGfxButtonControlFrame.cpp b/layout/html/forms/src/nsGfxButtonControlFrame.cpp index 9d52d1ad814..c7ad23b60f8 100644 --- a/layout/html/forms/src/nsGfxButtonControlFrame.cpp +++ b/layout/html/forms/src/nsGfxButtonControlFrame.cpp @@ -159,11 +159,12 @@ nsGfxButtonControlFrame::AddComputedBorderPaddingToDesiredSize(nsHTMLReflowMetri NS_IMETHODIMP nsGfxButtonControlFrame::Reflow(nsIPresContext& aPresContext, - nsHTMLReflowMetrics& aDesiredSize, - const nsHTMLReflowState& aReflowState, - nsReflowStatus& aStatus) + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) { // The mFormFrame is set in the initial reflow within nsHTMLButtonControlFrame + nsresult rv = NS_OK; if ((kSuggestedNotSet != mSuggestedWidth) || (kSuggestedNotSet != mSuggestedHeight)) { @@ -179,11 +180,15 @@ nsGfxButtonControlFrame::Reflow(nsIPresContext& aPresContext, suggestedReflowState.mComputedHeight = mSuggestedHeight; } - return nsHTMLButtonControlFrame::Reflow(aPresContext, aDesiredSize, suggestedReflowState, aStatus); + rv = nsHTMLButtonControlFrame::Reflow(aPresContext, aDesiredSize, suggestedReflowState, aStatus); } else { // Normal reflow. - return nsHTMLButtonControlFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); + rv = nsHTMLButtonControlFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); } + + COMPARE_QUIRK_SIZE("nsGfxButtonControlFrame", 36, 24) //with the text "one" in it + + return rv; } NS_IMETHODIMP diff --git a/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp b/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp index 6876ad27311..949d951a7ee 100644 --- a/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp +++ b/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp @@ -174,7 +174,6 @@ nsGfxCheckboxControlFrame :: GetCheckboxState ( ) return mChecked; } - void nsGfxCheckboxControlFrame :: SetCheckboxState ( nsCheckboxControlFrame::CheckState aValue ) { @@ -182,3 +181,16 @@ nsGfxCheckboxControlFrame :: SetCheckboxState ( nsCheckboxControlFrame::CheckSta nsFormControlHelper::ForceDrawFrame(this); } +#ifdef DEBUG_rods +NS_IMETHODIMP +nsGfxCheckboxControlFrame::Reflow(nsIPresContext& aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) +{ + nsresult rv = nsNativeFormControlFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); + + COMPARE_QUIRK_SIZE("nsGfxCheckboxControlFrame", 13, 13) + return rv; +} +#endif diff --git a/layout/html/forms/src/nsGfxCheckboxControlFrame.h b/layout/html/forms/src/nsGfxCheckboxControlFrame.h index e0d420480e7..81f728258a0 100644 --- a/layout/html/forms/src/nsGfxCheckboxControlFrame.h +++ b/layout/html/forms/src/nsGfxCheckboxControlFrame.h @@ -36,7 +36,13 @@ public: nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect, nsFramePaintLayer aWhichLayer); - +#ifdef DEBUG_rods + NS_IMETHOD Reflow(nsIPresContext& aCX, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); +#endif + protected: virtual CheckState GetCheckboxState(); virtual void SetCheckboxState(CheckState aValue); diff --git a/layout/html/forms/src/nsGfxRadioControlFrame.cpp b/layout/html/forms/src/nsGfxRadioControlFrame.cpp index b1fd132f81d..85b31e3ccdc 100644 --- a/layout/html/forms/src/nsGfxRadioControlFrame.cpp +++ b/layout/html/forms/src/nsGfxRadioControlFrame.cpp @@ -168,3 +168,17 @@ void nsGfxRadioControlFrame::SetRadioState(PRBool aValue) mChecked = aValue; nsFormControlHelper::ForceDrawFrame(this); } + +#ifdef DEBUG_rods +NS_IMETHODIMP +nsGfxRadioControlFrame::Reflow(nsIPresContext& aPresContext, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus) +{ + nsresult rv = nsNativeFormControlFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus); + + COMPARE_QUIRK_SIZE("nsGfxRadioControlFrame", 12, 11) + return rv; +} +#endif diff --git a/layout/html/forms/src/nsGfxRadioControlFrame.h b/layout/html/forms/src/nsGfxRadioControlFrame.h index 553add19e3e..e2b9f73e7ae 100644 --- a/layout/html/forms/src/nsGfxRadioControlFrame.h +++ b/layout/html/forms/src/nsGfxRadioControlFrame.h @@ -60,6 +60,12 @@ public: const nsRect& aDirtyRect); ///XXX: End o the temporary methods +#ifdef DEBUG_rods + NS_IMETHOD Reflow(nsIPresContext& aCX, + nsHTMLReflowMetrics& aDesiredSize, + const nsHTMLReflowState& aReflowState, + nsReflowStatus& aStatus); +#endif protected: