Loading content/svg/content/src/nsSVGDataParser.cpp +0 −30 Original line number Diff line number Diff line Loading @@ -98,36 +98,6 @@ void nsSVGDataParser::RewindTo(const char* aPos) //---------------------------------------------------------------------- nsresult nsSVGDataParser::MatchNonNegativeNumber(float* aX) { // XXX inefficient implementation. We probably hit the RewindTo case // often. const char* pos = mTokenPos; nsresult rv = MatchFloatingPointConst(); if (NS_FAILED(rv)) { RewindTo(pos); ENSURE_MATCHED(MatchIntegerConst()); } char* end; *aX = float(PR_strtod(pos, &end)); if (pos != end && NS_finite(*aX)) { return NS_OK; } return NS_ERROR_FAILURE; } bool nsSVGDataParser::IsTokenNonNegativeNumberStarter() { return (mTokenType == DIGIT || mTokenType == POINT); } //---------------------------------------------------------------------- nsresult nsSVGDataParser::MatchNumber(float* aX) { const char* pos = mTokenPos; Loading content/svg/content/src/nsSVGDataParser.h +0 −3 Original line number Diff line number Diff line Loading @@ -34,9 +34,6 @@ protected: void RewindTo(const char* aPos); virtual nsresult Match()=0; nsresult MatchNonNegativeNumber(float* aX); bool IsTokenNonNegativeNumberStarter(); nsresult MatchNumber(float* x); bool IsTokenNumberStarter(); Loading content/svg/content/src/nsSVGPathDataParser.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -789,13 +789,13 @@ nsresult nsSVGPathDataParser::MatchEllipticalArcArg(float* x, float* y, float* r1, float* r2, float* angle, bool* largeArcFlag, bool* sweepFlag) { ENSURE_MATCHED(MatchNonNegativeNumber(r1)); ENSURE_MATCHED(MatchNumber(r1)); if (IsTokenCommaWspStarter()) { ENSURE_MATCHED(MatchCommaWsp()); } ENSURE_MATCHED(MatchNonNegativeNumber(r2)); ENSURE_MATCHED(MatchNumber(r2)); if (IsTokenCommaWspStarter()) { ENSURE_MATCHED(MatchCommaWsp()); Loading Loading @@ -827,7 +827,7 @@ nsresult nsSVGPathDataParser::MatchEllipticalArcArg(float* x, float* y, bool nsSVGPathDataParser::IsTokenEllipticalArcArgStarter() { return IsTokenNonNegativeNumberStarter(); return IsTokenNumberStarter(); } Loading layout/reftests/svg/path-07-ref.svg 0 → 100644 +17 −0 Original line number Diff line number Diff line <!-- Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> <svg xmlns="http://www.w3.org/2000/svg"> <title>Reference for negative radius path arc handling</title> <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=729139 --> <!-- Check that a negative arc radius is treated as positive. --> <path d="M 150,0 a 150,150 0 0,1 106.066,256.066 l -35.355,-35.355 a 100,100 0 0,0 -70.711,-170.711 z" fill="#3d7fe6" shape-rendering="crispEdges"/> </svg> layout/reftests/svg/path-07.svg 0 → 100644 +17 −0 Original line number Diff line number Diff line <!-- Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> <svg xmlns="http://www.w3.org/2000/svg"> <title>Testcase for negative radius path arc handling</title> <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=729139 --> <!-- Check that a negative arc radius is treated as positive. --> <path d="M 150,0 a 150,150 0 0,1 106.066,256.066 l -35.355,-35.355 a -100,-100 0 0,0 -70.711,-170.711 z" fill="#3d7fe6" shape-rendering="crispEdges"/> </svg> Loading
content/svg/content/src/nsSVGDataParser.cpp +0 −30 Original line number Diff line number Diff line Loading @@ -98,36 +98,6 @@ void nsSVGDataParser::RewindTo(const char* aPos) //---------------------------------------------------------------------- nsresult nsSVGDataParser::MatchNonNegativeNumber(float* aX) { // XXX inefficient implementation. We probably hit the RewindTo case // often. const char* pos = mTokenPos; nsresult rv = MatchFloatingPointConst(); if (NS_FAILED(rv)) { RewindTo(pos); ENSURE_MATCHED(MatchIntegerConst()); } char* end; *aX = float(PR_strtod(pos, &end)); if (pos != end && NS_finite(*aX)) { return NS_OK; } return NS_ERROR_FAILURE; } bool nsSVGDataParser::IsTokenNonNegativeNumberStarter() { return (mTokenType == DIGIT || mTokenType == POINT); } //---------------------------------------------------------------------- nsresult nsSVGDataParser::MatchNumber(float* aX) { const char* pos = mTokenPos; Loading
content/svg/content/src/nsSVGDataParser.h +0 −3 Original line number Diff line number Diff line Loading @@ -34,9 +34,6 @@ protected: void RewindTo(const char* aPos); virtual nsresult Match()=0; nsresult MatchNonNegativeNumber(float* aX); bool IsTokenNonNegativeNumberStarter(); nsresult MatchNumber(float* x); bool IsTokenNumberStarter(); Loading
content/svg/content/src/nsSVGPathDataParser.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -789,13 +789,13 @@ nsresult nsSVGPathDataParser::MatchEllipticalArcArg(float* x, float* y, float* r1, float* r2, float* angle, bool* largeArcFlag, bool* sweepFlag) { ENSURE_MATCHED(MatchNonNegativeNumber(r1)); ENSURE_MATCHED(MatchNumber(r1)); if (IsTokenCommaWspStarter()) { ENSURE_MATCHED(MatchCommaWsp()); } ENSURE_MATCHED(MatchNonNegativeNumber(r2)); ENSURE_MATCHED(MatchNumber(r2)); if (IsTokenCommaWspStarter()) { ENSURE_MATCHED(MatchCommaWsp()); Loading Loading @@ -827,7 +827,7 @@ nsresult nsSVGPathDataParser::MatchEllipticalArcArg(float* x, float* y, bool nsSVGPathDataParser::IsTokenEllipticalArcArgStarter() { return IsTokenNonNegativeNumberStarter(); return IsTokenNumberStarter(); } Loading
layout/reftests/svg/path-07-ref.svg 0 → 100644 +17 −0 Original line number Diff line number Diff line <!-- Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> <svg xmlns="http://www.w3.org/2000/svg"> <title>Reference for negative radius path arc handling</title> <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=729139 --> <!-- Check that a negative arc radius is treated as positive. --> <path d="M 150,0 a 150,150 0 0,1 106.066,256.066 l -35.355,-35.355 a 100,100 0 0,0 -70.711,-170.711 z" fill="#3d7fe6" shape-rendering="crispEdges"/> </svg>
layout/reftests/svg/path-07.svg 0 → 100644 +17 −0 Original line number Diff line number Diff line <!-- Any copyright is dedicated to the Public Domain. http://creativecommons.org/publicdomain/zero/1.0/ --> <svg xmlns="http://www.w3.org/2000/svg"> <title>Testcase for negative radius path arc handling</title> <!-- From https://bugzilla.mozilla.org/show_bug.cgi?id=729139 --> <!-- Check that a negative arc radius is treated as positive. --> <path d="M 150,0 a 150,150 0 0,1 106.066,256.066 l -35.355,-35.355 a -100,-100 0 0,0 -70.711,-170.711 z" fill="#3d7fe6" shape-rendering="crispEdges"/> </svg>