Bug 827174 - Remove nsIDOMSVGLocatable and nsIDOMSVGTransformable r=bz

This commit is contained in:
David Zbarsky 2013-01-16 15:51:00 -05:00
parent 736be515c3
commit a9dc213100
14 changed files with 12 additions and 142 deletions

View File

@ -23,8 +23,6 @@ protected:
public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_FORWARD_NSIDOMSVGLOCATABLE(SVGLocatableElement::)
NS_FORWARD_NSIDOMSVGTRANSFORMABLE(SVGTransformableElement::)
};
} // namespace dom

View File

@ -21,21 +21,11 @@ NS_IMPL_ADDREF_INHERITED(SVGLocatableElement, nsSVGElement)
NS_IMPL_RELEASE_INHERITED(SVGLocatableElement, nsSVGElement)
NS_INTERFACE_MAP_BEGIN(SVGLocatableElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGLocatable)
NS_INTERFACE_MAP_ENTRY(mozilla::dom::SVGLocatableElement)
NS_INTERFACE_MAP_END_INHERITING(nsSVGElement)
//----------------------------------------------------------------------
// nsIDOMSVGLocatable methods
/* readonly attribute nsIDOMSVGElement nearestViewportElement; */
NS_IMETHODIMP
SVGLocatableElement::GetNearestViewportElement(nsIDOMSVGElement * *aNearestViewportElement)
{
nsCOMPtr<nsIDOMSVGElement> domElem = do_QueryInterface(GetNearestViewportElement());
domElem.forget(aNearestViewportElement);
return NS_OK;
}
nsSVGElement*
SVGLocatableElement::GetNearestViewportElement()
@ -43,29 +33,12 @@ SVGLocatableElement::GetNearestViewportElement()
return SVGContentUtils::GetNearestViewportElement(this);
}
/* readonly attribute nsIDOMSVGElement farthestViewportElement; */
NS_IMETHODIMP
SVGLocatableElement::GetFarthestViewportElement(nsIDOMSVGElement * *aFarthestViewportElement)
{
NS_IF_ADDREF(*aFarthestViewportElement = SVGContentUtils::GetOuterSVGElement(this));
return NS_OK;
}
nsSVGElement*
SVGLocatableElement::GetFarthestViewportElement()
{
return SVGContentUtils::GetOuterSVGElement(this);
}
/* nsIDOMSVGRect getBBox (); */
NS_IMETHODIMP
SVGLocatableElement::GetBBox(nsIDOMSVGRect **_retval)
{
ErrorResult rv;
*_retval = GetBBox(rv).get();
return rv.ErrorCode();
}
already_AddRefed<nsIDOMSVGRect>
SVGLocatableElement::GetBBox(ErrorResult& rv)
{
@ -87,14 +60,6 @@ SVGLocatableElement::GetBBox(ErrorResult& rv)
return rect.forget();
}
/* SVGMatrix getCTM (); */
NS_IMETHODIMP
SVGLocatableElement::GetCTM(nsISupports * *aCTM)
{
*aCTM = GetCTM().get();
return NS_OK;
}
already_AddRefed<SVGMatrix>
SVGLocatableElement::GetCTM()
{
@ -103,14 +68,6 @@ SVGLocatableElement::GetCTM()
return mat.forget();
}
/* SVGMatrix getScreenCTM (); */
NS_IMETHODIMP
SVGLocatableElement::GetScreenCTM(nsISupports * *aCTM)
{
*aCTM = GetScreenCTM().get();
return NS_OK;
}
already_AddRefed<SVGMatrix>
SVGLocatableElement::GetScreenCTM()
{
@ -119,33 +76,13 @@ SVGLocatableElement::GetScreenCTM()
return mat.forget();
}
/* SVGMatrix getTransformToElement (in nsIDOMSVGElement element); */
NS_IMETHODIMP
SVGLocatableElement::GetTransformToElement(nsIDOMSVGElement *element,
nsISupports **_retval)
{
nsCOMPtr<nsSVGElement> elem = do_QueryInterface(element);
if (!elem)
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
ErrorResult rv;
*_retval = GetTransformToElement(*elem, rv).get();
return rv.ErrorCode();
}
already_AddRefed<SVGMatrix>
SVGLocatableElement::GetTransformToElement(nsSVGElement& aElement,
SVGLocatableElement::GetTransformToElement(SVGLocatableElement& aElement,
ErrorResult& rv)
{
nsCOMPtr<nsIDOMSVGLocatable> target = do_QueryInterface(&aElement);
if (!target) {
rv.Throw(NS_NOINTERFACE);
return nullptr;
}
// the easiest way to do this (if likely to increase rounding error):
nsCOMPtr<SVGMatrix> ourScreenCTM = GetScreenCTM();
nsCOMPtr<SVGMatrix> targetScreenCTM;
target->GetScreenCTM(getter_AddRefs(targetScreenCTM));
nsCOMPtr<SVGMatrix> targetScreenCTM = aElement.GetScreenCTM();
if (!ourScreenCTM || !targetScreenCTM) {
rv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;

View File

@ -7,19 +7,19 @@
#define SVGLocatableElement_h
#include "nsSVGElement.h"
#include "nsIDOMSVGLocatable.h"
#define MOZILLA_SVGLOCATABLEELEMENT_IID \
{ 0xe20176ba, 0xc48d, 0x4704, \
{0x89, 0xec, 0xe6, 0x69, 0x6c, 0xb7, 0xb8, 0xb3} }
class nsIDOMSVGRect;
namespace mozilla {
namespace dom {
class SVGMatrix;
class SVGLocatableElement : public nsSVGElement,
public nsIDOMSVGLocatable
class SVGLocatableElement : public nsSVGElement
{
public:
SVGLocatableElement(already_AddRefed<nsINodeInfo> aNodeInfo)
@ -28,7 +28,6 @@ public:
NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_SVGLOCATABLEELEMENT_IID)
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSVGLOCATABLE
// WebIDL
nsSVGElement* GetNearestViewportElement();
@ -36,7 +35,7 @@ public:
already_AddRefed<nsIDOMSVGRect> GetBBox(ErrorResult& rv);
already_AddRefed<SVGMatrix> GetCTM();
already_AddRefed<SVGMatrix> GetScreenCTM();
already_AddRefed<SVGMatrix> GetTransformToElement(nsSVGElement& aElement,
already_AddRefed<SVGMatrix> GetTransformToElement(SVGLocatableElement& aElement,
ErrorResult& rv);
};

View File

@ -8,7 +8,6 @@
#include "mozilla/dom/FromParser.h"
#include "nsIDOMSVGFitToViewBox.h"
#include "nsIDOMSVGLocatable.h"
#include "nsISVGPoint.h"
#include "nsIDOMSVGSVGElement.h"
#include "nsSVGEnum.h"

View File

@ -20,21 +20,9 @@ NS_IMPL_ADDREF_INHERITED(SVGTransformableElement, SVGLocatableElement)
NS_IMPL_RELEASE_INHERITED(SVGTransformableElement, SVGLocatableElement)
NS_INTERFACE_MAP_BEGIN(SVGTransformableElement)
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGTransformable)
NS_INTERFACE_MAP_ENTRY(mozilla::dom::SVGTransformableElement)
NS_INTERFACE_MAP_END_INHERITING(SVGLocatableElement)
//----------------------------------------------------------------------
// nsIDOMSVGTransformable methods
/* readonly attribute nsISupports transform; */
NS_IMETHODIMP
SVGTransformableElement::GetTransform(nsISupports **aTransform)
{
*aTransform = Transform().get();
return NS_OK;
}
already_AddRefed<DOMSVGAnimatedTransformList>
SVGTransformableElement::Transform()
{

View File

@ -7,7 +7,6 @@
#define SVGTransformableElement_h
#include "mozilla/dom/SVGLocatableElement.h"
#include "nsIDOMSVGTransformable.h"
#include "gfxMatrix.h"
#include "SVGAnimatedTransformList.h"
@ -19,8 +18,7 @@ namespace mozilla {
class DOMSVGAnimatedTransformList;
namespace dom {
class SVGTransformableElement : public SVGLocatableElement,
public nsIDOMSVGTransformable
class SVGTransformableElement : public SVGLocatableElement
{
public:
SVGTransformableElement(already_AddRefed<nsINodeInfo> aNodeInfo)
@ -29,7 +27,6 @@ public:
NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_SVGTRANSFORMABLEELEMENT_IID)
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSVGTRANSFORMABLE
// WebIDL
already_AddRefed<DOMSVGAnimatedTransformList> Transform();

View File

@ -34,8 +34,6 @@ public:
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGClipPathElementBase::)
NS_FORWARD_NSIDOMSVGLOCATABLE(mozilla::dom::SVGLocatableElement::)
NS_FORWARD_NSIDOMSVGTRANSFORMABLE(mozilla::dom::SVGTransformableElement::)
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;

View File

@ -342,7 +342,6 @@
#include "nsIDOMSVGImageElement.h"
#include "nsIDOMSVGLength.h"
#include "nsIDOMSVGLineElement.h"
#include "nsIDOMSVGLocatable.h"
#include "nsIDOMSVGMarkerElement.h"
#include "nsIDOMSVGMaskElement.h"
#include "nsIDOMSVGMetadataElement.h"
@ -363,7 +362,6 @@
#include "nsIDOMSVGTextElement.h"
#include "nsIDOMSVGTextPathElement.h"
#include "nsIDOMSVGTitleElement.h"
#include "nsIDOMSVGTransformable.h"
#include "nsIDOMSVGTSpanElement.h"
#include "nsIDOMSVGUnitTypes.h"
#include "nsIDOMSVGURIReference.h"
@ -2999,8 +2997,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
#define DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLocatable) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTransformable) \
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGTests) \
DOM_CLASSINFO_SVG_ELEMENT_MAP_ENTRIES
@ -3351,7 +3347,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_BEGIN(SVGSVGElement, nsIDOMSVGSVGElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGSVGElement)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGFitToViewBox)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGLocatable)
DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END

View File

@ -46,7 +46,6 @@ XPIDLSRCS = \
nsIDOMSVGImageElement.idl \
nsIDOMSVGLength.idl \
nsIDOMSVGLineElement.idl \
nsIDOMSVGLocatable.idl \
nsIDOMSVGMarkerElement.idl \
nsIDOMSVGMaskElement.idl \
nsIDOMSVGMetadataElement.idl \
@ -72,7 +71,6 @@ XPIDLSRCS = \
nsIDOMSVGTextPathElement.idl \
nsIDOMSVGTextPositionElem.idl \
nsIDOMSVGTitleElement.idl \
nsIDOMSVGTransformable.idl \
nsIDOMSVGTSpanElement.idl \
nsIDOMSVGURIReference.idl \
nsIDOMSVGUnitTypes.idl \

View File

@ -1,25 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "domstubs.idl"
interface nsIDOMSVGRect;
interface nsIDOMSVGElement;
[scriptable, uuid(9cf4fc9c-90b2-4d66-88f5-35049b558aee)]
interface nsIDOMSVGLocatable : nsISupports
{
readonly attribute nsIDOMSVGElement nearestViewportElement;
readonly attribute nsIDOMSVGElement farthestViewportElement;
nsIDOMSVGRect getBBox();
// SVGMatrix
nsISupports getCTM();
// SVGMatrix
nsISupports getScreenCTM();
// SVGMatrix
nsISupports getTransformToElement(in nsIDOMSVGElement element);
// raises( SVGException );
};

View File

@ -32,7 +32,6 @@ interface nsIDOMSVGSVGElement
nsIDOMSVGLangSpace,
nsIDOMSVGExternalResourcesRequired,
nsIDOMSVGStylable,
nsIDOMSVGLocatable,
nsIDOMSVGFitToViewBox,
nsIDOMSVGZoomAndPan,
events::nsIDOMEventTarget,

View File

@ -1,13 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsIDOMSVGLocatable.idl"
[scriptable, uuid(b81f6e37-1842-4534-a546-1ab86e59a3c6)]
interface nsIDOMSVGTransformable : nsIDOMSVGLocatable
{
// SVGAnimatedTransformList
readonly attribute nsISupports transform;
};

View File

@ -24,6 +24,6 @@ interface SVGLocatableElement : SVGElement {
SVGMatrix? getCTM();
SVGMatrix? getScreenCTM();
[Throws]
SVGMatrix getTransformToElement(SVGElement element);
SVGMatrix getTransformToElement(SVGLocatableElement element);
};

View File

@ -8,7 +8,7 @@
// Keep others in (case-insensitive) order:
#include "nsGkAtoms.h"
#include "nsIDOMSVGTransformable.h"
#include "SVGTransformableElement.h"
#include "nsIFrame.h"
#include "SVGGraphicsElement.h"
#include "nsSVGIntegrationUtils.h"
@ -33,7 +33,7 @@ nsSVGGFrame::Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow)
{
nsCOMPtr<nsIDOMSVGTransformable> transformable = do_QueryInterface(aContent);
nsCOMPtr<SVGTransformableElement> transformable = do_QueryInterface(aContent);
NS_ASSERTION(transformable,
"The element doesn't support nsIDOMSVGTransformable\n");