Title: [91710] trunk/Source/WebCore
Revision
91710
Author
m...@apple.com
Date
2011-07-25 15:23:50 -0700 (Mon, 25 Jul 2011)

Log Message

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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (91709 => 91710)


--- trunk/Source/WebCore/ChangeLog	2011-07-25 22:23:05 UTC (rev 91709)
+++ trunk/Source/WebCore/ChangeLog	2011-07-25 22:23:50 UTC (rev 91710)
@@ -1,3 +1,16 @@
+2011-07-25  Dan Bernstein  <m...@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  <mrobin...@igalia.com>
 
         Reviewed by Gustavo Noronha Silva.

Modified: trunk/Source/WebCore/css/CSSFontFaceSource.cpp (91709 => 91710)


--- trunk/Source/WebCore/css/CSSFontFaceSource.cpp	2011-07-25 22:23:05 UTC (rev 91709)
+++ trunk/Source/WebCore/css/CSSFontFaceSource.cpp	2011-07-25 22:23:50 UTC (rev 91710)
@@ -50,7 +50,6 @@
     : m_string(str)
     , m_font(font)
     , m_face(0)
-    , m_startLoadingTimer(this, &CSSFontFaceSource::startLoadingTimerFired)
 #if ENABLE(SVG_FONTS)
     , m_hasExternalSVGFont(false)
 #endif
@@ -61,7 +60,6 @@
 
 CSSFontFaceSource::~CSSFontFaceSource()
 {
-    m_startLoadingTimer.stop();
     if (m_font)
         m_font->removeClient(this);
     pruneTable();
@@ -174,12 +172,9 @@
 #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)
@@ -194,17 +189,6 @@
     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
 {

Modified: trunk/Source/WebCore/css/CSSFontFaceSource.h (91709 => 91710)


--- trunk/Source/WebCore/css/CSSFontFaceSource.h	2011-07-25 22:23:05 UTC (rev 91709)
+++ trunk/Source/WebCore/css/CSSFontFaceSource.h	2011-07-25 22:23:50 UTC (rev 91710)
@@ -28,7 +28,6 @@
 
 #include "CachedResourceClient.h"
 #include "CachedResourceHandle.h"
-#include "Timer.h"
 #include <wtf/HashMap.h>
 #include <wtf/text/AtomicString.h>
 
@@ -71,16 +70,11 @@
 #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;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to