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

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

Issue 1806263005: Do not crash when measuring empty SVG text nodes (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/empty-text-node-crash.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..6ada588e34942adb96f8735ea4f6cfe00a5d1426 100644
--- a/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/SVGTextMetricsBuilder.cpp
@@ -199,6 +199,9 @@ static void measureTextLayoutObject(LayoutSVGInlineText* text, MeasureTextData*
textMetricsValues->clear();
}
+ if (!text->textLength())
+ return;
+
// TODO(pdr): This loop is too tightly coupled to SVGTextMetricsCalculator.
// We should refactor SVGTextMetricsCalculator to be a simple bidi run
// iterator and move all subrun logic to a single function.
« no previous file with comments | « third_party/WebKit/LayoutTests/svg/text/empty-text-node-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698