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

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

Issue 220943002: Use invalidation sets for :hover, :active, and :focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added layout tests Created 6 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
Index: Source/core/css/RuleFeature.h
diff --git a/Source/core/css/RuleFeature.h b/Source/core/css/RuleFeature.h
index b83f357bf04ef89ba6663677dab3e152f6447bb7..5eeb6f1504548ca72ea3c559bef428ed5344729b 100644
--- a/Source/core/css/RuleFeature.h
+++ b/Source/core/css/RuleFeature.h
@@ -22,6 +22,7 @@
#ifndef RuleFeature_h
#define RuleFeature_h
+#include "core/css/CSSSelector.h"
#include "core/css/invalidation/DescendantInvalidationSet.h"
#include "core/css/invalidation/StyleInvalidator.h"
#include "wtf/Forward.h"
@@ -30,7 +31,6 @@
namespace WebCore {
-class CSSSelector;
class CSSSelectorList;
class Document;
class Node;
@@ -87,10 +87,9 @@ public:
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&);
bool hasIdsInSelectors() const
{
@@ -109,6 +108,7 @@ public:
private:
typedef HashMap<AtomicString, RefPtr<DescendantInvalidationSet> > InvalidationSetMap;
+ typedef HashMap<CSSSelector::PseudoType, RefPtr<DescendantInvalidationSet>, WTF::IntHash<unsigned>, WTF::UnsignedWithZeroKeyHashTraits<unsigned> > PseudoTypeInvalidationSetMap;
struct FeatureMetadata {
FeatureMetadata()
@@ -132,13 +132,14 @@ private:
static InvalidationSetMode invalidationSetModeForSelector(const CSSSelector&);
- void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&, InvalidationSetMode);
- void collectFeaturesFromSelectorList(const CSSSelectorList*, FeatureMetadata&, InvalidationSetMode);
+ void collectFeaturesFromSelector(const CSSSelector&, FeatureMetadata&, InvalidationSetMode, bool seenCombinator);
+ void collectFeaturesFromSelectorList(const CSSSelectorList*, FeatureMetadata&, InvalidationSetMode, bool seenCombinator);
DescendantInvalidationSet& ensureClassInvalidationSet(const AtomicString& className);
DescendantInvalidationSet& ensureAttributeInvalidationSet(const AtomicString& attributeName);
DescendantInvalidationSet& ensureIdInvalidationSet(const AtomicString& attributeName);
- DescendantInvalidationSet* invalidationSetForSelector(const CSSSelector&);
+ DescendantInvalidationSet& ensurePseudoInvalidationSet(CSSSelector::PseudoType);
+ DescendantInvalidationSet* invalidationSetForSelector(const CSSSelector&, bool seenCombinator);
InvalidationSetMode updateInvalidationSets(const CSSSelector&);
@@ -161,6 +162,7 @@ private:
InvalidationSetMap m_classInvalidationSets;
InvalidationSetMap m_attributeInvalidationSets;
InvalidationSetMap m_idInvalidationSets;
+ PseudoTypeInvalidationSetMap m_pseudoInvalidationSets;
bool m_targetedStyleRecalcEnabled;
StyleInvalidator m_styleInvalidator;
};

Powered by Google App Engine
This is Rietveld 408576698