Chromium Code Reviews| Index: Source/core/css/RuleFeature.h |
| diff --git a/Source/core/css/RuleFeature.h b/Source/core/css/RuleFeature.h |
| index e90bab40ff1ed459d444d0a65beff1ddd7b934c5..ad80b0a68de6c6b7d94072f6e0217ee8e4e180de 100644 |
| --- a/Source/core/css/RuleFeature.h |
| +++ b/Source/core/css/RuleFeature.h |
| @@ -29,10 +29,13 @@ |
| namespace WebCore { |
| +class Document; |
| +class ShadowRoot; |
| class StyleRule; |
| class CSSSelector; |
| class CSSSelectorList; |
| class RuleData; |
| +class SpaceSplitString; |
| struct RuleFeature { |
| RuleFeature(StyleRule* rule, unsigned selectorIndex, bool hasDocumentSecurityOrigin) |
| @@ -79,6 +82,13 @@ public: |
| return m_metadata.idsInRules.contains(idValue); |
| } |
| + // If a class changed on the element, this method should be called in order to schedule style recalc. |
| + void scheduleStyleInvalidationForClassChange(const SpaceSplitString& changedClasses, Element*); |
|
esprehn
2014/01/28 00:11:34
Element&
chrishtr
2014/01/28 01:11:55
Done.
|
| + void scheduleStyleInvalidationForClassChange(const SpaceSplitString& oldClasses, const SpaceSplitString& newClasses, Element*); |
|
esprehn
2014/01/28 00:11:34
Element&
chrishtr
2014/01/28 01:11:55
Done.
|
| + |
| + // Computes which elements in the document need style recalculation. |
| + void computeStyleInvalidation(Document*); |
|
esprehn
2014/01/28 00:11:34
Document&
chrishtr
2014/01/28 01:11:55
Done.
|
| + |
| int hasIdsInSelectors() const |
| { |
| return m_metadata.idsInRules.size() > 0; |
| @@ -93,6 +103,8 @@ public: |
| private: |
| typedef HashMap<AtomicString, RefPtr<DescendantInvalidationSet> > InvalidationSetMap; |
| + typedef Vector<DescendantInvalidationSet*> InvalidationVec; |
|
esprehn
2014/01/28 00:11:34
Don't use abbreviations like Vec. I'd use Invalida
chrishtr
2014/01/28 01:11:55
Done.
|
| + typedef HashMap<Element*, InvalidationVec* > PendingInvalidationMap; |
|
esprehn
2014/01/28 00:11:34
No need for the space before >
chrishtr
2014/01/28 01:11:55
Done.
|
| struct FeatureMetadata { |
| FeatureMetadata() |
| : usesFirstLineRules(false) |
| @@ -110,13 +122,28 @@ private: |
| HashSet<AtomicString> attrsInRules; |
| }; |
| + // These return true if setNeedsStyleRecalc() should be run on the Element, as a fallback. |
| + bool scheduleStyleInvalidationForClassChangeInternal(const SpaceSplitString& changedClasses, Element*); |
| + bool scheduleStyleInvalidationForClassChangeInternal(const SpaceSplitString& oldClasses, const SpaceSplitString& newClasses, Element*); |
|
esprehn
2014/01/28 00:11:34
Same, these should all take refs.
chrishtr
2014/01/28 01:11:55
The Element pointer is the key to the invalidation
|
| + |
| void collectFeaturesFromSelector(const CSSSelector*, FeatureMetadata&); |
| void collectFeaturesFromSelectorList(const CSSSelectorList*, FeatureMetadata&); |
| + |
| DescendantInvalidationSet& ensureClassInvalidationSet(const AtomicString& className); |
| bool updateClassInvalidationSets(const CSSSelector*); |
| - InvalidationSetMap m_classInvalidationSets; |
| + void scheduleStyleInvalidationForOneClass(const AtomicString& className, Element*); |
| + |
| + bool computeStyleInvalidationInternal(Element*, Vector<AtomicString>&, bool foundInvalidationSet); |
| + bool computeStyleInvalidationForChildren(Element*, Vector<AtomicString>& invalidationClasses, bool foundInvalidationSet); |
| + |
| + InvalidationVec* ensurePendingInvalidationVector(Element*); |
| + |
| FeatureMetadata m_metadata; |
| + |
| + InvalidationSetMap m_classInvalidationSets; |
| + |
| + PendingInvalidationMap m_pendingInvalidationMap; |
| }; |
| } // namespace WebCore |