| 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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 if (simpleSelector.isHostPseudoClass()) | 646 if (simpleSelector.isHostPseudoClass()) |
| 647 descendantFeatures.treeBoundaryCrossing = true; | 647 descendantFeatures.treeBoundaryCrossing = true; |
| 648 if (simpleSelector.isInsertionPointCrossing()) | 648 if (simpleSelector.isInsertionPointCrossing()) |
| 649 descendantFeatures.insertionPointCrossing = true; | 649 descendantFeatures.insertionPointCrossing = true; |
| 650 | 650 |
| 651 addFeaturesToInvalidationSetsForSelectorList(simpleSelector, siblingFeatures
, descendantFeatures); | 651 addFeaturesToInvalidationSetsForSelectorList(simpleSelector, siblingFeatures
, descendantFeatures); |
| 652 } | 652 } |
| 653 | 653 |
| 654 const CSSSelector* RuleFeatureSet::addFeaturesToInvalidationSetsForCompoundSelec
tor(const CSSSelector& compound, InvalidationSetFeatures* siblingFeatures, Inval
idationSetFeatures& descendantFeatures) | 654 const CSSSelector* RuleFeatureSet::addFeaturesToInvalidationSetsForCompoundSelec
tor(const CSSSelector& compound, InvalidationSetFeatures* siblingFeatures, Inval
idationSetFeatures& descendantFeatures) |
| 655 { | 655 { |
| 656 bool compoundHasTagIdClassOrAttribute = false; | 656 bool compoundHasIdClassOrAttribute = false; |
| 657 const CSSSelector* simpleSelector = &compound; | 657 const CSSSelector* simpleSelector = &compound; |
| 658 for (; simpleSelector; simpleSelector = simpleSelector->tagHistory()) { | 658 for (; simpleSelector; simpleSelector = simpleSelector->tagHistory()) { |
| 659 addFeaturesToInvalidationSetsForSimpleSelector(*simpleSelector, siblingF
eatures, descendantFeatures); | 659 addFeaturesToInvalidationSetsForSimpleSelector(*simpleSelector, siblingF
eatures, descendantFeatures); |
| 660 if (siblingFeatures) | 660 if (siblingFeatures) |
| 661 compoundHasTagIdClassOrAttribute |= simpleSelector->isIdClassOrAttri
buteSelector(); | 661 compoundHasIdClassOrAttribute |= simpleSelector->isIdClassOrAttribut
eSelector(); |
| 662 if (simpleSelector->relation() != CSSSelector::SubSelector) | 662 if (simpleSelector->relation() != CSSSelector::SubSelector) |
| 663 break; | 663 break; |
| 664 if (!simpleSelector->tagHistory()) | 664 if (!simpleSelector->tagHistory()) |
| 665 break; | 665 break; |
| 666 } | 666 } |
| 667 | 667 |
| 668 if (siblingFeatures && !compoundHasTagIdClassOrAttribute) | 668 if (siblingFeatures && !compoundHasIdClassOrAttribute) |
| 669 addFeaturesToUniversalSiblingInvalidationSet(*siblingFeatures, descendan
tFeatures); | 669 addFeaturesToUniversalSiblingInvalidationSet(*siblingFeatures, descendan
tFeatures); |
| 670 | 670 |
| 671 return simpleSelector; | 671 return simpleSelector; |
| 672 } | 672 } |
| 673 | 673 |
| 674 void RuleFeatureSet::addFeaturesToInvalidationSets(const CSSSelector& selector,
InvalidationSetFeatures& descendantFeatures) | 674 void RuleFeatureSet::addFeaturesToInvalidationSets(const CSSSelector& selector,
InvalidationSetFeatures& descendantFeatures) |
| 675 { | 675 { |
| 676 // selector is the selector immediately to the left of the rightmost combina
tor. | 676 // selector is the selector immediately to the left of the rightmost combina
tor. |
| 677 // descendantFeatures has the features of the rightmost compound selector. | 677 // descendantFeatures has the features of the rightmost compound selector. |
| 678 | 678 |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 bool RuleFeatureSet::InvalidationSetFeatures::hasFeatures() const | 1034 bool RuleFeatureSet::InvalidationSetFeatures::hasFeatures() const |
| 1035 { | 1035 { |
| 1036 return !classes.isEmpty() | 1036 return !classes.isEmpty() |
| 1037 || !attributes.isEmpty() | 1037 || !attributes.isEmpty() |
| 1038 || !ids.isEmpty() | 1038 || !ids.isEmpty() |
| 1039 || !tagNames.isEmpty() | 1039 || !tagNames.isEmpty() |
| 1040 || customPseudoElement; | 1040 || customPseudoElement; |
| 1041 } | 1041 } |
| 1042 | 1042 |
| 1043 } // namespace blink | 1043 } // namespace blink |
| OLD | NEW |