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

Unified Diff: Source/WebCore/css/CSSSegmentedFontFace.cpp

Issue 8273018: Merge 97402 - Source/WebCore: Register custom fonts at their creation time, rather than at retire... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 2 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 | « Source/WebCore/css/CSSFontSelector.cpp ('k') | Source/WebCore/dom/Document.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « Source/WebCore/css/CSSFontSelector.cpp ('k') | Source/WebCore/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698