diff --git a/content/svg/content/src/nsSVGTextContentElement.cpp b/content/svg/content/src/nsSVGTextContentElement.cpp index bfc10b2cac60..b808fdc7003b 100644 --- a/content/svg/content/src/nsSVGTextContentElement.cpp +++ b/content/svg/content/src/nsSVGTextContentElement.cpp @@ -37,6 +37,9 @@ * ***** END LICENSE BLOCK ***** */ #include "nsSVGTextContentElement.h" +#include "DOMSVGPoint.h" + +using namespace mozilla; /* readonly attribute nsIDOMSVGAnimatedLength textLength; */ NS_IMETHODIMP nsSVGTextContentElement::GetTextLength(nsIDOMSVGAnimatedLength * *aTextLength) @@ -143,8 +146,8 @@ NS_IMETHODIMP nsSVGTextContentElement::GetRotationOfChar(PRUint32 charnum, float /* 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 p = do_QueryInterface(point); + if (!p) return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR; *_retval = -1; diff --git a/content/svg/content/src/nsSVGTextElement.cpp b/content/svg/content/src/nsSVGTextElement.cpp index 0b4b4e4a35a3..bd4eff0f7938 100644 --- a/content/svg/content/src/nsSVGTextElement.cpp +++ b/content/svg/content/src/nsSVGTextElement.cpp @@ -50,6 +50,7 @@ #include "SVGNumberList.h" #include "SVGAnimatedNumberList.h" #include "DOMSVGAnimatedNumberList.h" +#include "DOMSVGPoint.h" using namespace mozilla; @@ -323,7 +324,8 @@ nsSVGTextElement::GetRotationOfChar(PRUint32 charnum, float *_retval) NS_IMETHODIMP nsSVGTextElement::GetCharNumAtPosition(nsIDOMSVGPoint *point, PRInt32 *_retval) { - if (!point) + nsCOMPtr p = do_QueryInterface(point); + if (!p) return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR; *_retval = -1;