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

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

Issue 66483002: fontSelector should be reset when removing stylesheets which has @font-face rule. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 7 years, 1 month 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/resolver/StyleResolver.cpp ('k') | Source/core/dom/ShadowTreeStyleSheetCollection.cpp » ('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 01c32420b3026f93db400dd5fb3a402782e1f3aa..8e89e114082d066ecc26b4d35952479dbe2d009f 100644
--- a/Source/core/dom/DocumentStyleSheetCollection.cpp
+++ b/Source/core/dom/DocumentStyleSheetCollection.cpp
@@ -153,11 +153,10 @@ bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* collecti
collectActiveCSSStyleSheetsFromSeamlessParents(activeCSSStyleSheets, document());
collectStyleSheets(collections, styleSheets, activeCSSStyleSheets);
- StyleResolverUpdateType styleResolverUpdateType;
- bool requiresFullStyleRecalc;
- analyzeStyleSheetChange(updateMode, activeAuthorStyleSheets(), activeCSSStyleSheets, styleResolverUpdateType, requiresFullStyleRecalc);
+ StyleSheetChange change;
+ analyzeStyleSheetChange(updateMode, activeAuthorStyleSheets(), activeCSSStyleSheets, change);
- if (styleResolverUpdateType == Reconstruct) {
+ if (change.styleResolverUpdateType == Reconstruct) {
document()->clearStyleResolver();
} else {
StyleResolver* styleResolver = document()->styleResolverIfExists();
@@ -165,11 +164,13 @@ bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* collecti
// FIXME: We might have already had styles in child treescope. In this case, we cannot use buildScopedStyleTreeInDocumentOrder.
// Need to change "false" to some valid condition.
styleResolver->setBuildScopedStyleTreeInDocumentOrder(false);
- if (styleResolverUpdateType == Reset) {
+ if (change.styleResolverUpdateType != Additive) {
+ ASSERT(change.styleResolverUpdateType == Reset || change.styleResolverUpdateType == ResetStyleResolverAndFontSelector);
resetAllRuleSetsInTreeScope(styleResolver);
+ if (change.styleResolverUpdateType == ResetStyleResolverAndFontSelector)
+ styleResolver->resetFontSelector();
styleResolver->appendAuthorStyleSheets(0, activeCSSStyleSheets);
} else {
- ASSERT(styleResolverUpdateType == Additive);
styleResolver->appendAuthorStyleSheets(m_activeAuthorStyleSheets.size(), activeCSSStyleSheets);
}
}
@@ -178,7 +179,7 @@ bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* collecti
m_styleSheetsForStyleSheetList.swap(styleSheets);
updateUsesRemUnits();
- return requiresFullStyleRecalc;
+ return change.requiresFullStyleRecalc;
}
}
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/dom/ShadowTreeStyleSheetCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698