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

Side by Side Diff: Source/core/css/StyleInvalidationAnalysis.cpp

Issue 152623002: Make StyleChange parameter explicit in setNeedsStyleRecalc. (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/RuleFeature.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 191 }
192 return false; 192 return false;
193 } 193 }
194 194
195 void StyleInvalidationAnalysis::invalidateStyle(Document& document) 195 void StyleInvalidationAnalysis::invalidateStyle(Document& document)
196 { 196 {
197 ASSERT(!m_dirtiesAllStyle); 197 ASSERT(!m_dirtiesAllStyle);
198 198
199 if (!m_scopingNodes.isEmpty()) { 199 if (!m_scopingNodes.isEmpty()) {
200 for (unsigned i = 0; i < m_scopingNodes.size(); ++i) 200 for (unsigned i = 0; i < m_scopingNodes.size(); ++i)
201 m_scopingNodes.at(i)->setNeedsStyleRecalc(); 201 m_scopingNodes.at(i)->setNeedsStyleRecalc(SubtreeStyleChange);
202 } 202 }
203 203
204 if (m_idScopes.isEmpty() && m_classScopes.isEmpty()) 204 if (m_idScopes.isEmpty() && m_classScopes.isEmpty())
205 return; 205 return;
206 Element* element = ElementTraversal::firstWithin(document); 206 Element* element = ElementTraversal::firstWithin(document);
207 while (element) { 207 while (element) {
208 if (elementMatchesSelectorScopes(element, m_idScopes, m_classScopes)) { 208 if (elementMatchesSelectorScopes(element, m_idScopes, m_classScopes)) {
209 element->setNeedsStyleRecalc(); 209 element->setNeedsStyleRecalc(SubtreeStyleChange);
210 // The whole subtree is now invalidated, we can skip to the next sib ling. 210 // The whole subtree is now invalidated, we can skip to the next sib ling.
211 element = ElementTraversal::nextSkippingChildren(*element); 211 element = ElementTraversal::nextSkippingChildren(*element);
212 continue; 212 continue;
213 } 213 }
214 element = ElementTraversal::next(*element); 214 element = ElementTraversal::next(*element);
215 } 215 }
216 } 216 }
217 217
218 } 218 }
OLDNEW
« no previous file with comments | « Source/core/css/RuleFeature.cpp ('k') | Source/core/css/resolver/StyleResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698