+2011-07-25 Dan Bernstein <mitz@apple.com>
+
+ Reverted r91699 due to
+ <http://webkit.org/b/65134> REGRESSION: r91699 broke some font tests (image+text)
+
+ Many tests relied on font loading occurring synchronously in the cached and local cases.
+
+ * css/CSSFontFaceSource.cpp:
+ (WebCore::CSSFontFaceSource::CSSFontFaceSource):
+ (WebCore::CSSFontFaceSource::~CSSFontFaceSource):
+ (WebCore::CSSFontFaceSource::getFontData):
+ * css/CSSFontFaceSource.h:
+
2011-06-07 Martin Robinson <mrobinson@igalia.com>
Reviewed by Gustavo Noronha Silva.
: m_string(str)
, m_font(font)
, m_face(0)
- , m_startLoadingTimer(this, &CSSFontFaceSource::startLoadingTimerFired)
#if ENABLE(SVG_FONTS)
, m_hasExternalSVGFont(false)
#endif
CSSFontFaceSource::~CSSFontFaceSource()
{
- m_startLoadingTimer.stop();
if (m_font)
m_font->removeClient(this);
pruneTable();
#endif
}
} else {
- // Kick off the load now. Do it on a zero-delay timer rather than synchronously, because we may be in
- // the middle of layout, and the loader may invoke aribtrary delegate or event handler code.
- m_fontSelector = fontSelector;
- if (!m_startLoadingTimer.isActive())
- m_startLoadingTimer.startOneShot(0);
-
+ // Kick off the load now.
+ if (CachedResourceLoader* cachedResourceLoader = fontSelector->cachedResourceLoader())
+ m_font->beginLoadIfNeeded(cachedResourceLoader);
// FIXME: m_string is a URL so it makes no sense to pass it as a family name.
SimpleFontData* tempData = fontCache()->getCachedFontData(fontDescription, m_string);
if (!tempData)
return fontDataRawPtr;
}
-void CSSFontFaceSource::startLoadingTimerFired(Timer<WebCore::CSSFontFaceSource>*)
-{
- ASSERT(m_font);
- ASSERT(m_fontSelector);
-
- if (CachedResourceLoader* cachedResourceLoader = m_fontSelector->cachedResourceLoader())
- m_font->beginLoadIfNeeded(cachedResourceLoader);
-
- m_fontSelector = nullptr;
-}
-
#if ENABLE(SVG_FONTS)
SVGFontFaceElement* CSSFontFaceSource::svgFontFaceElement() const
{
#include "CachedResourceClient.h"
#include "CachedResourceHandle.h"
-#include "Timer.h"
#include <wtf/HashMap.h>
#include <wtf/text/AtomicString.h>
#endif
private:
- void startLoadingTimerFired(Timer<CSSFontFaceSource>*);
-
AtomicString m_string; // URI for remote, built-in font name for local.
CachedResourceHandle<CachedFont> m_font; // For remote fonts, a pointer to our cached resource.
CSSFontFace* m_face; // Our owning font face.
HashMap<unsigned, SimpleFontData*> m_fontDataTable; // The hash key is composed of size synthetic styles.
- Timer<CSSFontFaceSource> m_startLoadingTimer;
- RefPtr<CSSFontSelector> m_fontSelector;
-
#if ENABLE(SVG_FONTS)
RefPtr<SVGFontFaceElement> m_svgFontFaceElement;
RefPtr<SVGFontElement> m_externalSVGFontElement;