FontCache::getFontData() does not set the familyIndex to cAllFamiliesScanned if the...
[WebKit-https.git] / Source / WebCore / platform / graphics / FontCache.cpp
index f1ec9ef31c5546d02c2736b2df1fc0b7e13b3609..1c59cb7ddbd6f482adac5a3ff9596a60e68eef30 100644 (file)
@@ -394,7 +394,7 @@ size_t FontCache::inactiveFontDataCount()
 
 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();
@@ -404,12 +404,11 @@ const FontData* FontCache::getFontData(const Font& font, int& familyIndex, FontS
     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();
     }