Bug 1488700 p5. Get rid of nsISVGFilterReference. r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D5079

--HG--
extra : rebase_source : 3ad29efa0666b870cb3683b854919cc2d8514ad0
This commit is contained in:
Jonathan Watt 2018-08-09 20:15:48 +02:00
Родитель 886e2b8ae4
Коммит ac6f67ef4f
4 изменённых файлов: 19 добавлений и 24 удалений

Просмотреть файл

@ -12,7 +12,9 @@
#include "mozilla/dom/SVGFilterElementBinding.h"
#include "mozilla/dom/SVGLengthBinding.h"
#include "mozilla/dom/SVGUnitTypesBinding.h"
#include "nsQueryObject.h"
#include "nsSVGUtils.h"
#include "SVGObserverUtils.h"
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Filter)
@ -144,7 +146,7 @@ SVGFilterElement::Invalidate()
nsAutoTObserverArray<nsIMutationObserver*, 1>::ForwardIterator iter(*observers);
while (iter.HasMore()) {
nsCOMPtr<nsIMutationObserver> obs(iter.GetNext());
nsCOMPtr<nsISVGFilterReference> filter = do_QueryInterface(obs);
RefPtr<nsSVGFilterReference> filter = do_QueryObject(obs);
if (filter)
filter->Invalidate();
}

Просмотреть файл

@ -230,9 +230,16 @@ nsSVGRenderingObserverProperty::OnRenderingChange()
}
}
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGFilterReference)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGFilterReference)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGFilterReference)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
NS_INTERFACE_MAP_ENTRY(nsSVGFilterReference)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_CLASS(nsSVGFilterReference)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsSVGFilterReference)
@ -244,12 +251,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsSVGFilterReference)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mObservedElementTracker);
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGFilterReference)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, SVGIDRenderingObserver)
NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
NS_INTERFACE_MAP_ENTRY(nsISVGFilterReference)
NS_INTERFACE_MAP_END
nsSVGFilterFrame *
nsSVGFilterReference::GetFilterFrame()
{

Просмотреть файл

@ -222,6 +222,10 @@ protected:
nsSVGFrameReferenceFromProperty mFrameReference;
};
#define NS_SVGFILTEROBSERVER_IID \
{ 0x9744ee20, 0x1bcf, 0x4c62, \
{ 0x86, 0x7d, 0xd3, 0x7a, 0x91, 0x60, 0x3e, 0xef } }
/**
* In a filter chain, there can be multiple SVG reference filters.
* e.g. filter: url(#svg-filter-1) blur(10px) url(#svg-filter-2);
@ -235,7 +239,6 @@ protected:
* The nsSVGFilterChainObserver class manages a list of nsSVGFilterReferences.
*/
class nsSVGFilterReference final : public SVGIDRenderingObserver
, public nsISVGFilterReference
{
public:
nsSVGFilterReference(nsIURI* aURI,
@ -256,11 +259,11 @@ public:
nsSVGFilterFrame *GetFilterFrame();
// nsISupports
NS_DECLARE_STATIC_IID_ACCESSOR(NS_SVGFILTEROBSERVER_IID)
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsSVGFilterReference, SVGIDRenderingObserver)
NS_DECL_CYCLE_COLLECTION_CLASS(nsSVGFilterReference)
// nsISVGFilterReference
virtual void Invalidate() override { OnRenderingChange(); };
void Invalidate() { OnRenderingChange(); };
protected:
virtual ~nsSVGFilterReference() {}
@ -272,6 +275,8 @@ private:
nsSVGFilterChainObserver* mFilterChainObserver;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsSVGFilterReference, NS_SVGFILTEROBSERVER_IID)
/**
* This class manages a list of nsSVGFilterReferences, which represent SVG
* reference filters in a filter chain.

Просмотреть файл

@ -161,19 +161,6 @@ private:
};
#define NS_ISVGFILTERREFERENCE_IID \
{ 0x9744ee20, 0x1bcf, 0x4c62, \
{ 0x86, 0x7d, 0xd3, 0x7a, 0x91, 0x60, 0x3e, 0xef } }
class nsISVGFilterReference : public nsISupports
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISVGFILTERREFERENCE_IID)
virtual void Invalidate() = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsISVGFilterReference, NS_ISVGFILTERREFERENCE_IID)
/**
* General functions used by all of SVG layout and possibly content code.
* If a method is used by content and depends only on other content methods