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

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

Issue 82643002: Should not override styleResolverUpdateType to Reset when some existing stylesheet still has @font-… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revised 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | 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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 if (styleSheetContentsHasFontFaceRule(addedSheets)) { 195 if (styleSheetContentsHasFontFaceRule(addedSheets)) {
196 change.styleResolverUpdateType = ResetStyleResolverAndFontSelect or; 196 change.styleResolverUpdateType = ResetStyleResolverAndFontSelect or;
197 return; 197 return;
198 } 198 }
199 // FIXME: since currently all stylesheets are re-added after resetin g styleresolver, 199 // FIXME: since currently all stylesheets are re-added after resetin g styleresolver,
200 // fontSelector should be always reset. After creating RuleSet for e ach StyleSheetContents, 200 // fontSelector should be always reset. After creating RuleSet for e ach StyleSheetContents,
201 // we can avoid appending all stylesheetcontents in reset case. 201 // we can avoid appending all stylesheetcontents in reset case.
202 // So we can remove "styleSheetContentsHasFontFaceRule(newSheets)". 202 // So we can remove "styleSheetContentsHasFontFaceRule(newSheets)".
203 if (cssStyleSheetHasFontFaceRule(newCollection.activeAuthorStyleShee ts())) 203 if (cssStyleSheetHasFontFaceRule(newCollection.activeAuthorStyleShee ts()))
204 change.styleResolverUpdateType = ResetStyleResolverAndFontSelect or; 204 change.styleResolverUpdateType = ResetStyleResolverAndFontSelect or;
205 change.styleResolverUpdateType = Reset; 205 else
206 change.styleResolverUpdateType = Reset;
206 } 207 }
207 } 208 }
208 209
209 // FIXME: If styleResolverUpdateType is still Reconstruct, we could return e arly here 210 // FIXME: If styleResolverUpdateType is still Reconstruct, we could return e arly here
210 // as destroying the StyleResolver will recalc the whole document anyway? 211 // as destroying the StyleResolver will recalc the whole document anyway?
211 212
212 // If we are already parsing the body and so may have significant amount of elements, put some effort into trying to avoid style recalcs. 213 // If we are already parsing the body and so may have significant amount of elements, put some effort into trying to avoid style recalcs.
213 if (!document()->body() || document()->hasNodesWithPlaceholderStyle()) 214 if (!document()->body() || document()->hasNodesWithPlaceholderStyle())
214 return; 215 return;
215 StyleInvalidationAnalysis invalidationAnalysis(addedSheets); 216 StyleInvalidationAnalysis invalidationAnalysis(addedSheets);
(...skipping 26 matching lines...) Expand all
242 } 243 }
243 return false; 244 return false;
244 } 245 }
245 246
246 void StyleSheetCollection::updateUsesRemUnits() 247 void StyleSheetCollection::updateUsesRemUnits()
247 { 248 {
248 m_usesRemUnits = styleSheetsUseRemUnits(m_activeAuthorStyleSheets); 249 m_usesRemUnits = styleSheetsUseRemUnits(m_activeAuthorStyleSheets);
249 } 250 }
250 251
251 } 252 }
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698