+2011-08-03 Dan Bernstein <mitz@apple.com>
+
+ FontCache::getFontData() does not set the familyIndex to cAllFamiliesScanned if the last font is a custom font
+ https://bugs.webkit.org/show_bug.cgi?id=65597
+
+ Reviewed by Simon Fraser.
+
+ No test added because behavior is unchanged, but this saves a call to getFontData().
+
+ * platform/graphics/FontCache.cpp:
+ (WebCore::FontCache::getFontData): Eliminated early return inside the loop, allowing execution
+ to continue and familyIndex to be set.
+
2011-08-03 Ryosuke Niwa <rniwa@webkit.org>
Add RenderedPosition
const FontData* FontCache::getFontData(const Font& font, int& familyIndex, FontSelector* fontSelector)
{
- SimpleFontData* result = 0;
+ FontData* result = 0;
int startIndex = familyIndex;
const FontFamily* startFamily = &font.fontDescription().family();
while (currFamily && !result) {
familyIndex++;
if (currFamily->family().length()) {
- if (fontSelector) {
- FontData* data = fontSelector->getFontData(font.fontDescription(), currFamily->family());
- if (data)
- return data;
- }
- result = getCachedFontData(font.fontDescription(), currFamily->family());
+ if (fontSelector)
+ result = fontSelector->getFontData(font.fontDescription(), currFamily->family());
+
+ if (!result)
+ result = getCachedFontData(font.fontDescription(), currFamily->family());
}
currFamily = currFamily->next();
}