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

Unified Diff: third_party/WebKit/Source/platform/fonts/Font.cpp

Issue 2020863002: Guard against invalid glyph shaping results (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reviewer comments Created 4 years, 7 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: third_party/WebKit/Source/platform/fonts/Font.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/Font.cpp b/third_party/WebKit/Source/platform/fonts/Font.cpp
index c268653f2c66b24c22610714271bdc0a76dd3aa1..4406868fcb70ccc8d448d2e808431ff4cb110ca9 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.cpp
+++ b/third_party/WebKit/Source/platform/fonts/Font.cpp
@@ -767,7 +767,9 @@ Vector<CharacterRange> Font::individualCharacterRanges(const TextRun& run) const
// will be improved shaping in SVG when compared to HTML.
FontCachePurgePreventer purgePreventer;
CachingWordShaper shaper(m_fontFallbackList->shapeCache(m_fontDescription));
- return shaper.individualCharacterRanges(this, run);
+ auto ranges = shaper.individualCharacterRanges(this, run);
+ DCHECK_EQ(ranges.size(), static_cast<unsigned>(run.length()));
+ return ranges;
}
float Font::floatWidthForSimpleText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, FloatRect* glyphBounds) const

Powered by Google App Engine
This is Rietveld 408576698