--- a/content/svg/content/src/nsSVGTextContentElement.cpp
+++ b/content/svg/content/src/nsSVGTextContentElement.cpp
@@ -32,16 +32,19 @@
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsSVGTextContentElement.h"
+#include "DOMSVGPoint.h"
+
+using namespace mozilla;
/* readonly attribute nsIDOMSVGAnimatedLength textLength; */
NS_IMETHODIMP nsSVGTextContentElement::GetTextLength(nsIDOMSVGAnimatedLength * *aTextLength)
{
NS_NOTYETIMPLEMENTED("nsSVGTextContentElement::GetTextLength");
return NS_ERROR_NOT_IMPLEMENTED;
}
@@ -138,18 +141,18 @@ NS_IMETHODIMP nsSVGTextContentElement::G
if (!metrics) return NS_ERROR_FAILURE;
return metrics->GetRotationOfChar(charnum, _retval);
}
/* long getCharNumAtPosition (in nsIDOMSVGPoint point); */
NS_IMETHODIMP nsSVGTextContentElement::GetCharNumAtPosition(nsIDOMSVGPoint *point, PRInt32 *_retval)
{
- // null check when implementing - this method can be used by scripts!
- if (!point)
+ nsCOMPtr<DOMSVGPoint> p = do_QueryInterface(point);
+ if (!p)
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
*_retval = -1;
nsSVGTextContainerFrame* metrics = GetTextContainerFrame();
if (metrics)
*_retval = metrics->GetCharNumAtPosition(point);
--- a/content/svg/content/src/nsSVGTextElement.cpp
+++ b/content/svg/content/src/nsSVGTextElement.cpp
@@ -45,16 +45,17 @@
#include "nsIFrame.h"
#include "nsDOMError.h"
#include "SVGAnimatedLengthList.h"
#include "DOMSVGAnimatedLengthList.h"
#include "SVGLengthList.h"
#include "SVGNumberList.h"
#include "SVGAnimatedNumberList.h"
#include "DOMSVGAnimatedNumberList.h"
+#include "DOMSVGPoint.h"
using namespace mozilla;
typedef nsSVGGraphicElement nsSVGTextElementBase;
/**
* This class does not inherit nsSVGTextPositioningElement - it reimplements it
* instead.
@@ -318,17 +319,18 @@ nsSVGTextElement::GetRotationOfChar(PRUi
return metrics->GetRotationOfChar(charnum, _retval);
}
/* long getCharNumAtPosition (in nsIDOMSVGPoint point); */
NS_IMETHODIMP
nsSVGTextElement::GetCharNumAtPosition(nsIDOMSVGPoint *point, PRInt32 *_retval)
{
- if (!point)
+ nsCOMPtr<DOMSVGPoint> p = do_QueryInterface(point);
+ if (!p)
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
*_retval = -1;
nsSVGTextContainerFrame* metrics = GetTextContainerFrame();
if (metrics)
*_retval = metrics->GetCharNumAtPosition(point);