Bug 610796 followup: Fix non-libxul build issue from main patch, by using a virtual function call to a helper method. (Revert this changeset once we drop support for non-libxul builds). r=roc a=blocking-final+

This commit is contained in:
Daniel Holbert 2010-11-16 15:19:21 -08:00
parent d55cd7386a
commit cca5a43b65
3 changed files with 25 additions and 0 deletions

View File

@ -60,6 +60,7 @@
#include "nsGUIEvent.h"
#include "nsSVGUtils.h"
#include "nsSVGSVGElement.h"
#include "nsSVGEffects.h" // For nsSVGEffects::RemoveAllRenderingObservers
#ifdef MOZ_SMIL
#include "nsEventDispatcher.h"
@ -1229,3 +1230,12 @@ nsSVGSVGElement::GetPreserveAspectRatio()
{
return &mPreserveAspectRatio;
}
#ifndef MOZ_ENABLE_LIBXUL
// XXXdholbert HACK -- see comment w/ this method's declaration in header file.
void
nsSVGSVGElement::RemoveAllRenderingObservers()
{
nsSVGEffects::RemoveAllRenderingObservers(this);
}
#endif // !MOZ_LIBXUL

View File

@ -221,6 +221,14 @@ public:
}
virtual nsXPCClassInfo* GetClassInfo();
#ifndef MOZ_ENABLE_LIBXUL
// XXXdholbert HACK to call static method
// nsSVGEffects::RemoveAllRenderingObservers() on myself, on behalf
// of imagelib in non-libxul builds.
virtual void RemoveAllRenderingObservers();
#endif // !MOZ_LIBXUL
protected:
// nsSVGElement overrides
PRBool IsEventName(nsIAtom* aName);

View File

@ -302,7 +302,14 @@ SVGDocumentWrapper::Observe(nsISupports* aSubject,
// Sever ties from rendering observers to helper-doc's root SVG node
nsSVGSVGElement* svgElem = GetRootSVGElem();
if (svgElem) {
#ifdef MOZ_ENABLE_LIBXUL
nsSVGEffects::RemoveAllRenderingObservers(svgElem);
#else
// XXXdholbert Can't call static nsSVGEffects functions from imagelib in
// non-libxul builds -- so, this is a hack using a virtual function to
// have the SVG element call the method on our behalf.
svgElem->RemoveAllRenderingObservers();
#endif // MOZ_ENABLE_LIBXUL
}
// Clean up at XPCOM shutdown time.