diff --git a/layout/forms/nsFormControlFrame.cpp b/layout/forms/nsFormControlFrame.cpp index dc4053127fe5..67077c83435a 100644 --- a/layout/forms/nsFormControlFrame.cpp +++ b/layout/forms/nsFormControlFrame.cpp @@ -126,7 +126,13 @@ nsFormControlFrame::~nsFormControlFrame() mFormFrame->RemoveRadioControlFrame(this); mFormFrame = nsnull; } - RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); +} + +NS_IMETHODIMP +nsFormControlFrame::Destroy(nsIPresContext *aPresContext) +{ + nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); + return nsLeafFrame::Destroy(aPresContext); } // Frames are not refcounted, no need to AddRef diff --git a/layout/forms/nsFormControlFrame.h b/layout/forms/nsFormControlFrame.h index e4dc50bc1528..41a8710d2e32 100644 --- a/layout/forms/nsFormControlFrame.h +++ b/layout/forms/nsFormControlFrame.h @@ -117,6 +117,8 @@ public: const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); + NS_IMETHOD Destroy(nsIPresContext *aPresContext); + // new behavior /** diff --git a/layout/forms/nsLegendFrame.cpp b/layout/forms/nsLegendFrame.cpp index a3ec978ee241..115192eb0c71 100644 --- a/layout/forms/nsLegendFrame.cpp +++ b/layout/forms/nsLegendFrame.cpp @@ -66,7 +66,13 @@ nsLegendFrame::nsLegendFrame() nsLegendFrame::~nsLegendFrame() { - nsFormControlFrame::RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); +} + +NS_IMETHODIMP +nsLegendFrame::Destroy(nsIPresContext *aPresContext) +{ + nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); + return nsAreaFrame::Destroy(aPresContext); } // Frames are not refcounted, no need to AddRef diff --git a/layout/forms/nsLegendFrame.h b/layout/forms/nsLegendFrame.h index 88cc1a8d5ad0..19101c463db6 100644 --- a/layout/forms/nsLegendFrame.h +++ b/layout/forms/nsLegendFrame.h @@ -50,6 +50,7 @@ public: const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); + NS_IMETHOD Destroy(nsIPresContext *aPresContext); #ifdef NS_DEBUG NS_IMETHOD GetFrameName(nsString& aResult) const; diff --git a/layout/html/forms/src/nsFormControlFrame.cpp b/layout/html/forms/src/nsFormControlFrame.cpp index dc4053127fe5..67077c83435a 100644 --- a/layout/html/forms/src/nsFormControlFrame.cpp +++ b/layout/html/forms/src/nsFormControlFrame.cpp @@ -126,7 +126,13 @@ nsFormControlFrame::~nsFormControlFrame() mFormFrame->RemoveRadioControlFrame(this); mFormFrame = nsnull; } - RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); +} + +NS_IMETHODIMP +nsFormControlFrame::Destroy(nsIPresContext *aPresContext) +{ + nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); + return nsLeafFrame::Destroy(aPresContext); } // Frames are not refcounted, no need to AddRef diff --git a/layout/html/forms/src/nsFormControlFrame.h b/layout/html/forms/src/nsFormControlFrame.h index e4dc50bc1528..41a8710d2e32 100644 --- a/layout/html/forms/src/nsFormControlFrame.h +++ b/layout/html/forms/src/nsFormControlFrame.h @@ -117,6 +117,8 @@ public: const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); + NS_IMETHOD Destroy(nsIPresContext *aPresContext); + // new behavior /** diff --git a/layout/html/forms/src/nsLegendFrame.cpp b/layout/html/forms/src/nsLegendFrame.cpp index a3ec978ee241..115192eb0c71 100644 --- a/layout/html/forms/src/nsLegendFrame.cpp +++ b/layout/html/forms/src/nsLegendFrame.cpp @@ -66,7 +66,13 @@ nsLegendFrame::nsLegendFrame() nsLegendFrame::~nsLegendFrame() { - nsFormControlFrame::RegUnRegAccessKey(mPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); +} + +NS_IMETHODIMP +nsLegendFrame::Destroy(nsIPresContext *aPresContext) +{ + nsFormControlFrame::RegUnRegAccessKey(aPresContext, NS_STATIC_CAST(nsIFrame*, this), PR_FALSE); + return nsAreaFrame::Destroy(aPresContext); } // Frames are not refcounted, no need to AddRef diff --git a/layout/html/forms/src/nsLegendFrame.h b/layout/html/forms/src/nsLegendFrame.h index 88cc1a8d5ad0..19101c463db6 100644 --- a/layout/html/forms/src/nsLegendFrame.h +++ b/layout/html/forms/src/nsLegendFrame.h @@ -50,6 +50,7 @@ public: const nsHTMLReflowState& aReflowState, nsReflowStatus& aStatus); + NS_IMETHOD Destroy(nsIPresContext *aPresContext); #ifdef NS_DEBUG NS_IMETHOD GetFrameName(nsString& aResult) const;