mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-01 05:43:46 +00:00
Bug 817442 Part 10: Remove nsIDOMSVGPoint r=bz
This commit is contained in:
parent
9b30e90f8c
commit
f88a3e128d
@ -8,7 +8,6 @@
|
||||
#include "SVGPoint.h"
|
||||
#include "SVGAnimatedPointList.h"
|
||||
#include "nsSVGElement.h"
|
||||
#include "nsIDOMSVGPoint.h"
|
||||
#include "nsError.h"
|
||||
#include "nsContentUtils.h" // NS_ENSURE_FINITE
|
||||
#include "DOMSVGMatrix.h"
|
||||
@ -44,15 +43,11 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_END
|
||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMSVGPoint)
|
||||
NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMSVGPoint)
|
||||
|
||||
DOMCI_DATA(SVGPoint, DOMSVGPoint)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMSVGPoint)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(DOMSVGPoint) // pseudo-interface
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGPoint)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGPoint)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGPoint)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
float
|
||||
@ -64,25 +59,6 @@ DOMSVGPoint::X()
|
||||
return HasOwner() ? InternalItem().mX : mPt.mX;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DOMSVGPoint::GetX(float* aX)
|
||||
{
|
||||
*aX = X();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DOMSVGPoint::SetX(float aX)
|
||||
{
|
||||
if (!NS_finite(aX)) {
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
ErrorResult rv;
|
||||
SetX(aX, rv);
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
void
|
||||
DOMSVGPoint::SetX(float aX, ErrorResult& rv)
|
||||
{
|
||||
@ -115,25 +91,6 @@ DOMSVGPoint::Y()
|
||||
return HasOwner() ? InternalItem().mY : mPt.mY;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DOMSVGPoint::GetY(float* aY)
|
||||
{
|
||||
*aY = Y();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DOMSVGPoint::SetY(float aY)
|
||||
{
|
||||
if (!NS_finite(aY)) {
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
ErrorResult rv;
|
||||
SetY(aY, rv);
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
void
|
||||
DOMSVGPoint::SetY(float aY, ErrorResult& rv)
|
||||
{
|
||||
@ -157,19 +114,6 @@ DOMSVGPoint::SetY(float aY, ErrorResult& rv)
|
||||
mPt.mY = aY;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
DOMSVGPoint::MatrixTransform(nsISupports *matrix,
|
||||
nsIDOMSVGPoint **_retval)
|
||||
{
|
||||
nsCOMPtr<DOMSVGMatrix> domMatrix = do_QueryInterface(matrix);
|
||||
if (!domMatrix) {
|
||||
*_retval = nullptr;
|
||||
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
|
||||
}
|
||||
*_retval = MatrixTransform(*domMatrix).get();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
already_AddRefed<nsISVGPoint>
|
||||
DOMSVGPoint::MatrixTransform(DOMSVGMatrix& matrix)
|
||||
{
|
||||
|
@ -54,7 +54,6 @@ public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(MOZILLA_DOMSVGPOINT_IID)
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGPoint)
|
||||
NS_DECL_NSIDOMSVGPOINT
|
||||
|
||||
/**
|
||||
* Generic ctor for DOMSVGPoint objects that are created for an attribute.
|
||||
|
@ -122,7 +122,7 @@ nsDOMSVGZoomEvent::GetPreviousScale(float *aPreviousScale)
|
||||
|
||||
/* readonly attribute SVGPoint previousTranslate; */
|
||||
NS_IMETHODIMP
|
||||
nsDOMSVGZoomEvent::GetPreviousTranslate(nsIDOMSVGPoint **aPreviousTranslate)
|
||||
nsDOMSVGZoomEvent::GetPreviousTranslate(nsISupports **aPreviousTranslate)
|
||||
{
|
||||
*aPreviousTranslate = mPreviousTranslate;
|
||||
NS_IF_ADDREF(*aPreviousTranslate);
|
||||
@ -138,7 +138,7 @@ NS_IMETHODIMP nsDOMSVGZoomEvent::GetNewScale(float *aNewScale)
|
||||
|
||||
/* readonly attribute SVGPoint newTranslate; */
|
||||
NS_IMETHODIMP
|
||||
nsDOMSVGZoomEvent::GetNewTranslate(nsIDOMSVGPoint **aNewTranslate)
|
||||
nsDOMSVGZoomEvent::GetNewTranslate(nsISupports **aNewTranslate)
|
||||
{
|
||||
*aNewTranslate = mNewTranslate;
|
||||
NS_IF_ADDREF(*aNewTranslate);
|
||||
|
@ -7,7 +7,6 @@
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsIDOMSVGPoint.h"
|
||||
#include "nsWrapperCache.h"
|
||||
#include "mozilla/dom/SVGPointBinding.h"
|
||||
|
||||
@ -28,7 +27,7 @@ class DOMSVGMatrix;
|
||||
* This class creates the DOM objects that wrap internal SVGPoint objects.
|
||||
* An nsISVGPoint can be either a DOMSVGPoint or a nsSVGTranslatePoint::DOMVal.
|
||||
*/
|
||||
class nsISVGPoint : public nsIDOMSVGPoint,
|
||||
class nsISVGPoint : public nsISupports,
|
||||
public nsWrapperCache
|
||||
{
|
||||
public:
|
||||
@ -42,10 +41,6 @@ public:
|
||||
SetIsDOMBinding();
|
||||
}
|
||||
|
||||
using nsIDOMSVGPoint::SetX;
|
||||
using nsIDOMSVGPoint::SetY;
|
||||
using nsIDOMSVGPoint::MatrixTransform;
|
||||
|
||||
// WebIDL
|
||||
virtual float X() = 0;
|
||||
virtual void SetX(float aX, ErrorResult& rv) = 0;
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "nsIDOMMutationEvent.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsISVGChildFrame.h"
|
||||
#include "nsIDOMSVGPoint.h"
|
||||
#include "nsSVGUtils.h"
|
||||
#include "nsError.h"
|
||||
#include "nsSVGRect.h"
|
||||
|
@ -75,9 +75,9 @@ nsSVGPathElement::GetTotalLength(float *_retval)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint getPointAtLength (in float distance); */
|
||||
/* DOMSVGPoint getPointAtLength (in float distance); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGPathElement::GetPointAtLength(float distance, nsIDOMSVGPoint **_retval)
|
||||
nsSVGPathElement::GetPointAtLength(float distance, nsISupports **_retval)
|
||||
{
|
||||
NS_ENSURE_FINITE(distance, NS_ERROR_ILLEGAL_VALUE);
|
||||
|
||||
|
@ -49,15 +49,13 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGTranslatePoint::DOMVal)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGTranslatePoint::DOMVal)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMSVGPoint)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISVGPoint)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGPoint)
|
||||
NS_INTERFACE_MAP_END
|
||||
|
||||
nsresult
|
||||
nsSVGTranslatePoint::ToDOMVal(nsSVGSVGElement *aElement,
|
||||
nsIDOMSVGPoint **aResult)
|
||||
nsISupports **aResult)
|
||||
{
|
||||
NS_ADDREF(*aResult = new DOMVal(this, aElement));
|
||||
return NS_OK;
|
||||
@ -69,70 +67,18 @@ nsSVGTranslatePoint::DOMVal::GetParentObject()
|
||||
return static_cast<nsIDOMSVGSVGElement*>(mElement);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTranslatePoint::DOMVal::GetX(float* aX)
|
||||
{
|
||||
*aX = X();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTranslatePoint::DOMVal::GetY(float* aY)
|
||||
{
|
||||
*aY = Y();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTranslatePoint::DOMVal::SetX(float aValue, ErrorResult& rv)
|
||||
{
|
||||
rv = mElement->SetCurrentTranslate(aValue, mVal->GetY());
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTranslatePoint::DOMVal::SetX(float aX)
|
||||
{
|
||||
if (!NS_finite(aX)) {
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
ErrorResult rv;
|
||||
SetX(aX, rv);
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
void
|
||||
nsSVGTranslatePoint::DOMVal::SetY(float aValue, ErrorResult& rv)
|
||||
{
|
||||
rv = mElement->SetCurrentTranslate(mVal->GetX(), aValue);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTranslatePoint::DOMVal::SetY(float aY)
|
||||
{
|
||||
if (!NS_finite(aY)) {
|
||||
return NS_ERROR_ILLEGAL_VALUE;
|
||||
}
|
||||
|
||||
ErrorResult rv;
|
||||
SetY(aY, rv);
|
||||
return rv.ErrorCode();
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint matrixTransform (in DOMSVGMatrix matrix); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGTranslatePoint::DOMVal::MatrixTransform(nsISupports *matrix,
|
||||
nsIDOMSVGPoint **_retval)
|
||||
{
|
||||
nsCOMPtr<DOMSVGMatrix> domMatrix = do_QueryInterface(matrix);
|
||||
if (!domMatrix) {
|
||||
*_retval = nullptr;
|
||||
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
|
||||
}
|
||||
*_retval = MatrixTransform(*domMatrix).get();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
already_AddRefed<nsISVGPoint>
|
||||
nsSVGTranslatePoint::DOMVal::MatrixTransform(DOMSVGMatrix& matrix)
|
||||
{
|
||||
@ -347,9 +293,9 @@ nsSVGSVGElement::SetCurrentScale(float aCurrentScale)
|
||||
mCurrentTranslate.GetX(), mCurrentTranslate.GetY());
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMSVGPoint currentTranslate; */
|
||||
/* readonly attribute DOMSVGPoint currentTranslate; */
|
||||
NS_IMETHODIMP
|
||||
nsSVGSVGElement::GetCurrentTranslate(nsIDOMSVGPoint * *aCurrentTranslate)
|
||||
nsSVGSVGElement::GetCurrentTranslate(nsISupports * *aCurrentTranslate)
|
||||
{
|
||||
return mCurrentTranslate.ToDOMVal(this, aCurrentTranslate);
|
||||
}
|
||||
@ -572,9 +518,9 @@ nsSVGSVGElement::CreateSVGAngle(nsISupports **_retval)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint createSVGPoint (); */
|
||||
/* DOMSVGPoint createSVGPoint (); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGSVGElement::CreateSVGPoint(nsIDOMSVGPoint **_retval)
|
||||
nsSVGSVGElement::CreateSVGPoint(nsISupports **_retval)
|
||||
{
|
||||
NS_ADDREF(*_retval = new DOMSVGPoint(0, 0));
|
||||
return NS_OK;
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
float GetY() const
|
||||
{ return mY; }
|
||||
|
||||
nsresult ToDOMVal(nsSVGSVGElement *aElement, nsIDOMSVGPoint **aResult);
|
||||
nsresult ToDOMVal(nsSVGSVGElement *aElement, nsISupports **aResult);
|
||||
|
||||
bool operator!=(const nsSVGTranslatePoint &rhs) const {
|
||||
return mX != rhs.mX || mY != rhs.mY;
|
||||
@ -67,7 +67,6 @@ private:
|
||||
|
||||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMVal)
|
||||
NS_DECL_NSIDOMSVGPOINT
|
||||
|
||||
// WebIDL
|
||||
virtual float X() { return mVal->GetX(); }
|
||||
|
@ -5,6 +5,7 @@
|
||||
|
||||
#include "nsSVGTextContentElement.h"
|
||||
#include "DOMSVGPoint.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
@ -75,8 +76,8 @@ NS_IMETHODIMP nsSVGTextContentElement::GetSubStringLength(uint32_t charnum, uint
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint getStartPositionOfChar (in unsigned long charnum); */
|
||||
NS_IMETHODIMP nsSVGTextContentElement::GetStartPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_retval)
|
||||
/* DOMSVGPoint getStartPositionOfChar (in unsigned long charnum); */
|
||||
NS_IMETHODIMP nsSVGTextContentElement::GetStartPositionOfChar(uint32_t charnum, nsISupports **_retval)
|
||||
{
|
||||
*_retval = nullptr;
|
||||
nsSVGTextContainerFrame* metrics = GetTextContainerFrame();
|
||||
@ -86,8 +87,8 @@ NS_IMETHODIMP nsSVGTextContentElement::GetStartPositionOfChar(uint32_t charnum,
|
||||
return metrics->GetStartPositionOfChar(charnum, _retval);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint getEndPositionOfChar (in unsigned long charnum); */
|
||||
NS_IMETHODIMP nsSVGTextContentElement::GetEndPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_retval)
|
||||
/* DOMSVGPoint getEndPositionOfChar (in unsigned long charnum); */
|
||||
NS_IMETHODIMP nsSVGTextContentElement::GetEndPositionOfChar(uint32_t charnum, nsISupports **_retval)
|
||||
{
|
||||
*_retval = nullptr;
|
||||
nsSVGTextContainerFrame* metrics = GetTextContainerFrame();
|
||||
@ -120,18 +121,19 @@ NS_IMETHODIMP nsSVGTextContentElement::GetRotationOfChar(uint32_t charnum, float
|
||||
return metrics->GetRotationOfChar(charnum, _retval);
|
||||
}
|
||||
|
||||
/* long getCharNumAtPosition (in nsIDOMSVGPoint point); */
|
||||
NS_IMETHODIMP nsSVGTextContentElement::GetCharNumAtPosition(nsIDOMSVGPoint *point, int32_t *_retval)
|
||||
/* long getCharNumAtPosition (in DOMSVGPoint point); */
|
||||
NS_IMETHODIMP nsSVGTextContentElement::GetCharNumAtPosition(nsISupports *point, int32_t *_retval)
|
||||
{
|
||||
nsCOMPtr<DOMSVGPoint> p = do_QueryInterface(point);
|
||||
if (!p)
|
||||
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
|
||||
|
||||
*_retval = -1;
|
||||
|
||||
nsCOMPtr<DOMSVGPoint> domPoint = do_QueryInterface(point);
|
||||
if (!domPoint) {
|
||||
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
|
||||
}
|
||||
|
||||
nsSVGTextContainerFrame* metrics = GetTextContainerFrame();
|
||||
if (metrics)
|
||||
*_retval = metrics->GetCharNumAtPosition(point);
|
||||
*_retval = metrics->GetCharNumAtPosition(domPoint);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -244,9 +244,9 @@ nsSVGTextElement::GetSubStringLength(uint32_t charnum, uint32_t nchars, float *_
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint getStartPositionOfChar (in unsigned long charnum); */
|
||||
/* DOMSVGPoint getStartPositionOfChar (in unsigned long charnum); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGTextElement::GetStartPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_retval)
|
||||
nsSVGTextElement::GetStartPositionOfChar(uint32_t charnum, nsISupports **_retval)
|
||||
{
|
||||
*_retval = nullptr;
|
||||
nsSVGTextContainerFrame* metrics = GetTextContainerFrame();
|
||||
@ -256,9 +256,9 @@ nsSVGTextElement::GetStartPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_ret
|
||||
return metrics->GetStartPositionOfChar(charnum, _retval);
|
||||
}
|
||||
|
||||
/* nsIDOMSVGPoint getEndPositionOfChar (in unsigned long charnum); */
|
||||
/* DOMSVGPoint getEndPositionOfChar (in unsigned long charnum); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGTextElement::GetEndPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_retval)
|
||||
nsSVGTextElement::GetEndPositionOfChar(uint32_t charnum, nsISupports **_retval)
|
||||
{
|
||||
*_retval = nullptr;
|
||||
nsSVGTextContainerFrame* metrics = GetTextContainerFrame();
|
||||
@ -293,19 +293,20 @@ nsSVGTextElement::GetRotationOfChar(uint32_t charnum, float *_retval)
|
||||
return metrics->GetRotationOfChar(charnum, _retval);
|
||||
}
|
||||
|
||||
/* long getCharNumAtPosition (in nsIDOMSVGPoint point); */
|
||||
/* long getCharNumAtPosition (in DOMSVGPoint point); */
|
||||
NS_IMETHODIMP
|
||||
nsSVGTextElement::GetCharNumAtPosition(nsIDOMSVGPoint *point, int32_t *_retval)
|
||||
nsSVGTextElement::GetCharNumAtPosition(nsISupports *point, int32_t *_retval)
|
||||
{
|
||||
nsCOMPtr<DOMSVGPoint> p = do_QueryInterface(point);
|
||||
if (!p)
|
||||
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
|
||||
|
||||
*_retval = -1;
|
||||
|
||||
nsCOMPtr<DOMSVGPoint> domPoint = do_QueryInterface(point);
|
||||
if (!domPoint) {
|
||||
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
|
||||
}
|
||||
|
||||
nsSVGTextContainerFrame* metrics = GetTextContainerFrame();
|
||||
if (metrics)
|
||||
*_retval = metrics->GetCharNumAtPosition(point);
|
||||
*_retval = metrics->GetCharNumAtPosition(domPoint);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -356,7 +356,6 @@
|
||||
#include "nsIDOMSVGNumberList.h"
|
||||
#include "nsIDOMSVGPathElement.h"
|
||||
#include "nsIDOMSVGPatternElement.h"
|
||||
#include "nsIDOMSVGPoint.h"
|
||||
#include "nsIDOMSVGPolygonElement.h"
|
||||
#include "nsIDOMSVGPolylineElement.h"
|
||||
#include "nsIDOMSVGRect.h"
|
||||
@ -1242,8 +1241,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(SVGNumberList, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(SVGPoint, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(SVGRect, nsDOMGenericSH,
|
||||
DOM_DEFAULT_SCRIPTABLE_FLAGS)
|
||||
NS_DEFINE_CLASSINFO_DATA(SVGStringList, nsSVGStringListSH,
|
||||
@ -3530,10 +3527,6 @@ nsDOMClassInfo::Init()
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGNumberList)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(SVGPoint, nsIDOMSVGPoint)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGPoint)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
||||
DOM_CLASSINFO_MAP_BEGIN(SVGRect, nsIDOMSVGRect)
|
||||
DOM_CLASSINFO_MAP_ENTRY(nsIDOMSVGRect)
|
||||
DOM_CLASSINFO_MAP_END
|
||||
|
@ -37,7 +37,6 @@ class nsIDOMSVGLength;
|
||||
class nsIDOMSVGLengthList;
|
||||
class nsIDOMSVGNumber;
|
||||
class nsIDOMSVGNumberList;
|
||||
class nsIDOMSVGPoint;
|
||||
class nsIDOMSVGStringList;
|
||||
class nsIDOMSVGTests;
|
||||
class nsIDOMWindow;
|
||||
|
@ -268,7 +268,6 @@ DOMCI_CLASS(SVGLength)
|
||||
DOMCI_CLASS(SVGLengthList)
|
||||
DOMCI_CLASS(SVGNumber)
|
||||
DOMCI_CLASS(SVGNumberList)
|
||||
DOMCI_CLASS(SVGPoint)
|
||||
DOMCI_CLASS(SVGRect)
|
||||
DOMCI_CLASS(SVGStringList)
|
||||
DOMCI_CLASS(SVGZoomEvent)
|
||||
|
@ -60,7 +60,6 @@ XPIDLSRCS = \
|
||||
nsIDOMSVGNumberList.idl \
|
||||
nsIDOMSVGPathElement.idl \
|
||||
nsIDOMSVGPatternElement.idl \
|
||||
nsIDOMSVGPoint.idl \
|
||||
nsIDOMSVGPolygonElement.idl \
|
||||
nsIDOMSVGPolylineElement.idl \
|
||||
nsIDOMSVGRect.idl \
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include "nsIDOMSVGElement.idl"
|
||||
|
||||
interface nsIDOMSVGAnimatedNumber;
|
||||
interface nsIDOMSVGPoint;
|
||||
|
||||
[scriptable, uuid(89AF3EAE-1703-461A-A2E0-86D2131C11AC)]
|
||||
interface nsIDOMSVGPathElement
|
||||
@ -31,7 +30,8 @@ interface nsIDOMSVGPathElement
|
||||
readonly attribute nsIDOMSVGAnimatedNumber pathLength;
|
||||
|
||||
float getTotalLength();
|
||||
nsIDOMSVGPoint getPointAtLength(in float distance);
|
||||
// SVGPoint
|
||||
nsISupports getPointAtLength(in float distance);
|
||||
unsigned long getPathSegAtLength(in float distance);
|
||||
|
||||
// SVGPathSegClosePath
|
||||
|
@ -1,19 +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"
|
||||
|
||||
|
||||
[scriptable, uuid(45f18f8f-1315-4447-a7d5-8aeca77bdcaf)]
|
||||
interface nsIDOMSVGPoint : nsISupports
|
||||
{
|
||||
attribute float x;
|
||||
// raises DOMException on setting
|
||||
attribute float y;
|
||||
// raises DOMException on setting
|
||||
|
||||
// SVGMatrix
|
||||
nsIDOMSVGPoint matrixTransform(in nsISupports matrix);
|
||||
};
|
@ -8,7 +8,6 @@
|
||||
interface nsIDOMSVGAnimatedLength;
|
||||
interface nsIDOMSVGRect;
|
||||
interface nsIDOMSVGViewSpec;
|
||||
interface nsIDOMSVGPoint;
|
||||
interface nsIDOMSVGNumber;
|
||||
interface nsIDOMSVGLength;
|
||||
|
||||
@ -53,7 +52,8 @@ interface nsIDOMSVGSVGElement
|
||||
readonly attribute nsIDOMSVGViewSpec currentView;
|
||||
attribute float currentScale;
|
||||
// raises DOMException on setting
|
||||
readonly attribute nsIDOMSVGPoint currentTranslate;
|
||||
// SVGPoint
|
||||
readonly attribute nsISupports currentTranslate;
|
||||
|
||||
unsigned long suspendRedraw(in unsigned long max_wait_milliseconds);
|
||||
void unsuspendRedraw(in unsigned long suspend_handle_id);
|
||||
@ -75,7 +75,8 @@ interface nsIDOMSVGSVGElement
|
||||
nsIDOMSVGLength createSVGLength();
|
||||
// SVGAngle
|
||||
nsISupports createSVGAngle();
|
||||
nsIDOMSVGPoint createSVGPoint();
|
||||
// SVGPoint
|
||||
nsISupports createSVGPoint();
|
||||
// SVGMatrix
|
||||
nsISupports createSVGMatrix();
|
||||
nsIDOMSVGRect createSVGRect();
|
||||
|
@ -7,10 +7,8 @@
|
||||
|
||||
interface nsIDOMSVGAnimatedLength;
|
||||
interface nsIDOMSVGAnimatedEnumeration;
|
||||
interface nsIDOMSVGPoint;
|
||||
interface nsIDOMSVGRect;
|
||||
|
||||
|
||||
[scriptable, uuid(8A884160-DB64-4BF7-B932-15398E536A8D)]
|
||||
interface nsIDOMSVGTextContentElement
|
||||
: nsIDOMSVGElement
|
||||
@ -41,15 +39,17 @@ interface nsIDOMSVGTextContentElement
|
||||
float getComputedTextLength();
|
||||
float getSubStringLength(in unsigned long charnum, in unsigned long nchars);
|
||||
// raises(DOMException);
|
||||
nsIDOMSVGPoint getStartPositionOfChar(in unsigned long charnum);
|
||||
// SVGPoint
|
||||
nsISupports getStartPositionOfChar(in unsigned long charnum);
|
||||
// raises(DOMException);
|
||||
nsIDOMSVGPoint getEndPositionOfChar(in unsigned long charnum);
|
||||
// SVGPoint
|
||||
nsISupports getEndPositionOfChar(in unsigned long charnum);
|
||||
// raises(DOMException);
|
||||
nsIDOMSVGRect getExtentOfChar(in unsigned long charnum);
|
||||
// raises(DOMException);
|
||||
float getRotationOfChar(in unsigned long charnum);
|
||||
// raises(DOMException);
|
||||
long getCharNumAtPosition(in nsIDOMSVGPoint point);
|
||||
// raises(DOMException); SVGPoint
|
||||
long getCharNumAtPosition(in nsISupports point);
|
||||
void selectSubString(in unsigned long charnum, in unsigned long nchars);
|
||||
// raises(DOMException);
|
||||
};
|
||||
|
@ -11,14 +11,15 @@
|
||||
*/
|
||||
|
||||
interface nsIDOMSVGRect;
|
||||
interface nsIDOMSVGPoint;
|
||||
|
||||
[scriptable, builtinclass, uuid(9cf032c6-8485-4bde-90d4-0c8bbff27a12)]
|
||||
interface nsIDOMSVGZoomEvent : nsIDOMUIEvent
|
||||
{
|
||||
readonly attribute nsIDOMSVGRect zoomRectScreen;
|
||||
readonly attribute float previousScale;
|
||||
readonly attribute nsIDOMSVGPoint previousTranslate;
|
||||
// SVGPoint
|
||||
readonly attribute nsISupports previousTranslate;
|
||||
readonly attribute float newScale;
|
||||
readonly attribute nsIDOMSVGPoint newTranslate;
|
||||
// SVGPoint
|
||||
readonly attribute nsISupports newTranslate;
|
||||
};
|
||||
|
@ -9,9 +9,12 @@
|
||||
|
||||
#include "nsQueryFrame.h"
|
||||
|
||||
class nsIDOMSVGPoint;
|
||||
class nsSVGGlyphFrame;
|
||||
|
||||
namespace mozilla {
|
||||
class DOMSVGPoint;
|
||||
}
|
||||
|
||||
class nsISVGGlyphFragmentNode : public nsQueryFrame
|
||||
{
|
||||
public:
|
||||
@ -20,7 +23,7 @@ public:
|
||||
virtual uint32_t GetNumberOfChars()=0;
|
||||
virtual float GetComputedTextLength()=0;
|
||||
virtual float GetSubStringLength(uint32_t charnum, uint32_t fragmentChars)=0;
|
||||
virtual int32_t GetCharNumAtPosition(nsIDOMSVGPoint *point)=0;
|
||||
virtual int32_t GetCharNumAtPosition(mozilla::DOMSVGPoint *point)=0;
|
||||
NS_IMETHOD_(nsSVGGlyphFrame *) GetFirstGlyphFrame()=0;
|
||||
NS_IMETHOD_(nsSVGGlyphFrame *) GetNextGlyphFrame()=0;
|
||||
NS_IMETHOD_(void) SetWhitespaceCompression(bool aCompressWhitespace)=0;
|
||||
|
@ -1341,7 +1341,7 @@ nsSVGGlyphFrame::SetGlyphPosition(gfxPoint *aPosition, bool aForceGlobalTransfor
|
||||
|
||||
nsresult
|
||||
nsSVGGlyphFrame::GetStartPositionOfChar(uint32_t charnum,
|
||||
nsIDOMSVGPoint **_retval)
|
||||
nsISupports **_retval)
|
||||
{
|
||||
*_retval = nullptr;
|
||||
|
||||
@ -1355,7 +1355,7 @@ nsSVGGlyphFrame::GetStartPositionOfChar(uint32_t charnum,
|
||||
|
||||
nsresult
|
||||
nsSVGGlyphFrame::GetEndPositionOfChar(uint32_t charnum,
|
||||
nsIDOMSVGPoint **_retval)
|
||||
nsISupports **_retval)
|
||||
{
|
||||
*_retval = nullptr;
|
||||
|
||||
@ -1600,11 +1600,9 @@ nsSVGGlyphFrame::GetSubStringLength(uint32_t charnum, uint32_t fragmentChars)
|
||||
}
|
||||
|
||||
int32_t
|
||||
nsSVGGlyphFrame::GetCharNumAtPosition(nsIDOMSVGPoint *point)
|
||||
nsSVGGlyphFrame::GetCharNumAtPosition(DOMSVGPoint *point)
|
||||
{
|
||||
float xPos, yPos;
|
||||
point->GetX(&xPos);
|
||||
point->GetY(&yPos);
|
||||
float xPos = point->X(), yPos = point->Y();
|
||||
|
||||
nsRefPtr<gfxContext> tmpCtx = MakeTmpCtx();
|
||||
CharacterIterator iter(this, false);
|
||||
|
@ -60,8 +60,8 @@ public:
|
||||
NS_DECL_FRAMEARENA_HELPERS
|
||||
|
||||
// These do not use the global transform if NS_STATE_NONDISPLAY_CHILD
|
||||
nsresult GetStartPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_retval);
|
||||
nsresult GetEndPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_retval);
|
||||
nsresult GetStartPositionOfChar(uint32_t charnum, nsISupports **_retval);
|
||||
nsresult GetEndPositionOfChar(uint32_t charnum, nsISupports **_retval);
|
||||
nsresult GetExtentOfChar(uint32_t charnum, nsIDOMSVGRect **_retval);
|
||||
nsresult GetRotationOfChar(uint32_t charnum, float *_retval);
|
||||
/**
|
||||
@ -173,7 +173,7 @@ public:
|
||||
virtual uint32_t GetNumberOfChars();
|
||||
virtual float GetComputedTextLength() MOZ_OVERRIDE;
|
||||
virtual float GetSubStringLength(uint32_t charnum, uint32_t fragmentChars) MOZ_OVERRIDE;
|
||||
virtual int32_t GetCharNumAtPosition(nsIDOMSVGPoint *point) MOZ_OVERRIDE;
|
||||
virtual int32_t GetCharNumAtPosition(mozilla::DOMSVGPoint *point) MOZ_OVERRIDE;
|
||||
NS_IMETHOD_(nsSVGGlyphFrame *) GetFirstGlyphFrame() MOZ_OVERRIDE;
|
||||
NS_IMETHOD_(nsSVGGlyphFrame *) GetNextGlyphFrame() MOZ_OVERRIDE;
|
||||
NS_IMETHOD_(void) SetWhitespaceCompression(bool aCompressWhitespace) MOZ_OVERRIDE {
|
||||
|
@ -126,7 +126,7 @@ nsSVGTSpanFrame::GetSubStringLength(uint32_t charnum, uint32_t nchars)
|
||||
}
|
||||
|
||||
int32_t
|
||||
nsSVGTSpanFrame::GetCharNumAtPosition(nsIDOMSVGPoint *point)
|
||||
nsSVGTSpanFrame::GetCharNumAtPosition(mozilla::DOMSVGPoint *point)
|
||||
{
|
||||
return nsSVGTSpanFrameBase::GetCharNumAtPosition(point);
|
||||
}
|
||||
|
@ -16,12 +16,15 @@
|
||||
|
||||
class nsIAtom;
|
||||
class nsIContent;
|
||||
class nsIDOMSVGPoint;
|
||||
class nsIFrame;
|
||||
class nsIPresShell;
|
||||
class nsStyleContext;
|
||||
class nsSVGGlyphFrame;
|
||||
|
||||
namespace mozilla {
|
||||
class DOMSVGPoint;
|
||||
}
|
||||
|
||||
typedef nsSVGTextContainerFrame nsSVGTSpanFrameBase;
|
||||
|
||||
class nsSVGTSpanFrame : public nsSVGTSpanFrameBase,
|
||||
@ -68,7 +71,7 @@ public:
|
||||
virtual uint32_t GetNumberOfChars();
|
||||
virtual float GetComputedTextLength() MOZ_OVERRIDE;
|
||||
virtual float GetSubStringLength(uint32_t charnum, uint32_t fragmentChars) MOZ_OVERRIDE;
|
||||
virtual int32_t GetCharNumAtPosition(nsIDOMSVGPoint *point) MOZ_OVERRIDE;
|
||||
virtual int32_t GetCharNumAtPosition(mozilla::DOMSVGPoint *point) MOZ_OVERRIDE;
|
||||
NS_IMETHOD_(nsSVGGlyphFrame *) GetFirstGlyphFrame() MOZ_OVERRIDE;
|
||||
NS_IMETHOD_(nsSVGGlyphFrame *) GetNextGlyphFrame() MOZ_OVERRIDE;
|
||||
NS_IMETHOD_(void) SetWhitespaceCompression(bool aCompressWhitespace) MOZ_OVERRIDE;
|
||||
|
@ -90,7 +90,7 @@ nsSVGTextContainerFrame::RemoveFrame(ChildListID aListID, nsIFrame *aOldFrame)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTextContainerFrame::GetStartPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_retval)
|
||||
nsSVGTextContainerFrame::GetStartPositionOfChar(uint32_t charnum, nsISupports **_retval)
|
||||
{
|
||||
*_retval = nullptr;
|
||||
|
||||
@ -113,7 +113,7 @@ nsSVGTextContainerFrame::GetStartPositionOfChar(uint32_t charnum, nsIDOMSVGPoint
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTextContainerFrame::GetEndPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_retval)
|
||||
nsSVGTextContainerFrame::GetEndPositionOfChar(uint32_t charnum, nsISupports **_retval)
|
||||
{
|
||||
*_retval = nullptr;
|
||||
|
||||
@ -232,7 +232,7 @@ nsSVGTextContainerFrame::GetSubStringLength(uint32_t charnum, uint32_t nchars)
|
||||
}
|
||||
|
||||
int32_t
|
||||
nsSVGTextContainerFrame::GetCharNumAtPosition(nsIDOMSVGPoint *point)
|
||||
nsSVGTextContainerFrame::GetCharNumAtPosition(DOMSVGPoint *point)
|
||||
{
|
||||
int32_t index = -1;
|
||||
int32_t offset = 0;
|
||||
|
@ -15,13 +15,16 @@
|
||||
#include "nsTArray.h"
|
||||
|
||||
class nsFrameList;
|
||||
class nsIDOMSVGPoint;
|
||||
class nsIDOMSVGRect;
|
||||
class nsISVGGlyphFragmentNode;
|
||||
class nsStyleContext;
|
||||
class nsSVGGlyphFrame;
|
||||
class nsSVGTextFrame;
|
||||
|
||||
namespace mozilla {
|
||||
class DOMSVGPoint;
|
||||
}
|
||||
|
||||
class nsSVGTextContainerFrame : public nsSVGDisplayContainerFrame
|
||||
{
|
||||
protected:
|
||||
@ -44,8 +47,8 @@ public:
|
||||
nsFrameList& aFrameList) MOZ_OVERRIDE;
|
||||
NS_IMETHOD RemoveFrame(ChildListID aListID, nsIFrame *aOldFrame) MOZ_OVERRIDE;
|
||||
|
||||
NS_IMETHOD GetStartPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_retval);
|
||||
NS_IMETHOD GetEndPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_retval);
|
||||
NS_IMETHOD GetStartPositionOfChar(uint32_t charnum, nsISupports **_retval);
|
||||
NS_IMETHOD GetEndPositionOfChar(uint32_t charnum, nsISupports **_retval);
|
||||
NS_IMETHOD GetExtentOfChar(uint32_t charnum, nsIDOMSVGRect **_retval);
|
||||
NS_IMETHOD GetRotationOfChar(uint32_t charnum, float *_retval);
|
||||
|
||||
@ -67,7 +70,7 @@ public:
|
||||
/*
|
||||
* Get the character at the specified position
|
||||
*/
|
||||
virtual int32_t GetCharNumAtPosition(nsIDOMSVGPoint *point);
|
||||
virtual int32_t GetCharNumAtPosition(mozilla::DOMSVGPoint *point);
|
||||
void GetEffectiveXY(nsTArray<float> &aX, nsTArray<float> &aY);
|
||||
void GetEffectiveDxDy(nsTArray<float> &aDx, nsTArray<float> &aDy);
|
||||
void GetEffectiveRotate(nsTArray<float> &aRotate);
|
||||
|
@ -114,7 +114,7 @@ nsSVGTextFrame::GetSubStringLength(uint32_t charnum, uint32_t nchars)
|
||||
}
|
||||
|
||||
int32_t
|
||||
nsSVGTextFrame::GetCharNumAtPosition(nsIDOMSVGPoint *point)
|
||||
nsSVGTextFrame::GetCharNumAtPosition(DOMSVGPoint *point)
|
||||
{
|
||||
UpdateGlyphPositioning(false);
|
||||
|
||||
@ -122,7 +122,7 @@ nsSVGTextFrame::GetCharNumAtPosition(nsIDOMSVGPoint *point)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTextFrame::GetStartPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_retval)
|
||||
nsSVGTextFrame::GetStartPositionOfChar(uint32_t charnum, nsISupports **_retval)
|
||||
{
|
||||
UpdateGlyphPositioning(false);
|
||||
|
||||
@ -130,7 +130,7 @@ nsSVGTextFrame::GetStartPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_retva
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSVGTextFrame::GetEndPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_retval)
|
||||
nsSVGTextFrame::GetEndPositionOfChar(uint32_t charnum, nsISupports **_retval)
|
||||
{
|
||||
UpdateGlyphPositioning(false);
|
||||
|
||||
|
@ -73,10 +73,10 @@ public:
|
||||
virtual uint32_t GetNumberOfChars();
|
||||
virtual float GetComputedTextLength();
|
||||
virtual float GetSubStringLength(uint32_t charnum, uint32_t nchars);
|
||||
virtual int32_t GetCharNumAtPosition(nsIDOMSVGPoint *point);
|
||||
virtual int32_t GetCharNumAtPosition(mozilla::DOMSVGPoint *point);
|
||||
|
||||
NS_IMETHOD GetStartPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_retval);
|
||||
NS_IMETHOD GetEndPositionOfChar(uint32_t charnum, nsIDOMSVGPoint **_retval);
|
||||
NS_IMETHOD GetStartPositionOfChar(uint32_t charnum, nsISupports **_retval);
|
||||
NS_IMETHOD GetEndPositionOfChar(uint32_t charnum, nsISupports **_retval);
|
||||
NS_IMETHOD GetExtentOfChar(uint32_t charnum, nsIDOMSVGRect **_retval);
|
||||
NS_IMETHOD GetRotationOfChar(uint32_t charnum, float *_retval);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user