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

Side by Side Diff: third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollection.cpp

Issue 2096653004: Avoid stack allocating StyleSheetCollections. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollection.h ('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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 DCHECK(sheets[i]); 106 DCHECK(sheets[i]);
107 if (sheets[i]->hasFontFaceRule()) { 107 if (sheets[i]->hasFontFaceRule()) {
108 // FIXME: We don't need this for styles in shadow tree. 108 // FIXME: We don't need this for styles in shadow tree.
109 sheets[i]->findFontFaceRules(fontFaceRules); 109 sheets[i]->findFontFaceRules(fontFaceRules);
110 hasFontFaceRule = true; 110 hasFontFaceRule = true;
111 } 111 }
112 } 112 }
113 return hasFontFaceRule; 113 return hasFontFaceRule;
114 } 114 }
115 115
116 void TreeScopeStyleSheetCollection::analyzeStyleSheetChange(StyleResolverUpdateM ode updateMode, const StyleSheetCollection& newCollection, StyleSheetChange& cha nge) 116 void TreeScopeStyleSheetCollection::analyzeStyleSheetChange(StyleResolverUpdateM ode updateMode, const HeapVector<Member<CSSStyleSheet>>& newActiveAuthorStyleShe ets, StyleSheetChange& change)
117 { 117 {
118 if (activeLoadingStyleSheetLoaded(newCollection.activeAuthorStyleSheets())) 118 if (activeLoadingStyleSheetLoaded(newActiveAuthorStyleSheets))
119 return; 119 return;
120 120
121 if (updateMode != AnalyzedStyleUpdate) 121 if (updateMode != AnalyzedStyleUpdate)
122 return; 122 return;
123 123
124 // Find out which stylesheets are new. 124 // Find out which stylesheets are new.
125 HeapVector<Member<StyleSheetContents>> addedSheets; 125 HeapVector<Member<StyleSheetContents>> addedSheets;
126 if (m_activeAuthorStyleSheets.size() <= newCollection.activeAuthorStyleSheet s().size()) { 126 if (m_activeAuthorStyleSheets.size() <= newActiveAuthorStyleSheets.size()) {
127 change.styleResolverUpdateType = compareStyleSheets(m_activeAuthorStyleS heets, newCollection.activeAuthorStyleSheets(), addedSheets); 127 change.styleResolverUpdateType = compareStyleSheets(m_activeAuthorStyleS heets, newActiveAuthorStyleSheets, addedSheets);
128 } else { 128 } else {
129 StyleResolverUpdateType updateType = compareStyleSheets(newCollection.ac tiveAuthorStyleSheets(), m_activeAuthorStyleSheets, addedSheets); 129 StyleResolverUpdateType updateType = compareStyleSheets(newActiveAuthorS tyleSheets, m_activeAuthorStyleSheets, addedSheets);
130 if (updateType != Additive) { 130 if (updateType != Additive) {
131 change.styleResolverUpdateType = updateType; 131 change.styleResolverUpdateType = updateType;
132 } else { 132 } else {
133 change.styleResolverUpdateType = Reset; 133 change.styleResolverUpdateType = Reset;
134 // If @font-face is removed, needs full style recalc. 134 // If @font-face is removed, needs full style recalc.
135 if (findFontFaceRulesFromStyleSheetContents(addedSheets, change.font FaceRulesToRemove)) 135 if (findFontFaceRulesFromStyleSheetContents(addedSheets, change.font FaceRulesToRemove))
136 return; 136 return;
137 } 137 }
138 } 138 }
139 139
(...skipping 28 matching lines...) Expand all
168 } 168 }
169 169
170 DEFINE_TRACE(TreeScopeStyleSheetCollection) 170 DEFINE_TRACE(TreeScopeStyleSheetCollection)
171 { 171 {
172 visitor->trace(m_treeScope); 172 visitor->trace(m_treeScope);
173 visitor->trace(m_styleSheetCandidateNodes); 173 visitor->trace(m_styleSheetCandidateNodes);
174 StyleSheetCollection::trace(visitor); 174 StyleSheetCollection::trace(visitor);
175 } 175 }
176 176
177 } // namespace blink 177 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/TreeScopeStyleSheetCollection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698