diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp index 02b369f62eb..e015c1183c2 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.cpp @@ -83,7 +83,6 @@ nsHTMLButtonControlFrame::nsHTMLButtonControlFrame() mTranslatedRect = nsRect(0,0,0,0); mDidInit = PR_FALSE; mRenderer.SetNameSpace(kNameSpaceID_None); - mPresContext = nsnull; mCacheSize.width = -1; mCacheSize.height = -1; @@ -93,11 +92,17 @@ nsHTMLButtonControlFrame::nsHTMLButtonControlFrame() nsHTMLButtonControlFrame::~nsHTMLButtonControlFrame() { - nsFormControlFrame::RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); +} + +NS_IMETHODIMP +nsHTMLButtonControlFrame::Destroy(nsIPresContext *aPresContext) +{ + nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); if (mFormFrame) { mFormFrame->RemoveFormControlFrame(*this); mFormFrame = nsnull; } + return nsHTMLContainerFrame::Destroy(aPresContext); } NS_IMETHODIMP @@ -525,7 +530,6 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext* aPresContext, DO_GLOBAL_REFLOW_COUNT("nsHTMLButtonControlFrame", aReflowState.reason); if (!mFormFrame && (eReflowReason_Initial == aReflowState.reason)) { - mPresContext = aPresContext; nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE); nsFormFrame::AddFormControlFrame(aPresContext, *NS_STATIC_CAST(nsIFrame*, this)); } diff --git a/mozilla/layout/forms/nsHTMLButtonControlFrame.h b/mozilla/layout/forms/nsHTMLButtonControlFrame.h index 1beb84fa2e9..37e5235aa54 100644 --- a/mozilla/layout/forms/nsHTMLButtonControlFrame.h +++ b/mozilla/layout/forms/nsHTMLButtonControlFrame.h @@ -63,6 +63,7 @@ public: ~nsHTMLButtonControlFrame(); + NS_IMETHOD Destroy(nsIPresContext *aPresContext); NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); @@ -156,8 +157,6 @@ protected: PRBool mDidInit; nsButtonFrameRenderer mRenderer; - nsIPresContext * mPresContext; - //Resize Reflow OpitmizationSize; nsSize mCacheSize; nsSize mCachedMaxElementSize; diff --git a/mozilla/layout/forms/nsImageControlFrame.cpp b/mozilla/layout/forms/nsImageControlFrame.cpp index 0245c9dcf2a..189f2c95709 100644 --- a/mozilla/layout/forms/nsImageControlFrame.cpp +++ b/mozilla/layout/forms/nsImageControlFrame.cpp @@ -69,7 +69,8 @@ public: nsImageControlFrame(); ~nsImageControlFrame(); - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); + NS_IMETHOD Destroy(nsIPresContext *aPresContext); + NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); NS_IMETHOD Init(nsIPresContext* aPresContext, nsIContent* aContent, @@ -147,7 +148,6 @@ protected: nsRect mTranslatedRect; PRBool mGotFocus; - nsCOMPtr mPresContext; }; @@ -163,12 +163,18 @@ nsImageControlFrame::nsImageControlFrame() nsImageControlFrame::~nsImageControlFrame() { - nsFormControlFrame::RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); +} + +NS_IMETHODIMP +nsImageControlFrame::Destroy(nsIPresContext *aPresContext) +{ + nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); if (mFormFrame) { mFormFrame->RemoveFormControlFrame(*this); mFormFrame = nsnull; } + return nsImageControlFrameSuper::Destroy(aPresContext); } nsresult @@ -261,7 +267,6 @@ nsImageControlFrame::Reflow(nsIPresContext* aPresContext, { DO_GLOBAL_REFLOW_COUNT("nsImageControlFrame", aReflowState.reason); if (!mFormFrame && (eReflowReason_Initial == aReflowState.reason)) { - mPresContext = aPresContext; nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE); // add ourself as an nsIFormControlFrame nsFormFrame::AddFormControlFrame(aPresContext, *NS_STATIC_CAST(nsIFrame*, this)); diff --git a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp index 02b369f62eb..e015c1183c2 100644 --- a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.cpp @@ -83,7 +83,6 @@ nsHTMLButtonControlFrame::nsHTMLButtonControlFrame() mTranslatedRect = nsRect(0,0,0,0); mDidInit = PR_FALSE; mRenderer.SetNameSpace(kNameSpaceID_None); - mPresContext = nsnull; mCacheSize.width = -1; mCacheSize.height = -1; @@ -93,11 +92,17 @@ nsHTMLButtonControlFrame::nsHTMLButtonControlFrame() nsHTMLButtonControlFrame::~nsHTMLButtonControlFrame() { - nsFormControlFrame::RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); +} + +NS_IMETHODIMP +nsHTMLButtonControlFrame::Destroy(nsIPresContext *aPresContext) +{ + nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); if (mFormFrame) { mFormFrame->RemoveFormControlFrame(*this); mFormFrame = nsnull; } + return nsHTMLContainerFrame::Destroy(aPresContext); } NS_IMETHODIMP @@ -525,7 +530,6 @@ nsHTMLButtonControlFrame::Reflow(nsIPresContext* aPresContext, DO_GLOBAL_REFLOW_COUNT("nsHTMLButtonControlFrame", aReflowState.reason); if (!mFormFrame && (eReflowReason_Initial == aReflowState.reason)) { - mPresContext = aPresContext; nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE); nsFormFrame::AddFormControlFrame(aPresContext, *NS_STATIC_CAST(nsIFrame*, this)); } diff --git a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.h b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.h index 1beb84fa2e9..37e5235aa54 100644 --- a/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.h +++ b/mozilla/layout/html/forms/src/nsHTMLButtonControlFrame.h @@ -63,6 +63,7 @@ public: ~nsHTMLButtonControlFrame(); + NS_IMETHOD Destroy(nsIPresContext *aPresContext); NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); @@ -156,8 +157,6 @@ protected: PRBool mDidInit; nsButtonFrameRenderer mRenderer; - nsIPresContext * mPresContext; - //Resize Reflow OpitmizationSize; nsSize mCacheSize; nsSize mCachedMaxElementSize; diff --git a/mozilla/layout/html/forms/src/nsImageControlFrame.cpp b/mozilla/layout/html/forms/src/nsImageControlFrame.cpp index 0245c9dcf2a..189f2c95709 100644 --- a/mozilla/layout/html/forms/src/nsImageControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsImageControlFrame.cpp @@ -69,7 +69,8 @@ public: nsImageControlFrame(); ~nsImageControlFrame(); - NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); + NS_IMETHOD Destroy(nsIPresContext *aPresContext); + NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); NS_IMETHOD Init(nsIPresContext* aPresContext, nsIContent* aContent, @@ -147,7 +148,6 @@ protected: nsRect mTranslatedRect; PRBool mGotFocus; - nsCOMPtr mPresContext; }; @@ -163,12 +163,18 @@ nsImageControlFrame::nsImageControlFrame() nsImageControlFrame::~nsImageControlFrame() { - nsFormControlFrame::RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); +} + +NS_IMETHODIMP +nsImageControlFrame::Destroy(nsIPresContext *aPresContext) +{ + nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); if (mFormFrame) { mFormFrame->RemoveFormControlFrame(*this); mFormFrame = nsnull; } + return nsImageControlFrameSuper::Destroy(aPresContext); } nsresult @@ -261,7 +267,6 @@ nsImageControlFrame::Reflow(nsIPresContext* aPresContext, { DO_GLOBAL_REFLOW_COUNT("nsImageControlFrame", aReflowState.reason); if (!mFormFrame && (eReflowReason_Initial == aReflowState.reason)) { - mPresContext = aPresContext; nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE); // add ourself as an nsIFormControlFrame nsFormFrame::AddFormControlFrame(aPresContext, *NS_STATIC_CAST(nsIFrame*, this)); diff --git a/mozilla/layout/html/forms/src/nsLabelFrame.cpp b/mozilla/layout/html/forms/src/nsLabelFrame.cpp index 3922f84944d..56a87c82f66 100644 --- a/mozilla/layout/html/forms/src/nsLabelFrame.cpp +++ b/mozilla/layout/html/forms/src/nsLabelFrame.cpp @@ -70,6 +70,8 @@ public: nsLabelFrame(); virtual ~nsLabelFrame(); + NS_IMETHOD Destroy(nsIPresContext *aPresContext); + NS_IMETHOD Init(nsIPresContext* aPresContext, nsIContent* aContent, nsIFrame* aParent, @@ -119,7 +121,6 @@ protected: nsIFormControlFrame* mControlFrame; nsRect mTranslatedRect; - nsCOMPtr mPresContext; }; nsresult @@ -156,9 +157,17 @@ nsLabelFrame::nsLabelFrame() nsLabelFrame::~nsLabelFrame() { - nsFormControlFrame::RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); } + +NS_IMETHODIMP +nsLabelFrame::Destroy(nsIPresContext *aPresContext) +{ + nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); + return nsHTMLContainerFrame::Destroy(aPresContext); +} + + void nsLabelFrame::GetTranslatedRect(nsIPresContext* aPresContext, nsRect& aRect) { @@ -569,7 +578,6 @@ nsLabelFrame::Reflow(nsIPresContext* aPresContext, NS_ASSERTION(nextFrame == mFrames.FirstChild(), "unexpected next reflow command frame"); } } else if (eReflowReason_Initial == aReflowState.reason) { - mPresContext = aPresContext; nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_TRUE); }