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

Side by Side Diff: Source/core/dom/shadow/SelectRuleFeatureSet.h

Issue 129633003: Add a first pass of a class descendant invalidator, and a containing RuleSetAnalyzer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removed extra line. Created 6 years, 11 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
« Source/core/dom/Element.cpp ('K') | « Source/core/dom/Element.cpp ('k') | no next file » | 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 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 30 matching lines...) Expand all
41 SelectRuleFeatureSet(); 41 SelectRuleFeatureSet();
42 42
43 void add(const SelectRuleFeatureSet&); 43 void add(const SelectRuleFeatureSet&);
44 void clear(); 44 void clear();
45 void collectFeaturesFromSelector(const CSSSelector*); 45 void collectFeaturesFromSelector(const CSSSelector*);
46 46
47 bool hasSelectorForId(const AtomicString&) const; 47 bool hasSelectorForId(const AtomicString&) const;
48 bool hasSelectorForClass(const AtomicString&) const; 48 bool hasSelectorForClass(const AtomicString&) const;
49 bool hasSelectorForAttribute(const AtomicString&) const; 49 bool hasSelectorForAttribute(const AtomicString&) const;
50 50
51 const RuleSetAnalyzer* getRuleSetAnalyzer() const;
52
51 bool hasSelectorForChecked() const { return hasSelectorFor(AffectedSelectorC hecked); } 53 bool hasSelectorForChecked() const { return hasSelectorFor(AffectedSelectorC hecked); }
52 bool hasSelectorForEnabled() const { return hasSelectorFor(AffectedSelectorE nabled); } 54 bool hasSelectorForEnabled() const { return hasSelectorFor(AffectedSelectorE nabled); }
53 bool hasSelectorForDisabled() const { return hasSelectorFor(AffectedSelector Disabled); } 55 bool hasSelectorForDisabled() const { return hasSelectorFor(AffectedSelector Disabled); }
54 bool hasSelectorForIndeterminate() const { return hasSelectorFor(AffectedSel ectorIndeterminate); } 56 bool hasSelectorForIndeterminate() const { return hasSelectorFor(AffectedSel ectorIndeterminate); }
55 bool hasSelectorForLink() const { return hasSelectorFor(AffectedSelectorLink ); } 57 bool hasSelectorForLink() const { return hasSelectorFor(AffectedSelectorLink ); }
56 bool hasSelectorForTarget() const { return hasSelectorFor(AffectedSelectorTa rget); } 58 bool hasSelectorForTarget() const { return hasSelectorFor(AffectedSelectorTa rget); }
57 bool hasSelectorForVisited() const { return hasSelectorFor(AffectedSelectorV isited); } 59 bool hasSelectorForVisited() const { return hasSelectorFor(AffectedSelectorV isited); }
58 60
59 bool hasSelectorFor(AffectedSelectorMask features) const { return m_featureF lags & features; } 61 bool hasSelectorFor(AffectedSelectorMask features) const { return m_featureF lags & features; }
60 62
61 private: 63 private:
62 void setSelectRuleFeature(AffectedSelectorType feature) { m_featureFlags |= feature; } 64 void setSelectRuleFeature(AffectedSelectorType feature) { m_featureFlags |= feature; }
63 65
64 RuleFeatureSet m_cssRuleFeatureSet; 66 RuleFeatureSet m_cssRuleFeatureSet;
65 int m_featureFlags; 67 int m_featureFlags;
66 }; 68 };
67 69
70 inline const RuleSetAnalyzer* SelectRuleFeatureSet::getRuleSetAnalyzer() const
esprehn 2014/01/14 21:32:56 Poor shadow DOM, add a FIXME to make ShadowDOM sma
chrishtr 2014/01/14 23:33:00 Done.
71 {
72 return 0;
73 }
74
68 inline bool SelectRuleFeatureSet::hasSelectorForId(const AtomicString& idValue) const 75 inline bool SelectRuleFeatureSet::hasSelectorForId(const AtomicString& idValue) const
69 { 76 {
70 ASSERT(!idValue.isEmpty()); 77 ASSERT(!idValue.isEmpty());
71 return m_cssRuleFeatureSet.idsInRules.contains(idValue); 78 return m_cssRuleFeatureSet.idsInRules.contains(idValue);
72 } 79 }
73 80
74 inline bool SelectRuleFeatureSet::hasSelectorForClass(const AtomicString& classV alue) const 81 inline bool SelectRuleFeatureSet::hasSelectorForClass(const AtomicString& classV alue) const
75 { 82 {
76 ASSERT(!classValue.isEmpty()); 83 ASSERT(!classValue.isEmpty());
77 return m_cssRuleFeatureSet.classesInRules.contains(classValue); 84 return m_cssRuleFeatureSet.classesInRules.contains(classValue);
78 } 85 }
79 86
80 inline bool SelectRuleFeatureSet::hasSelectorForAttribute(const AtomicString& at tributeName) const 87 inline bool SelectRuleFeatureSet::hasSelectorForAttribute(const AtomicString& at tributeName) const
81 { 88 {
82 ASSERT(!attributeName.isEmpty()); 89 ASSERT(!attributeName.isEmpty());
83 return m_cssRuleFeatureSet.attrsInRules.contains(attributeName); 90 return m_cssRuleFeatureSet.attrsInRules.contains(attributeName);
84 } 91 }
85 92
86 } 93 }
87 94
88 #endif 95 #endif
OLDNEW
« Source/core/dom/Element.cpp ('K') | « Source/core/dom/Element.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698