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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* collecti ons, StyleResolverUpdateMode updateMode) 147 bool DocumentStyleSheetCollection::updateActiveStyleSheets(StyleEngine* collecti ons, StyleResolverUpdateMode updateMode)
148 { 148 {
149 Vector<RefPtr<StyleSheet> > styleSheets; 149 Vector<RefPtr<StyleSheet> > styleSheets;
150 Vector<RefPtr<CSSStyleSheet> > activeCSSStyleSheets; 150 Vector<RefPtr<CSSStyleSheet> > activeCSSStyleSheets;
151 activeCSSStyleSheets.append(collections->injectedAuthorStyleSheets()); 151 activeCSSStyleSheets.append(collections->injectedAuthorStyleSheets());
152 activeCSSStyleSheets.append(collections->documentAuthorStyleSheets()); 152 activeCSSStyleSheets.append(collections->documentAuthorStyleSheets());
153 collectActiveCSSStyleSheetsFromSeamlessParents(activeCSSStyleSheets, documen t()); 153 collectActiveCSSStyleSheetsFromSeamlessParents(activeCSSStyleSheets, documen t());
154 collectStyleSheets(collections, styleSheets, activeCSSStyleSheets); 154 collectStyleSheets(collections, styleSheets, activeCSSStyleSheets);
155 155
156 StyleResolverUpdateType styleResolverUpdateType; 156 StyleSheetChange change;
157 bool requiresFullStyleRecalc; 157 analyzeStyleSheetChange(updateMode, activeAuthorStyleSheets(), activeCSSStyl eSheets, change);
158 analyzeStyleSheetChange(updateMode, activeAuthorStyleSheets(), activeCSSStyl eSheets, styleResolverUpdateType, requiresFullStyleRecalc);
159 158
160 if (styleResolverUpdateType == Reconstruct) { 159 if (change.styleResolverUpdateType == Reconstruct) {
161 document()->clearStyleResolver(); 160 document()->clearStyleResolver();
162 } else { 161 } else {
163 StyleResolver* styleResolver = document()->styleResolverIfExists(); 162 StyleResolver* styleResolver = document()->styleResolverIfExists();
164 ASSERT(styleResolver); 163 ASSERT(styleResolver);
165 // FIXME: We might have already had styles in child treescope. In this c ase, we cannot use buildScopedStyleTreeInDocumentOrder. 164 // FIXME: We might have already had styles in child treescope. In this c ase, we cannot use buildScopedStyleTreeInDocumentOrder.
166 // Need to change "false" to some valid condition. 165 // Need to change "false" to some valid condition.
167 styleResolver->setBuildScopedStyleTreeInDocumentOrder(false); 166 styleResolver->setBuildScopedStyleTreeInDocumentOrder(false);
168 if (styleResolverUpdateType == Reset) { 167 if (change.styleResolverUpdateType != Additive) {
168 ASSERT(change.styleResolverUpdateType == Reset || change.styleResolv erUpdateType == ResetStyleResolverAndFontSelector);
169 resetAllRuleSetsInTreeScope(styleResolver); 169 resetAllRuleSetsInTreeScope(styleResolver);
170 if (change.styleResolverUpdateType == ResetStyleResolverAndFontSelec tor)
171 styleResolver->resetFontSelector();
170 styleResolver->appendAuthorStyleSheets(0, activeCSSStyleSheets); 172 styleResolver->appendAuthorStyleSheets(0, activeCSSStyleSheets);
171 } else { 173 } else {
172 ASSERT(styleResolverUpdateType == Additive);
173 styleResolver->appendAuthorStyleSheets(m_activeAuthorStyleSheets.siz e(), activeCSSStyleSheets); 174 styleResolver->appendAuthorStyleSheets(m_activeAuthorStyleSheets.siz e(), activeCSSStyleSheets);
174 } 175 }
175 } 176 }
176 m_scopingNodesForStyleScoped.didRemoveScopingNodes(); 177 m_scopingNodesForStyleScoped.didRemoveScopingNodes();
177 m_activeAuthorStyleSheets.swap(activeCSSStyleSheets); 178 m_activeAuthorStyleSheets.swap(activeCSSStyleSheets);
178 m_styleSheetsForStyleSheetList.swap(styleSheets); 179 m_styleSheetsForStyleSheetList.swap(styleSheets);
179 updateUsesRemUnits(); 180 updateUsesRemUnits();
180 181
181 return requiresFullStyleRecalc; 182 return change.requiresFullStyleRecalc;
182 } 183 }
183 184
184 } 185 }
OLDNEW
« 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