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

Unified Diff: Source/platform/fonts/FontFallbackList.cpp

Issue 271633002: Unloaded font segment should not affect primaryFontData (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
« no previous file with comments | « LayoutTests/svg/custom/svg-fonts-unloaded-segment-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/FontFallbackList.cpp
diff --git a/Source/platform/fonts/FontFallbackList.cpp b/Source/platform/fonts/FontFallbackList.cpp
index 8521ea3495e28fe4ba2be010410ebf97aba847a6..4b9a21047f7f66a705e7e7a8b573589a9b8e7e0b 100644
--- a/Source/platform/fonts/FontFallbackList.cpp
+++ b/Source/platform/fonts/FontFallbackList.cpp
@@ -135,17 +135,18 @@ const FontData* FontFallbackList::primaryFontData(const FontDescription& fontDes
if (fontData->isSegmented() && !toSegmentedFontData(fontData)->containsCharacter(' '))
continue;
+ const SimpleFontData* simpleFontData = fontData->fontDataForCharacter(' ');
+ ASSERT(simpleFontData);
+
// When a custom font is loading, we should use the correct fallback font to layout the text.
// Here skip the temporary font for the loading custom font which may not act as the correct fallback font.
- if (!fontData->isLoadingFallback())
+ if (!simpleFontData->isLoadingFallback())
return fontData;
// Begin to load the first custom font if needed.
if (shouldLoadCustomFont) {
shouldLoadCustomFont = false;
- const SimpleFontData* simpleFontData = fontData->fontDataForCharacter(' ');
- if (simpleFontData && simpleFontData->customFontData())
- simpleFontData->customFontData()->beginLoadIfNeeded();
+ simpleFontData->customFontData()->beginLoadIfNeeded();
}
}
}
« no previous file with comments | « LayoutTests/svg/custom/svg-fonts-unloaded-segment-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698