diff --git a/layout/forms/nsGfxButtonControlFrame.cpp b/layout/forms/nsGfxButtonControlFrame.cpp index c818ab15966b..685778e8941a 100644 --- a/layout/forms/nsGfxButtonControlFrame.cpp +++ b/layout/forms/nsGfxButtonControlFrame.cpp @@ -24,6 +24,7 @@ #include "nsIButton.h" #include "nsWidgetsCID.h" #include "nsIFontMetrics.h" +#include "nsFormControlFrame.h" static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID); static NS_DEFINE_IID(kIButtonIID, NS_IBUTTON_IID); @@ -325,6 +326,12 @@ nsGfxButtonControlFrame::Reflow(nsIPresContext* aPresContext, nsFormFrame::AddFormControlFrame(aPresContext, *NS_STATIC_CAST(nsIFrame*, this)); } + nsresult skiprv = nsFormControlFrame::SkipResizeReflow(mCacheSize, mCachedMaxElementSize, aPresContext, + aDesiredSize, aReflowState, aStatus); + if (NS_SUCCEEDED(skiprv)) { + return skiprv; + } + if ((kSuggestedNotSet != mSuggestedWidth) || (kSuggestedNotSet != mSuggestedHeight)) { nsHTMLReflowState suggestedReflowState(aReflowState); @@ -359,6 +366,8 @@ nsGfxButtonControlFrame::Reflow(nsIPresContext* aPresContext, #endif aStatus = NS_FRAME_COMPLETE; + nsFormControlFrame::SetupCachedSizes(mCacheSize, mCachedMaxElementSize, aDesiredSize); + return rv; } diff --git a/layout/html/forms/src/nsGfxButtonControlFrame.cpp b/layout/html/forms/src/nsGfxButtonControlFrame.cpp index c818ab15966b..685778e8941a 100644 --- a/layout/html/forms/src/nsGfxButtonControlFrame.cpp +++ b/layout/html/forms/src/nsGfxButtonControlFrame.cpp @@ -24,6 +24,7 @@ #include "nsIButton.h" #include "nsWidgetsCID.h" #include "nsIFontMetrics.h" +#include "nsFormControlFrame.h" static NS_DEFINE_IID(kIFormControlIID, NS_IFORMCONTROL_IID); static NS_DEFINE_IID(kIButtonIID, NS_IBUTTON_IID); @@ -325,6 +326,12 @@ nsGfxButtonControlFrame::Reflow(nsIPresContext* aPresContext, nsFormFrame::AddFormControlFrame(aPresContext, *NS_STATIC_CAST(nsIFrame*, this)); } + nsresult skiprv = nsFormControlFrame::SkipResizeReflow(mCacheSize, mCachedMaxElementSize, aPresContext, + aDesiredSize, aReflowState, aStatus); + if (NS_SUCCEEDED(skiprv)) { + return skiprv; + } + if ((kSuggestedNotSet != mSuggestedWidth) || (kSuggestedNotSet != mSuggestedHeight)) { nsHTMLReflowState suggestedReflowState(aReflowState); @@ -359,6 +366,8 @@ nsGfxButtonControlFrame::Reflow(nsIPresContext* aPresContext, #endif aStatus = NS_FRAME_COMPLETE; + nsFormControlFrame::SetupCachedSizes(mCacheSize, mCachedMaxElementSize, aDesiredSize); + return rv; } diff --git a/layout/html/forms/src/nsGfxTextControlFrame.h b/layout/html/forms/src/nsGfxTextControlFrame.h index 7cbd032b5e2b..3a8699ca6ef3 100644 --- a/layout/html/forms/src/nsGfxTextControlFrame.h +++ b/layout/html/forms/src/nsGfxTextControlFrame.h @@ -51,6 +51,7 @@ class nsIFrame; class nsIDOMSelection; +#define OPTIMIZE_RESIZE_RELOW class nsGfxTextControlFrame; @@ -656,7 +657,6 @@ private: // frames are not refcounted NS_IMETHOD_(nsrefcnt) AddRef() { return NS_OK; } NS_IMETHOD_(nsrefcnt) Release() { return NS_OK; } - }; #endif