| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 return ensureInvalidationSet(m_idInvalidationSets, id, type); | 273 return ensureInvalidationSet(m_idInvalidationSets, id, type); |
| 274 } | 274 } |
| 275 | 275 |
| 276 ALWAYS_INLINE InvalidationSet& RuleFeatureSet::ensurePseudoInvalidationSet(CSSSe
lector::PseudoType pseudoType, InvalidationType type) | 276 ALWAYS_INLINE InvalidationSet& RuleFeatureSet::ensurePseudoInvalidationSet(CSSSe
lector::PseudoType pseudoType, InvalidationType type) |
| 277 { | 277 { |
| 278 return ensureInvalidationSet(m_pseudoInvalidationSets, pseudoType, type); | 278 return ensureInvalidationSet(m_pseudoInvalidationSets, pseudoType, type); |
| 279 } | 279 } |
| 280 | 280 |
| 281 bool RuleFeatureSet::extractInvalidationSetFeature(const CSSSelector& selector,
InvalidationSetFeatures& features) | 281 bool RuleFeatureSet::extractInvalidationSetFeature(const CSSSelector& selector,
InvalidationSetFeatures& features) |
| 282 { | 282 { |
| 283 if (selector.match() == CSSSelector::Tag && selector.tagQName().localName()
!= starAtom) | 283 if (selector.match() == CSSSelector::Tag && selector.tagQName().localName()
!= starAtom) { |
| 284 features.tagName = selector.tagQName().localName(); | 284 features.tagName = selector.tagQName().localName(); |
| 285 else if (selector.match() == CSSSelector::Id) | 285 return true; |
| 286 } |
| 287 if (selector.match() == CSSSelector::Id) { |
| 286 features.id = selector.value(); | 288 features.id = selector.value(); |
| 287 else if (selector.match() == CSSSelector::Class) | 289 return true; |
| 290 } |
| 291 if (selector.match() == CSSSelector::Class) { |
| 288 features.classes.append(selector.value()); | 292 features.classes.append(selector.value()); |
| 289 else if (selector.isAttributeSelector()) | 293 return true; |
| 294 } |
| 295 if (selector.isAttributeSelector()) { |
| 290 features.attributes.append(selector.attribute().localName()); | 296 features.attributes.append(selector.attribute().localName()); |
| 291 else if (selector.pseudoType() == CSSSelector::PseudoWebKitCustomElement) | 297 return true; |
| 298 } |
| 299 if (selector.pseudoType() == CSSSelector::PseudoWebKitCustomElement) { |
| 292 features.customPseudoElement = true; | 300 features.customPseudoElement = true; |
| 293 else if (selector.pseudoType() == CSSSelector::PseudoBefore || selector.pseu
doType() == CSSSelector::PseudoAfter) | 301 return true; |
| 302 } |
| 303 if (selector.pseudoType() == CSSSelector::PseudoBefore || selector.pseudoTyp
e() == CSSSelector::PseudoAfter) |
| 294 features.hasBeforeOrAfter = true; | 304 features.hasBeforeOrAfter = true; |
| 295 else | 305 return false; |
| 296 return false; | |
| 297 return true; | |
| 298 } | 306 } |
| 299 | 307 |
| 300 InvalidationSet* RuleFeatureSet::invalidationSetForSelector(const CSSSelector& s
elector, InvalidationType type) | 308 InvalidationSet* RuleFeatureSet::invalidationSetForSelector(const CSSSelector& s
elector, InvalidationType type) |
| 301 { | 309 { |
| 302 if (selector.match() == CSSSelector::Class) | 310 if (selector.match() == CSSSelector::Class) |
| 303 return &ensureClassInvalidationSet(selector.value(), type); | 311 return &ensureClassInvalidationSet(selector.value(), type); |
| 304 if (selector.isAttributeSelector()) | 312 if (selector.isAttributeSelector()) |
| 305 return &ensureAttributeInvalidationSet(selector.attribute().localName(),
type); | 313 return &ensureAttributeInvalidationSet(selector.attribute().localName(),
type); |
| 306 if (selector.match() == CSSSelector::Id) | 314 if (selector.match() == CSSSelector::Id) |
| 307 return &ensureIdInvalidationSet(selector.value(), type); | 315 return &ensureIdInvalidationSet(selector.value(), type); |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 | 730 |
| 723 DEFINE_TRACE(RuleFeatureSet) | 731 DEFINE_TRACE(RuleFeatureSet) |
| 724 { | 732 { |
| 725 #if ENABLE(OILPAN) | 733 #if ENABLE(OILPAN) |
| 726 visitor->trace(siblingRules); | 734 visitor->trace(siblingRules); |
| 727 visitor->trace(uncommonAttributeRules); | 735 visitor->trace(uncommonAttributeRules); |
| 728 #endif | 736 #endif |
| 729 } | 737 } |
| 730 | 738 |
| 731 } // namespace blink | 739 } // namespace blink |
| OLD | NEW |