Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1057)

Unified Diff: Source/core/svg/SVGTextContentElement.cpp

Issue 1321783002: Throw exceptions for charnum == getNumberOfChars in get{...}OfChar APIs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/svg/text/svgtextcontentelement-methods-parameters-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGTextContentElement.cpp
diff --git a/Source/core/svg/SVGTextContentElement.cpp b/Source/core/svg/SVGTextContentElement.cpp
index fb4420a70db01a1d478b87f52c0a0ede5b56abfe..5f672c54cfe170284e0ee0c9bc86ca0b321a74ee 100644
--- a/Source/core/svg/SVGTextContentElement.cpp
+++ b/Source/core/svg/SVGTextContentElement.cpp
@@ -121,7 +121,7 @@ PassRefPtrWillBeRawPtr<SVGPointTearOff> SVGTextContentElement::getStartPositionO
{
document().updateLayoutIgnorePendingStylesheets();
- if (charnum > getNumberOfChars()) {
+ if (charnum >= getNumberOfChars()) {
exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::indexExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
return nullptr;
}
@@ -134,7 +134,7 @@ PassRefPtrWillBeRawPtr<SVGPointTearOff> SVGTextContentElement::getEndPositionOfC
{
document().updateLayoutIgnorePendingStylesheets();
- if (charnum > getNumberOfChars()) {
+ if (charnum >= getNumberOfChars()) {
exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::indexExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
return nullptr;
}
@@ -147,7 +147,7 @@ PassRefPtrWillBeRawPtr<SVGRectTearOff> SVGTextContentElement::getExtentOfChar(un
{
document().updateLayoutIgnorePendingStylesheets();
- if (charnum > getNumberOfChars()) {
+ if (charnum >= getNumberOfChars()) {
exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::indexExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
return nullptr;
}
@@ -160,7 +160,7 @@ float SVGTextContentElement::getRotationOfChar(unsigned charnum, ExceptionState&
{
document().updateLayoutIgnorePendingStylesheets();
- if (charnum > getNumberOfChars()) {
+ if (charnum >= getNumberOfChars()) {
exceptionState.throwDOMException(IndexSizeError, ExceptionMessages::indexExceedsMaximumBound("charnum", charnum, getNumberOfChars()));
return 0.0f;
}
« no previous file with comments | « LayoutTests/svg/text/svgtextcontentelement-methods-parameters-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698