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

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

Issue 208323003: Add support for attribute selectors in TargetedStyleRecalc. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix compilation Created 6 years, 9 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 fa3037958cebc803bde2939008d2edf747d5f1ad..360ccf5f7553b75357c5a356a210dc1801b16f75 100644
--- a/Source/core/css/RuleFeature.h
+++ b/Source/core/css/RuleFeature.h
@@ -29,14 +29,15 @@
namespace WebCore {
-class Document;
-class Node;
-class ShadowRoot;
-class StyleRule;
class CSSSelector;
class CSSSelectorList;
+class Document;
+class Node;
+class QualifiedName;
class RuleData;
+class ShadowRoot;
class SpaceSplitString;
+class StyleRule;
struct RuleFeature {
RuleFeature(StyleRule* rule, unsigned selectorIndex, bool hasDocumentSecurityOrigin)
@@ -69,7 +70,7 @@ public:
inline bool hasSelectorForAttribute(const AtomicString& attributeName) const
{
ASSERT(!attributeName.isEmpty());
- return m_metadata.attrsInRules.contains(attributeName);
+ return m_attributeInvalidationSets.get(attributeName);
}
inline bool hasSelectorForClass(const AtomicString& classValue) const
@@ -86,6 +87,8 @@ public:
void scheduleStyleInvalidationForClassChange(const SpaceSplitString& changedClasses, Element*);
void scheduleStyleInvalidationForClassChange(const SpaceSplitString& oldClasses, const SpaceSplitString& newClasses, Element*);
+ void scheduleStyleInvalidationForAttributeChange(const QualifiedName& attributeName, Element*);
+
// Clears all style invalidation state for the passed node.
void clearStyleInvalidation(Node*);
@@ -96,7 +99,8 @@ public:
// Marks the given attribute name as "appearing in a selector". Used for
// CSS properties such as content: ... attr(...) ...
- void addAttributeInASelector(const AtomicString& attributeName);
+ // FIXME: record these internally to this class instead calls from StyleResolver to here.
+ void addContentAttr(const AtomicString& attributeName);
Vector<RuleFeature> siblingRules;
Vector<RuleFeature> uncommonAttributeRules;
@@ -122,7 +126,6 @@ private:
bool foundSiblingSelector;
unsigned maxDirectAdjacentSelectors;
HashSet<AtomicString> idsInRules;
- HashSet<AtomicString> attrsInRules;
};
enum InvalidationSetMode {
@@ -137,7 +140,10 @@ private:
void collectFeaturesFromSelectorList(const CSSSelectorList*, FeatureMetadata&, InvalidationSetMode);
DescendantInvalidationSet& ensureClassInvalidationSet(const AtomicString& className);
- InvalidationSetMode updateClassInvalidationSets(const CSSSelector&);
+ DescendantInvalidationSet& ensureAttributeInvalidationSet(const AtomicString& className);
+ DescendantInvalidationSet* invalidationSetForSelector(const CSSSelector&);
+
+ InvalidationSetMode updateInvalidationSets(const CSSSelector&);
void addClassToInvalidationSet(const AtomicString& className, Element*);
@@ -145,6 +151,8 @@ private:
FeatureMetadata m_metadata;
InvalidationSetMap m_classInvalidationSets;
+ InvalidationSetMap m_attributeInvalidationSets;
+
PendingInvalidationMap m_pendingInvalidationMap;
bool m_targetedStyleRecalcEnabled;
« no previous file with comments | « LayoutTests/fast/css/invalidation/targeted-attribute-style-invalidation-expected.txt ('k') | Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698