Added unconstrainted reflow optimizations

r=kmcclusk bug=12653
This commit is contained in:
rods%netscape.com 2000-01-05 15:21:02 +00:00
Родитель 2c565300ac
Коммит 1648364918
3 изменённых файлов: 19 добавлений и 1 удалений

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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