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

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

Issue 192373005: Use new is*Element() helper functions in CSS code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/SelectorChecker.cpp ('k') | Source/core/css/StyleSheetList.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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport> >& importRules = styleSheetContents->importRules(); 150 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleImport> >& importRules = styleSheetContents->importRules();
151 for (unsigned i = 0; i < importRules.size(); ++i) { 151 for (unsigned i = 0; i < importRules.size(); ++i) {
152 if (!importRules[i]->styleSheet()) 152 if (!importRules[i]->styleSheet())
153 continue; 153 continue;
154 analyzeStyleSheet(importRules[i]->styleSheet()); 154 analyzeStyleSheet(importRules[i]->styleSheet());
155 if (m_dirtiesAllStyle) 155 if (m_dirtiesAllStyle)
156 return; 156 return;
157 } 157 }
158 if (styleSheetContents->hasSingleOwnerNode()) { 158 if (styleSheetContents->hasSingleOwnerNode()) {
159 Node* ownerNode = styleSheetContents->singleOwnerNode(); 159 Node* ownerNode = styleSheetContents->singleOwnerNode();
160 if (ownerNode && ownerNode->hasTagName(HTMLNames::styleTag) && toHTMLSty leElement(ownerNode)->isRegisteredAsScoped()) { 160 if (isHTMLStyleElement(ownerNode) && toHTMLStyleElement(*ownerNode).isRe gisteredAsScoped()) {
161 m_scopingNodes.append(determineScopingNodeForStyleScoped(toHTMLStyle Element(ownerNode), styleSheetContents)); 161 m_scopingNodes.append(determineScopingNodeForStyleScoped(toHTMLStyle Element(ownerNode), styleSheetContents));
162 return; 162 return;
163 } 163 }
164 } 164 }
165 165
166 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase> >& rules = styleShe etContents->childRules(); 166 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleBase> >& rules = styleShe etContents->childRules();
167 for (unsigned i = 0; i < rules.size(); i++) { 167 for (unsigned i = 0; i < rules.size(); i++) {
168 StyleRuleBase* rule = rules[i].get(); 168 StyleRuleBase* rule = rules[i].get();
169 if (!rule->isStyleRule()) { 169 if (!rule->isStyleRule()) {
170 if (ruleAdditionMightRequireDocumentStyleRecalc(rule)) { 170 if (ruleAdditionMightRequireDocumentStyleRecalc(rule)) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 element->setNeedsStyleRecalc(SubtreeStyleChange); 212 element->setNeedsStyleRecalc(SubtreeStyleChange);
213 // The whole subtree is now invalidated, we can skip to the next sib ling. 213 // The whole subtree is now invalidated, we can skip to the next sib ling.
214 element = ElementTraversal::nextSkippingChildren(*element); 214 element = ElementTraversal::nextSkippingChildren(*element);
215 continue; 215 continue;
216 } 216 }
217 element = ElementTraversal::next(*element); 217 element = ElementTraversal::next(*element);
218 } 218 }
219 } 219 }
220 220
221 } 221 }
OLDNEW
« no previous file with comments | « Source/core/css/SelectorChecker.cpp ('k') | Source/core/css/StyleSheetList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698