Index: Source/WebCore/css/CSSSegmentedFontFace.cpp |
=================================================================== |
--- Source/WebCore/css/CSSSegmentedFontFace.cpp (revision 97402) |
+++ Source/WebCore/css/CSSSegmentedFontFace.cpp (working copy) |
@@ -28,6 +28,7 @@ |
#include "CSSFontFace.h" |
#include "CSSFontSelector.h" |
+#include "Document.h" |
#include "FontDescription.h" |
#include "SegmentedFontData.h" |
#include "SimpleFontData.h" |
@@ -53,10 +54,6 @@ |
if (m_fontDataTable.isEmpty()) |
return; |
- HashMap<unsigned, SegmentedFontData*>::iterator end = m_fontDataTable.end(); |
- for (HashMap<unsigned, SegmentedFontData*>::iterator it = m_fontDataTable.begin(); it != end; ++it) |
- m_fontSelector->retireCustomFont(it->second); |
- |
m_fontDataTable.clear(); |
} |
@@ -116,9 +113,12 @@ |
} |
} |
} |
- if (fontData->numRanges()) |
+ if (fontData->numRanges()) { |
m_fontDataTable.set(hashKey, fontData); |
- else { |
+ ASSERT(m_fontSelector->document()); |
+ if (Document* doc = m_fontSelector->document()) |
+ doc->registerCustomFont(fontData); |
+ } else { |
delete fontData; |
fontData = 0; |
} |