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

Unified Diff: Source/core/dom/DocumentStyleSheetCollection.cpp

Issue 1076163002: Don't clear FontFaceCache if no @font-face were removed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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/core.gypi ('k') | Source/core/dom/TreeScopeStyleSheetCollection.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DocumentStyleSheetCollection.cpp
diff --git a/Source/core/dom/DocumentStyleSheetCollection.cpp b/Source/core/dom/DocumentStyleSheetCollection.cpp
index e2834622287c55baeb2a4cb387e2fb712dae7c84..74d427b67d07df7600c64bc66dbf591f268c59f2 100644
--- a/Source/core/dom/DocumentStyleSheetCollection.cpp
+++ b/Source/core/dom/DocumentStyleSheetCollection.cpp
@@ -97,9 +97,12 @@ void DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine& engine,
if (change.styleResolverUpdateType == Reconstruct) {
engine.clearMasterResolver();
- // FIMXE: The following depends on whether StyleRuleFontFace was modified or not.
- // No need to always-clear font cache.
- engine.clearFontCache();
+ // TODO(rune@opera.com): The following depends on whether StyleRuleFontFace was modified or not.
+ // We should only remove modified/removed @font-face rules, or @font-face rules from removed
+ // stylesheets. We currently avoid clearing the font cache when we have had an analyzed update
+ // and no @font-face rules were removed, in which case requiresFullStyleRecalc will be false.
+ if (change.requiresFullStyleRecalc)
+ engine.clearFontCache();
} else if (StyleResolver* styleResolver = engine.resolver()) {
if (change.styleResolverUpdateType != Additive) {
ASSERT(change.styleResolverUpdateType == Reset);
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/dom/TreeScopeStyleSheetCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698