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..8043332537334587fd1471fe07c95960f4f56d8c 100644 |
--- a/third_party/WebKit/Source/core/css/FontFaceSet.cpp |
+++ b/third_party/WebKit/Source/core/css/FontFaceSet.cpp |
@@ -136,8 +136,8 @@ |
return context && toDocument(context)->isActive(); |
} |
-void FontFaceSet::addFontFacesToFontFaceCache(CSSFontSelector* fontSelector) { |
- FontFaceCache* fontFaceCache = document()->fontFaceCache(); |
+void FontFaceSet::addFontFacesToFontFaceCache(FontFaceCache* fontFaceCache, |
+ CSSFontSelector* fontSelector) { |
for (const auto& fontFace : m_nonCSSConnectedFaces) |
fontFaceCache->addFontFace(fontSelector, fontFace, false); |
} |
@@ -258,7 +258,7 @@ |
return this; |
CSSFontSelector* fontSelector = document()->styleEngine().fontSelector(); |
m_nonCSSConnectedFaces.add(fontFace); |
- document()->fontFaceCache()->addFontFace(fontSelector, fontFace, false); |
+ fontSelector->fontFaceCache()->addFontFace(fontSelector, fontFace, false); |
if (fontFace->loadStatus() == FontFace::Loading) |
addToLoadingFonts(fontFace); |
fontSelector->fontFaceInvalidated(); |
@@ -269,7 +269,7 @@ |
if (!inActiveDocumentContext() || m_nonCSSConnectedFaces.isEmpty()) |
return; |
CSSFontSelector* fontSelector = document()->styleEngine().fontSelector(); |
- FontFaceCache* fontFaceCache = document()->fontFaceCache(); |
+ FontFaceCache* fontFaceCache = fontSelector->fontFaceCache(); |
for (const auto& fontFace : m_nonCSSConnectedFaces) { |
fontFaceCache->removeFontFace(fontFace.get(), false); |
if (fontFace->loadStatus() == FontFace::Loading) |
@@ -290,7 +290,7 @@ |
if (it != m_nonCSSConnectedFaces.end()) { |
m_nonCSSConnectedFaces.remove(it); |
CSSFontSelector* fontSelector = document()->styleEngine().fontSelector(); |
- document()->fontFaceCache()->removeFontFace(fontFace, false); |
+ fontSelector->fontFaceCache()->removeFontFace(fontFace, false); |
if (fontFace->loadStatus() == FontFace::Loading) |
removeFromLoadingFonts(fontFace); |
fontSelector->fontFaceInvalidated(); |
@@ -313,7 +313,10 @@ |
const { |
Document* document = this->document(); |
document->updateActiveStyle(); |
- return document->fontFaceCache()->cssConnectedFontFaces(); |
+ return document->styleEngine() |
+ .fontSelector() |
+ ->fontFaceCache() |
+ ->cssConnectedFontFaces(); |
} |
bool FontFaceSet::isCSSConnectedFontFace(FontFace* fontFace) const { |
@@ -378,7 +381,8 @@ |
return promise; |
} |
- FontFaceCache* fontFaceCache = document()->fontFaceCache(); |
+ FontFaceCache* fontFaceCache = |
+ document()->styleEngine().fontSelector()->fontFaceCache(); |
FontFaceArray faces; |
for (const FontFamily* f = &font.getFontDescription().family(); f; |
f = f->next()) { |
@@ -410,7 +414,7 @@ |
} |
CSSFontSelector* fontSelector = document()->styleEngine().fontSelector(); |
- FontFaceCache* fontFaceCache = document()->fontFaceCache(); |
+ FontFaceCache* fontFaceCache = fontSelector->fontFaceCache(); |
bool hasLoadedFaces = false; |
for (const FontFamily* f = &font.getFontDescription().family(); f; |