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

Side by Side Diff: Source/core/dom/DocumentStyleSheetCollection.cpp

Issue 157853002: Revert of Use removeFontFace to avoid resetting fontSelector. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/StyleSheetContents.cpp ('k') | Source/core/dom/StyleEngine.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2013 Google Inc. All rights reserved. 9 * Copyright (C) 2013 Google Inc. All rights reserved.
10 * 10 *
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 { 116 {
117 StyleSheetCollection collection; 117 StyleSheetCollection collection;
118 ActiveDocumentStyleSheetCollector collector(collection); 118 ActiveDocumentStyleSheetCollector collector(collection);
119 collectStyleSheets(engine, collector); 119 collectStyleSheets(engine, collector);
120 120
121 StyleSheetChange change; 121 StyleSheetChange change;
122 analyzeStyleSheetChange(updateMode, collection, change); 122 analyzeStyleSheetChange(updateMode, collection, change);
123 123
124 if (change.styleResolverUpdateType == Reconstruct) { 124 if (change.styleResolverUpdateType == Reconstruct) {
125 engine->clearMasterResolver(); 125 engine->clearMasterResolver();
126 // FIMXE: The following depends on whether StyleRuleFontFace was modifie d or not. 126 engine->resetFontSelector();
127 // No need to always-clear font cache.
128 engine->clearFontCache();
129 } else if (StyleResolver* styleResolver = engine->resolver()) { 127 } else if (StyleResolver* styleResolver = engine->resolver()) {
130 // FIXME: We might have already had styles in child treescope. In this c ase, we cannot use buildScopedStyleTreeInDocumentOrder. 128 // FIXME: We might have already had styles in child treescope. In this c ase, we cannot use buildScopedStyleTreeInDocumentOrder.
131 // Need to change "false" to some valid condition. 129 // Need to change "false" to some valid condition.
132 styleResolver->setBuildScopedStyleTreeInDocumentOrder(false); 130 styleResolver->setBuildScopedStyleTreeInDocumentOrder(false);
133 if (change.styleResolverUpdateType != Additive) { 131 if (change.styleResolverUpdateType != Additive) {
134 ASSERT(change.styleResolverUpdateType == Reset); 132 ASSERT(change.styleResolverUpdateType == Reset || change.styleResolv erUpdateType == ResetStyleResolverAndFontSelector);
135 resetAllRuleSetsInTreeScope(styleResolver); 133 resetAllRuleSetsInTreeScope(styleResolver);
136 engine->removeFontFaceRules(change.fontFaceRulesToRemove); 134 if (change.styleResolverUpdateType == ResetStyleResolverAndFontSelec tor)
135 engine->resetFontSelector();
137 styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleShe ets); 136 styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleShe ets);
138 styleResolver->lazyAppendAuthorStyleSheets(0, collection.activeAutho rStyleSheets()); 137 styleResolver->lazyAppendAuthorStyleSheets(0, collection.activeAutho rStyleSheets());
139 } else { 138 } else {
140 styleResolver->lazyAppendAuthorStyleSheets(m_activeAuthorStyleSheets .size(), collection.activeAuthorStyleSheets()); 139 styleResolver->lazyAppendAuthorStyleSheets(m_activeAuthorStyleSheets .size(), collection.activeAuthorStyleSheets());
141 } 140 }
141 } else if (change.styleResolverUpdateType == ResetStyleResolverAndFontSelect or) {
142 engine->resetFontSelector();
142 } 143 }
143 m_scopingNodesForStyleScoped.didRemoveScopingNodes(); 144 m_scopingNodesForStyleScoped.didRemoveScopingNodes();
144 145
145 collection.swap(*this); 146 collection.swap(*this);
146 147
147 updateUsesRemUnits(); 148 updateUsesRemUnits();
148 149
149 return change.requiresFullStyleRecalc; 150 return change.requiresFullStyleRecalc;
150 } 151 }
151 152
152 } 153 }
OLDNEW
« no previous file with comments | « Source/core/css/StyleSheetContents.cpp ('k') | Source/core/dom/StyleEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698