Bug 1664184 - minor SVG content code cleanup r=emilio

- DOMSVGAnimatedNumberList does not need to inherit from nsISupports
- various other classes can be included via forward declarations
- remove explicit in a couple of places where it makes no sense to have it

Differential Revision: https://phabricator.services.mozilla.com/D89732
This commit is contained in:
longsonr 2020-09-10 16:38:31 +00:00
parent 67eb265e55
commit 1681e6571b
8 changed files with 11 additions and 19 deletions

View File

@ -7,7 +7,6 @@
#ifndef DOM_SVG_DOMSVGANIMATEDNUMBER_H_
#define DOM_SVG_DOMSVGANIMATEDNUMBER_H_
#include "nsISupports.h"
#include "nsWrapperCache.h"
#include "SVGElement.h"

View File

@ -29,13 +29,8 @@ SVGAnimatedNumberListTearoffTable() {
NS_SVG_VAL_IMPL_CYCLE_COLLECTION_WRAPPERCACHED(DOMSVGAnimatedNumberList,
mElement)
NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGAnimatedNumberList)
NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGAnimatedNumberList)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMSVGAnimatedNumberList)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(DOMSVGAnimatedNumberList, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(DOMSVGAnimatedNumberList, Release)
JSObject* DOMSVGAnimatedNumberList::WrapObject(
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {

View File

@ -37,13 +37,12 @@ class DOMSVGNumberList;
* out our pointers to them when they die (making our pointers to them true
* weak refs).
*/
class DOMSVGAnimatedNumberList final : public nsISupports,
public nsWrapperCache {
class DOMSVGAnimatedNumberList final : public nsWrapperCache {
friend class DOMSVGNumberList;
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGAnimatedNumberList)
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMSVGAnimatedNumberList)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMSVGAnimatedNumberList)
/**
* Factory method to create and return a DOMSVGAnimatedNumberList wrapper

View File

@ -50,9 +50,9 @@ class DOMSVGTransform final : public nsWrapperCache {
* SVGTransformList.createSVGTransformFromMatrix(in DOMMatrix2DInit matrix)
* which do not initially belong to an attribute.
*/
explicit DOMSVGTransform();
DOMSVGTransform();
explicit DOMSVGTransform(const gfxMatrix& aMatrix);
explicit DOMSVGTransform(const DOMMatrix2DInit& aMatrix, ErrorResult& rv);
DOMSVGTransform(const DOMMatrix2DInit& aMatrix, ErrorResult& rv);
/**
* Ctor for creating an unowned copy. Used with Clone().

View File

@ -7,7 +7,6 @@
#ifndef DOM_SVG_SVGANIMATEDSTRING_H_
#define DOM_SVG_SVGANIMATEDSTRING_H_
#include "DOMSVGAnimatedString.h"
#include "nsError.h"
#include "mozilla/Attributes.h"
#include "mozilla/SVGAnimatedClassOrString.h"

View File

@ -7,7 +7,6 @@
#ifndef DOM_SVG_SVGFECONVOLVEMATRIXELEMENT_H_
#define DOM_SVG_SVGFECONVOLVEMATRIXELEMENT_H_
#include "DOMSVGAnimatedNumberList.h"
#include "SVGAnimatedBoolean.h"
#include "SVGAnimatedEnumeration.h"
#include "SVGAnimatedInteger.h"

View File

@ -7,8 +7,6 @@
#ifndef DOM_SVG_SVGMARKERELEMENT_H_
#define DOM_SVG_SVGMARKERELEMENT_H_
#include "DOMSVGAnimatedAngle.h"
#include "DOMSVGAnimatedEnumeration.h"
#include "SVGAnimatedEnumeration.h"
#include "SVGAnimatedLength.h"
#include "SVGAnimatedOrient.h"
@ -29,6 +27,9 @@ class SVGMarkerFrame;
namespace dom {
class DOMSVGAnimatedAngle;
class DOMSVGAnimatedEnumeration;
// Non-Exposed Marker Orientation Types
static const uint16_t SVG_MARKER_ORIENT_AUTO_START_REVERSE = 3;

View File

@ -8,7 +8,6 @@
#define DOM_SVG_SVGTEXTCONTENTELEMENT_H_
#include "mozilla/dom/SVGGraphicsElement.h"
#include "DOMSVGAnimatedEnumeration.h"
#include "SVGAnimatedEnumeration.h"
#include "SVGAnimatedLength.h"
@ -19,6 +18,7 @@ class SVGTextFrame;
namespace dom {
struct DOMPointInit;
class DOMSVGAnimatedEnumeration;
class DOMSVGPoint;
class SVGRect;