Bug 664708 - GetCharNumAtPosition should only accept native points. r=longsonr.

This commit is contained in:
Jonathan Watt 2011-06-16 14:47:04 +01:00
parent d7d0fe1369
commit 8980cf02fc
2 changed files with 8 additions and 3 deletions

View File

@ -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<DOMSVGPoint> p = do_QueryInterface(point);
if (!p)
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
*_retval = -1;

View File

@ -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<DOMSVGPoint> p = do_QueryInterface(point);
if (!p)
return NS_ERROR_DOM_SVG_WRONG_TYPE_ERR;
*_retval = -1;