Chromium Code Reviews| Index: Source/core/svg/SVGTextContentElement.cpp |
| diff --git a/Source/core/svg/SVGTextContentElement.cpp b/Source/core/svg/SVGTextContentElement.cpp |
| index 620345e4b5a679e018110c1028bc20210b19d65b..631eeee43381d52b71ead33760c599838ec0dac4 100644 |
| --- a/Source/core/svg/SVGTextContentElement.cpp |
| +++ b/Source/core/svg/SVGTextContentElement.cpp |
| @@ -110,28 +110,30 @@ float SVGTextContentElement::getSubStringLength(unsigned charnum, unsigned nchar |
| return SVGTextQuery(renderer()).subStringLength(charnum, nchars); |
| } |
| -SVGPoint SVGTextContentElement::getStartPositionOfChar(unsigned charnum, ExceptionState& exceptionState) |
| +PassRefPtr<SVGPointTearOff> SVGTextContentElement::getStartPositionOfChar(unsigned charnum, ExceptionState& exceptionState) |
| { |
| document().updateLayoutIgnorePendingStylesheets(); |
| if (charnum > getNumberOfChars()) { |
| exceptionState.throwUninformativeAndGenericDOMException(IndexSizeError); |
| - return FloatPoint(); |
| + return 0; |
| } |
| - return SVGTextQuery(renderer()).startPositionOfCharacter(charnum); |
| + FloatPoint point = SVGTextQuery(renderer()).startPositionOfCharacter(charnum); |
| + return SVGPointTearOff::create(SVGPoint::create(point), 0, PropertyIsNotAnimVal); |
| } |
| -SVGPoint SVGTextContentElement::getEndPositionOfChar(unsigned charnum, ExceptionState& exceptionState) |
| +PassRefPtr<SVGPointTearOff> SVGTextContentElement::getEndPositionOfChar(unsigned charnum, ExceptionState& exceptionState) |
| { |
| document().updateLayoutIgnorePendingStylesheets(); |
| if (charnum > getNumberOfChars()) { |
| exceptionState.throwUninformativeAndGenericDOMException(IndexSizeError); |
| - return FloatPoint(); |
| + return 0; |
| } |
| - return SVGTextQuery(renderer()).endPositionOfCharacter(charnum); |
| + FloatPoint point = SVGTextQuery(renderer()).endPositionOfCharacter(charnum); |
| + return SVGPointTearOff::create(SVGPoint::create(point), 0, PropertyIsNotAnimVal); |
| } |
| PassRefPtr<SVGRectTearOff> SVGTextContentElement::getExtentOfChar(unsigned charnum, ExceptionState& exceptionState) |
| @@ -159,10 +161,16 @@ float SVGTextContentElement::getRotationOfChar(unsigned charnum, ExceptionState& |
| return SVGTextQuery(renderer()).rotationOfCharacter(charnum); |
| } |
| -int SVGTextContentElement::getCharNumAtPosition(const SVGPoint& point) |
| +int SVGTextContentElement::getCharNumAtPosition(PassRefPtr<SVGPointTearOff> point, ExceptionState& exceptionState) |
| { |
| + // FIXME |
|
haraken
2014/01/17 11:50:18
Add some description.
kouhei (in TOK)
2014/01/20 01:10:26
Removed. This was a temporary fix needed before nb
|
| + if (!point) { |
| + exceptionState.throwTypeError("The argument can't be null."); |
| + return 0; |
| + } |
| + |
| document().updateLayoutIgnorePendingStylesheets(); |
| - return SVGTextQuery(renderer()).characterNumberAtPosition(point); |
| + return SVGTextQuery(renderer()).characterNumberAtPosition(point->target()->value()); |
| } |
| void SVGTextContentElement::selectSubString(unsigned charnum, unsigned nchars, ExceptionState& exceptionState) |