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

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

Issue 42543007: StyleResolver should update RuleSets lazily. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: modify Document::styleResolver 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 if (styleResolverUpdateType == Reconstruct) { 160 if (styleResolverUpdateType == Reconstruct) {
161 document()->clearStyleResolver(); 161 document()->clearStyleResolver();
162 } else { 162 } else {
163 StyleResolver* styleResolver = document()->styleResolverIfExists(); 163 StyleResolver* styleResolver = document()->styleResolverIfExists();
164 ASSERT(styleResolver); 164 ASSERT(styleResolver);
165 // FIXME: We might have already had styles in child treescope. In this c ase, we cannot use buildScopedStyleTreeInDocumentOrder. 165 // 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. 166 // Need to change "false" to some valid condition.
167 styleResolver->setBuildScopedStyleTreeInDocumentOrder(false); 167 styleResolver->setBuildScopedStyleTreeInDocumentOrder(false);
168 if (styleResolverUpdateType == Reset) { 168 if (styleResolverUpdateType == Reset) {
169 resetAllRuleSetsInTreeScope(styleResolver); 169 resetAllRuleSetsInTreeScope(styleResolver);
170 styleResolver->appendAuthorStyleSheets(0, activeCSSStyleSheets); 170 styleResolver->removePendingAuthorStyleSheets(m_activeAuthorStyleShe ets);
171 styleResolver->lazyAppendAuthorStyleSheets(0, activeCSSStyleSheets);
171 } else { 172 } else {
172 ASSERT(styleResolverUpdateType == Additive); 173 ASSERT(styleResolverUpdateType == Additive);
173 styleResolver->appendAuthorStyleSheets(m_activeAuthorStyleSheets.siz e(), activeCSSStyleSheets); 174 styleResolver->lazyAppendAuthorStyleSheets(m_activeAuthorStyleSheets .size(), 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 requiresFullStyleRecalc;
182 } 183 }
183 184
184 } 185 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698