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

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

Issue 22798002: Make SVGTextContentElement methods behave consistently with Firefox and IE (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix nits Created 7 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
Index: Source/core/svg/SVGTextContentElement.cpp
diff --git a/Source/core/svg/SVGTextContentElement.cpp b/Source/core/svg/SVGTextContentElement.cpp
index 532b74b7f23ce518915280da0781107afcd1302b..48c806af588f9d6e7c80f581da57f089d7da1f5f 100644
--- a/Source/core/svg/SVGTextContentElement.cpp
+++ b/Source/core/svg/SVGTextContentElement.cpp
@@ -123,6 +123,9 @@ float SVGTextContentElement::getSubStringLength(unsigned charnum, unsigned nchar
return 0.0f;
}
+ if (nchars > numberOfChars - charnum)
+ nchars = numberOfChars - charnum;
+
return SVGTextQuery(renderer()).subStringLength(charnum, nchars);
}
« no previous file with comments | « LayoutTests/svg/text/svgtextcontentelement-methods-parameters-expected.txt ('k') | Source/core/svg/SVGTextContentElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698