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

Unified Diff: third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp

Issue 1816453002: Add workaround for invalid non-bmp character measurements in SVG (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « third_party/WebKit/LayoutTests/svg/text/invalid-non-bmp-characters.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp b/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp
index caabcbf1dfb00edb44535cf4e28a59edd3427c5d..1da27a460e421a1b887bbb2f80b4fb79477a185c 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp
@@ -162,6 +162,12 @@ unsigned SVGTextMetricsCalculator::updateSubrunRangesForCurrentPosition()
}
}
+ // TODO(pdr): m_subrunRanges can be too short in the presence of invalid
+ // unicode characters (see: crbug.com/595960). This is a temporary
+ // workaround to ensure the returned index is valid for m_subrunRages.
+ if (positionInRun >= m_subrunRanges.size())
+ return 0;
+
return positionInRun;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/text/invalid-non-bmp-characters.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698