diff --git a/layout/svg/base/src/nsSVGForeignObjectFrame.cpp b/layout/svg/base/src/nsSVGForeignObjectFrame.cpp index fc23732825b8..2e71816c5122 100644 --- a/layout/svg/base/src/nsSVGForeignObjectFrame.cpp +++ b/layout/svg/base/src/nsSVGForeignObjectFrame.cpp @@ -67,22 +67,9 @@ nsSVGForeignObjectFrame::Init(nsIContent* aContent, (NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD)); AddStateBits(NS_FRAME_FONT_INFLATION_CONTAINER | NS_FRAME_FONT_INFLATION_FLOW_ROOT); - if (NS_SUCCEEDED(rv) && - !(mState & NS_STATE_SVG_NONDISPLAY_CHILD)) { - nsSVGUtils::GetOuterSVGFrame(this)->RegisterForeignObject(this); - } return rv; } -void nsSVGForeignObjectFrame::DestroyFrom(nsIFrame* aDestructRoot) -{ - // Only unregister if we registered in the first place: - if (!(mState & NS_STATE_SVG_NONDISPLAY_CHILD)) { - nsSVGUtils::GetOuterSVGFrame(this)->UnregisterForeignObject(this); - } - nsSVGForeignObjectFrameBase::DestroyFrom(aDestructRoot); -} - nsIAtom * nsSVGForeignObjectFrame::GetType() const { diff --git a/layout/svg/base/src/nsSVGForeignObjectFrame.h b/layout/svg/base/src/nsSVGForeignObjectFrame.h index c4511d4616b3..bc031c96bcf5 100644 --- a/layout/svg/base/src/nsSVGForeignObjectFrame.h +++ b/layout/svg/base/src/nsSVGForeignObjectFrame.h @@ -33,7 +33,6 @@ public: NS_IMETHOD Init(nsIContent* aContent, nsIFrame* aParent, nsIFrame* aPrevInFlow); - virtual void DestroyFrom(nsIFrame* aDestructRoot); NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID, nsIAtom* aAttribute, PRInt32 aModType); diff --git a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp index 950b818f5473..375aa38fecd4 100644 --- a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp +++ b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp @@ -17,7 +17,6 @@ #include "nsIObjectLoadingContent.h" #include "nsRenderingContext.h" #include "nsStubMutationObserver.h" -#include "nsSVGForeignObjectFrame.h" #include "nsSVGIntegrationUtils.h" #include "nsSVGSVGElement.h" #include "nsSVGTextFrame.h" @@ -80,33 +79,6 @@ nsSVGMutationObserver::AttributeChanged(nsIDocument* aDocument, //---------------------------------------------------------------------- // Implementation helpers -void -nsSVGOuterSVGFrame::RegisterForeignObject(nsSVGForeignObjectFrame* aFrame) -{ - NS_ASSERTION(aFrame, "Who on earth is calling us?!"); - - if (!mForeignObjectHash.IsInitialized()) { - mForeignObjectHash.Init(); - } - - NS_ASSERTION(!mForeignObjectHash.GetEntry(aFrame), - "nsSVGForeignObjectFrame already registered!"); - - mForeignObjectHash.PutEntry(aFrame); - - NS_ASSERTION(mForeignObjectHash.GetEntry(aFrame), - "Failed to register nsSVGForeignObjectFrame!"); -} - -void -nsSVGOuterSVGFrame::UnregisterForeignObject(nsSVGForeignObjectFrame* aFrame) -{ - NS_ASSERTION(aFrame, "Who on earth is calling us?!"); - NS_ASSERTION(mForeignObjectHash.GetEntry(aFrame), - "nsSVGForeignObjectFrame not in registry!"); - return mForeignObjectHash.RemoveEntry(aFrame); -} - void nsSVGMutationObserver::UpdateTextFragmentTrees(nsIFrame *aFrame) { diff --git a/layout/svg/base/src/nsSVGOuterSVGFrame.h b/layout/svg/base/src/nsSVGOuterSVGFrame.h index 9cc11ed54593..e2a8d550eaa7 100644 --- a/layout/svg/base/src/nsSVGOuterSVGFrame.h +++ b/layout/svg/base/src/nsSVGOuterSVGFrame.h @@ -10,8 +10,6 @@ #include "nsISVGSVGFrame.h" #include "nsSVGContainerFrame.h" -class nsSVGForeignObjectFrame; - //////////////////////////////////////////////////////////////////////// // nsSVGOuterSVGFrame class @@ -29,13 +27,6 @@ public: NS_DECL_QUERYFRAME NS_DECL_FRAMEARENA_HELPERS -#ifdef DEBUG - ~nsSVGOuterSVGFrame() { - NS_ASSERTION(mForeignObjectHash.Count() == 0, - "foreignObject(s) still registered!"); - } -#endif - // nsIFrame: virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext); virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext); @@ -102,18 +93,6 @@ public: // nsSVGContainerFrame methods: virtual gfxMatrix GetCanvasTM(PRUint32 aFor); - /* Methods to allow descendant nsSVGForeignObjectFrame frames to register and - * unregister themselves with their nearest nsSVGOuterSVGFrame ancestor. This - * is temporary until display list based invalidation is impleented for SVG. - * Maintaining a list of our foreignObject descendants allows us to search - * them for areas that need to be invalidated, without having to also search - * the SVG frame tree for foreignObjects. This is important so that bug 539356 - * does not slow down SVG in general (only foreignObjects, until bug 614732 is - * fixed). - */ - void RegisterForeignObject(nsSVGForeignObjectFrame* aFrame); - void UnregisterForeignObject(nsSVGForeignObjectFrame* aFrame); - virtual bool HasChildrenOnlyTransform(gfxMatrix *aTransform) const; #ifdef XP_MACOSX @@ -151,13 +130,6 @@ protected: */ bool IsRootOfImage(); - // This is temporary until display list based invalidation is implemented for - // SVG. - // A hash-set containing our nsSVGForeignObjectFrame descendants. Note we use - // a hash-set to avoid the O(N^2) behavior we'd get tearing down an SVG frame - // subtree if we were to use a list (see bug 381285 comment 20). - nsTHashtable mForeignObjectHash; - nsAutoPtr mCanvasTM; float mFullZoom;