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

Unified Diff: Source/core/css/RuleFeature.h

Issue 1111643003: Move StyleInvalidator to StyleEngine. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Avoid calling ensureUpdatedRuleFeatureSet multiple times Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/RuleFeature.h
diff --git a/Source/core/css/RuleFeature.h b/Source/core/css/RuleFeature.h
index 7541f59038c4d9d0bce74e11618e81af353f31af..09b7733d289ae3efc257a42bb7894ffecd469625 100644
--- a/Source/core/css/RuleFeature.h
+++ b/Source/core/css/RuleFeature.h
@@ -25,7 +25,6 @@
#include "core/CoreExport.h"
#include "core/css/CSSSelector.h"
#include "core/css/invalidation/DescendantInvalidationSet.h"
-#include "core/css/invalidation/StyleInvalidator.h"
#include "wtf/Forward.h"
#include "wtf/HashSet.h"
#include "wtf/text/AtomicStringHash.h"
@@ -49,6 +48,8 @@ public:
bool hasDocumentSecurityOrigin;
};
+using InvalidationSetVector = WillBeHeapVector<RefPtrWillBeMember<DescendantInvalidationSet>, 8>;
+
class CORE_EXPORT RuleFeatureSet {
DISALLOW_ALLOCATION();
public:
@@ -82,19 +83,16 @@ public:
bool hasSelectorForId(const AtomicString& idValue) const { return m_idInvalidationSets.contains(idValue); }
bool hasSelectorForPseudoType(CSSSelector::PseudoType pseudo) const { return m_pseudoInvalidationSets.contains(pseudo); }
- void scheduleStyleInvalidationForClassChange(const SpaceSplitString& changedClasses, Element&);
- void scheduleStyleInvalidationForClassChange(const SpaceSplitString& oldClasses, const SpaceSplitString& newClasses, Element&);
- void scheduleStyleInvalidationForAttributeChange(const QualifiedName& attributeName, Element&);
- void scheduleStyleInvalidationForIdChange(const AtomicString& oldId, const AtomicString& newId, Element&);
- void scheduleStyleInvalidationForPseudoChange(CSSSelector::PseudoType, Element&);
+ void collectInvalidationSetsForClass(InvalidationSetVector&, Element&, const AtomicString& className) const;
+ void collectInvalidationSetsForId(InvalidationSetVector&, Element&, const AtomicString& id) const;
+ void collectInvalidationSetsForAttribute(InvalidationSetVector&, Element&, const QualifiedName& attributeName) const;
+ void collectInvalidationSetsForPseudoClass(InvalidationSetVector&, Element&, CSSSelector::PseudoType) const;
bool hasIdsInSelectors() const
{
return m_idInvalidationSets.size() > 0;
}
- StyleInvalidator& styleInvalidator();
-
DECLARE_TRACE();
WillBeHeapVector<RuleFeature> siblingRules;
@@ -104,8 +102,8 @@ protected:
DescendantInvalidationSet* invalidationSetForSelector(const CSSSelector&);
private:
- typedef WillBeHeapHashMap<AtomicString, RefPtrWillBeMember<DescendantInvalidationSet>> InvalidationSetMap;
- typedef WillBeHeapHashMap<CSSSelector::PseudoType, RefPtrWillBeMember<DescendantInvalidationSet>, WTF::IntHash<unsigned>, WTF::UnsignedWithZeroKeyHashTraits<unsigned>> PseudoTypeInvalidationSetMap;
+ using InvalidationSetMap = WillBeHeapHashMap<AtomicString, RefPtrWillBeMember<DescendantInvalidationSet>>;
+ using PseudoTypeInvalidationSetMap = WillBeHeapHashMap<CSSSelector::PseudoType, RefPtrWillBeMember<DescendantInvalidationSet>, WTF::IntHash<unsigned>, WTF::UnsignedWithZeroKeyHashTraits<unsigned>>;
struct FeatureMetadata {
FeatureMetadata()
@@ -173,7 +171,6 @@ private:
InvalidationSetMap m_attributeInvalidationSets;
InvalidationSetMap m_idInvalidationSets;
PseudoTypeInvalidationSetMap m_pseudoInvalidationSets;
- StyleInvalidator m_styleInvalidator;
};
} // namespace blink
« no previous file with comments | « no previous file | Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698