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

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

Issue 562403002: Remove TargetedStyleRecalc runtime flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Don't use the runtime flag in tests Created 6 years, 3 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 | « Source/core/css/RuleFeature.h ('k') | Source/platform/RuntimeEnabledFeatures.in » ('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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r ights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 features.id = selector.value(); 188 features.id = selector.value();
189 else if (selector.match() == CSSSelector::Class) 189 else if (selector.match() == CSSSelector::Class)
190 features.classes.append(selector.value()); 190 features.classes.append(selector.value());
191 else if (selector.isAttributeSelector()) 191 else if (selector.isAttributeSelector())
192 features.attributes.append(selector.attribute().localName()); 192 features.attributes.append(selector.attribute().localName());
193 else if (selector.isCustomPseudoElement()) 193 else if (selector.isCustomPseudoElement())
194 features.customPseudoElement = true; 194 features.customPseudoElement = true;
195 } 195 }
196 196
197 RuleFeatureSet::RuleFeatureSet() 197 RuleFeatureSet::RuleFeatureSet()
198 : m_targetedStyleRecalcEnabled(RuntimeEnabledFeatures::targetedStyleRecalcEn abled())
199 { 198 {
200 } 199 }
201 200
202 RuleFeatureSet::~RuleFeatureSet() 201 RuleFeatureSet::~RuleFeatureSet()
203 { 202 {
204 } 203 }
205 204
206 DescendantInvalidationSet* RuleFeatureSet::invalidationSetForSelector(const CSSS elector& selector) 205 DescendantInvalidationSet* RuleFeatureSet::invalidationSetForSelector(const CSSS elector& selector)
207 { 206 {
208 if (selector.match() == CSSSelector::Class) 207 if (selector.match() == CSSSelector::Class)
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 337
339 void RuleFeatureSet::addContentAttr(const AtomicString& attributeName) 338 void RuleFeatureSet::addContentAttr(const AtomicString& attributeName)
340 { 339 {
341 DescendantInvalidationSet& invalidationSet = ensureAttributeInvalidationSet( attributeName); 340 DescendantInvalidationSet& invalidationSet = ensureAttributeInvalidationSet( attributeName);
342 invalidationSet.setWholeSubtreeInvalid(); 341 invalidationSet.setWholeSubtreeInvalid();
343 } 342 }
344 343
345 void RuleFeatureSet::collectFeaturesFromRuleData(const RuleData& ruleData) 344 void RuleFeatureSet::collectFeaturesFromRuleData(const RuleData& ruleData)
346 { 345 {
347 FeatureMetadata metadata; 346 FeatureMetadata metadata;
348 InvalidationSetMode mode = UseSubtreeStyleChange; 347 InvalidationSetMode mode = updateInvalidationSets(ruleData.selector());
349 if (m_targetedStyleRecalcEnabled)
350 mode = updateInvalidationSets(ruleData.selector());
351 348
352 collectFeaturesFromSelector(ruleData.selector(), metadata, mode); 349 collectFeaturesFromSelector(ruleData.selector(), metadata, mode);
353 m_metadata.add(metadata); 350 m_metadata.add(metadata);
354 351
355 if (metadata.foundSiblingSelector) 352 if (metadata.foundSiblingSelector)
356 siblingRules.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex( ), ruleData.hasDocumentSecurityOrigin())); 353 siblingRules.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex( ), ruleData.hasDocumentSecurityOrigin()));
357 if (ruleData.containsUncommonAttributeSelector()) 354 if (ruleData.containsUncommonAttributeSelector())
358 uncommonAttributeRules.append(RuleFeature(ruleData.rule(), ruleData.sele ctorIndex(), ruleData.hasDocumentSecurityOrigin())); 355 uncommonAttributeRules.append(RuleFeature(ruleData.rule(), ruleData.sele ctorIndex(), ruleData.hasDocumentSecurityOrigin()));
359 } 356 }
360 357
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
566 visitor->trace(uncommonAttributeRules); 563 visitor->trace(uncommonAttributeRules);
567 visitor->trace(m_classInvalidationSets); 564 visitor->trace(m_classInvalidationSets);
568 visitor->trace(m_attributeInvalidationSets); 565 visitor->trace(m_attributeInvalidationSets);
569 visitor->trace(m_idInvalidationSets); 566 visitor->trace(m_idInvalidationSets);
570 visitor->trace(m_pseudoInvalidationSets); 567 visitor->trace(m_pseudoInvalidationSets);
571 visitor->trace(m_styleInvalidator); 568 visitor->trace(m_styleInvalidator);
572 #endif 569 #endif
573 } 570 }
574 571
575 } // namespace blink 572 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/css/RuleFeature.h ('k') | Source/platform/RuntimeEnabledFeatures.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698