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

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

Issue 82583005: Use removeFontFace to avoid resetting fontSelector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Modified resetFontSelector Created 6 years, 11 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/dom/DocumentStyleSheetCollection.cpp
diff --git a/Source/core/dom/DocumentStyleSheetCollection.cpp b/Source/core/dom/DocumentStyleSheetCollection.cpp
index 07a8160e095c7570549dd92d5debd885e0900c25..7e6accde767e20ee9af4c6f9f0d9d30f5d4dad9e 100644
--- a/Source/core/dom/DocumentStyleSheetCollection.cpp
+++ b/Source/core/dom/DocumentStyleSheetCollection.cpp
@@ -135,23 +135,22 @@ bool 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-reset.
engine->resetFontSelector();
} else if (StyleResolver* styleResolver = engine->resolver()) {
// 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 (change.styleResolverUpdateType != Additive) {
- ASSERT(change.styleResolverUpdateType == Reset || change.styleResolverUpdateType == ResetStyleResolverAndFontSelector);
+ ASSERT(change.styleResolverUpdateType == Reset);
resetAllRuleSetsInTreeScope(styleResolver);
- if (change.styleResolverUpdateType == ResetStyleResolverAndFontSelector)
- engine->resetFontSelector();
+ engine->removeFontFaceRules(change.fontFaceRulesToRemove);
styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleSheets);
styleResolver->lazyAppendAuthorStyleSheets(0, collector.collection().activeAuthorStyleSheets());
} else {
styleResolver->lazyAppendAuthorStyleSheets(m_activeAuthorStyleSheets.size(), collector.collection().activeAuthorStyleSheets());
}
- } else if (change.styleResolverUpdateType == ResetStyleResolverAndFontSelector) {
- engine->resetFontSelector();
}
m_scopingNodesForStyleScoped.didRemoveScopingNodes();
collector.setCollectionTo(*this);

Powered by Google App Engine
This is Rietveld 408576698