Index: third_party/WebKit/Source/core/css/FontFaceSet.cpp |
diff --git a/third_party/WebKit/Source/core/css/FontFaceSet.cpp b/third_party/WebKit/Source/core/css/FontFaceSet.cpp |
index 15ebb25b55d1c3a5ea6755da43426cca780bac0d..9ee2600e11bf99cfa07d24b07de954b7266bf0bd 100644 |
--- a/third_party/WebKit/Source/core/css/FontFaceSet.cpp |
+++ b/third_party/WebKit/Source/core/css/FontFaceSet.cpp |
@@ -58,7 +58,7 @@ class LoadFontPromiseResolver final |
return new LoadFontPromiseResolver(faces, scriptState); |
} |
- void loadFonts(); |
+ void loadFonts(Document*); |
ScriptPromise promise() { return m_resolver->promise(); } |
void notifyLoaded(FontFace*) override; |
@@ -80,14 +80,14 @@ class LoadFontPromiseResolver final |
Member<ScriptPromiseResolver> m_resolver; |
}; |
-void LoadFontPromiseResolver::loadFonts() { |
+void LoadFontPromiseResolver::loadFonts(Document* document) { |
if (!m_numLoading) { |
m_resolver->resolve(m_fontFaces); |
return; |
} |
for (size_t i = 0; i < m_fontFaces.size(); i++) |
- m_fontFaces[i]->loadWithCallback(this); |
+ m_fontFaces[i]->loadWithCallback(document, this); |
} |
void LoadFontPromiseResolver::notifyLoaded(FontFace* fontFace) { |
@@ -139,7 +139,7 @@ bool FontFaceSet::inActiveDocumentContext() const { |
void FontFaceSet::addFontFacesToFontFaceCache(CSSFontSelector* fontSelector) { |
FontFaceCache* fontFaceCache = document()->fontFaceCache(); |
for (const auto& fontFace : m_nonCSSConnectedFaces) |
- fontFaceCache->addFontFace(fontSelector, fontFace, false); |
+ fontFaceCache->addFontFace(fontFace, false); |
} |
const AtomicString& FontFaceSet::interfaceName() const { |
@@ -258,7 +258,7 @@ FontFaceSet* FontFaceSet::addForBinding(ScriptState*, |
return this; |
CSSFontSelector* fontSelector = document()->styleEngine().fontSelector(); |
m_nonCSSConnectedFaces.add(fontFace); |
- document()->fontFaceCache()->addFontFace(fontSelector, fontFace, false); |
+ document()->fontFaceCache()->addFontFace(fontFace, false); |
if (fontFace->loadStatus() == FontFace::Loading) |
addToLoadingFonts(fontFace); |
fontSelector->fontFaceInvalidated(); |
@@ -392,7 +392,7 @@ ScriptPromise FontFaceSet::load(ScriptState* scriptState, |
LoadFontPromiseResolver::create(faces, scriptState); |
ScriptPromise promise = resolver->promise(); |
// After this, resolver->promise() may return null. |
- resolver->loadFonts(); |
+ resolver->loadFonts(document()); |
return promise; |
} |