| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |