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

Unified Diff: Source/core/css/FontFace.cpp

Issue 184633005: [CSS Font Loading] Remove FontFace#ready, fold its functionality into FontFace#load (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 9 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/core/css/FontFace.h ('k') | Source/core/css/FontFace.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/FontFace.cpp
diff --git a/Source/core/css/FontFace.cpp b/Source/core/css/FontFace.cpp
index 34d2095d7abf4a27bb9e9667fb5480450392a70c..4a604d50f318710b8eaa28d8f5d844d15764c17f 100644
--- a/Source/core/css/FontFace.cpp
+++ b/Source/core/css/FontFace.cpp
@@ -382,23 +382,7 @@ void FontFace::setLoadStatus(LoadStatus status)
resolveReadyPromises();
}
-void FontFace::load(ExecutionContext* context)
-{
- if (m_status != Unloaded)
- return;
-
- FontDescription fontDescription;
- FontFamily fontFamily;
- fontFamily.setFamily(m_family);
- fontDescription.setFamily(fontFamily);
- fontDescription.setTraits(traits());
-
- CSSFontSelector* fontSelector = toDocument(context)->styleEngine()->fontSelector();
- m_cssFontFace->load(fontDescription, fontSelector);
- fontSelector->loadPendingFonts();
-}
-
-ScriptPromise FontFace::ready(ExecutionContext* context)
+ScriptPromise FontFace::load(ExecutionContext* context)
{
OwnPtr<FontFaceReadyPromiseResolver> resolver = FontFaceReadyPromiseResolver::create(context);
ScriptPromise promise = resolver->promise();
@@ -406,6 +390,18 @@ ScriptPromise FontFace::ready(ExecutionContext* context)
resolver->resolve(this);
else
m_readyResolvers.append(resolver.release());
+
+ if (m_status == Unloaded) {
+ FontDescription fontDescription;
+ FontFamily fontFamily;
+ fontFamily.setFamily(m_family);
+ fontDescription.setFamily(fontFamily);
+ fontDescription.setTraits(traits());
+
+ CSSFontSelector* fontSelector = toDocument(context)->styleEngine()->fontSelector();
+ m_cssFontFace->load(fontDescription, fontSelector);
+ fontSelector->loadPendingFonts();
+ }
return promise;
}
« no previous file with comments | « Source/core/css/FontFace.h ('k') | Source/core/css/FontFace.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698