mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 10:43:24 +00:00
Added unconstrainted reflow optimizations
r=kmcclusk bug=12653
This commit is contained in:
parent
2c565300ac
commit
1648364918
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user