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

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

Issue 196383035: Fix promise resolution of FontFaceSet#load() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
Index: Source/core/css/CSSSegmentedFontFace.cpp
diff --git a/Source/core/css/CSSSegmentedFontFace.cpp b/Source/core/css/CSSSegmentedFontFace.cpp
index 6f1ad972a15b9328a8b359986306bc6ce1934c5b..bf92509586bc0cf842353ff722b5e63361bfd0f7 100644
--- a/Source/core/css/CSSSegmentedFontFace.cpp
+++ b/Source/core/css/CSSSegmentedFontFace.cpp
@@ -72,17 +72,6 @@ bool CSSSegmentedFontFace::isValid() const
void CSSSegmentedFontFace::fontLoaded(CSSFontFace*)
{
pruneTable();
-
- if (RuntimeEnabledFeatures::fontLoadEventsEnabled() && !isLoading()) {
- Vector<RefPtr<LoadFontCallback> > callbacks;
- m_callbacks.swap(callbacks);
- for (size_t index = 0; index < callbacks.size(); ++index) {
- if (isLoaded())
- callbacks[index]->notifyLoaded(this);
- else
- callbacks[index]->notifyError(this);
- }
- }
}
void CSSSegmentedFontFace::fontLoadWaitLimitExceeded(CSSFontFace*)
@@ -208,20 +197,11 @@ bool CSSSegmentedFontFace::checkFont(const String& text) const
return true;
}
-void CSSSegmentedFontFace::loadFont(const FontDescription& fontDescription, const String& text, PassRefPtr<LoadFontCallback> callback)
+void CSSSegmentedFontFace::match(const String& text, Vector<RefPtr<FontFace> >& faces) const
{
- for (FontFaceList::iterator it = m_fontFaces.begin(); it != m_fontFaces.end(); ++it) {
- if ((*it)->loadStatus() == FontFace::Unloaded && (*it)->cssFontFace()->ranges().intersectsWith(text))
- (*it)->cssFontFace()->load(fontDescription);
- }
-
- if (callback) {
- if (isLoading())
- m_callbacks.append(callback);
- else if (isLoaded())
- callback->notifyLoaded(this);
- else
- callback->notifyError(this);
+ for (FontFaceList::const_iterator it = m_fontFaces.begin(); it != m_fontFaces.end(); ++it) {
+ if ((*it)->cssFontFace()->ranges().intersectsWith(text))
+ faces.append(*it);
}
}

Powered by Google App Engine
This is Rietveld 408576698