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

Unified Diff: Source/core/css/resolver/SharedStyleFinder.h

Issue 29633003: Avoid style sharing with mis-matched descendant selectors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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/resolver/SharedStyleFinder.h
diff --git a/Source/core/css/resolver/SharedStyleFinder.h b/Source/core/css/resolver/SharedStyleFinder.h
index 1e123750427cb2c4363bbed0367440a3de2119ff..47e4d9f26a13919bc21eb9aab9120bc6eef6bdd7 100644
--- a/Source/core/css/resolver/SharedStyleFinder.h
+++ b/Source/core/css/resolver/SharedStyleFinder.h
@@ -38,11 +38,12 @@ public:
// RuleSets are passed non-const as the act of matching against them can cause them
// to be compacted. :(
SharedStyleFinder(const RuleFeatureSet& features, RuleSet* siblingRuleSet,
- RuleSet* uncommonAttributeRuleSet, StyleResolver* styleResolver)
+ RuleSet* uncommonAttributeRuleSet, RuleSet* descendantRuleSet, StyleResolver* styleResolver)
: m_elementAffectedByClassRules(false)
, m_features(features)
, m_siblingRuleSet(siblingRuleSet)
, m_uncommonAttributeRuleSet(uncommonAttributeRuleSet)
+ , m_descendantRuleSet(descendantRuleSet)
, m_styleResolver(styleResolver)
{ }
@@ -61,11 +62,13 @@ private:
bool canShareStyleWithControl(const ElementResolveContext&, Element*) const;
bool sharingCandidateHasIdenticalStyleAffectingAttributes(const ElementResolveContext&, Element*) const;
bool matchesRuleSet(const ElementResolveContext&, RuleSet*);
+ bool candidateMatchesDescendantRules(const ElementResolveContext&, Element*) const;
bool m_elementAffectedByClassRules;
const RuleFeatureSet& m_features;
RuleSet* m_siblingRuleSet;
RuleSet* m_uncommonAttributeRuleSet;
+ RuleSet* m_descendantRuleSet;
StyleResolver* m_styleResolver;
};

Powered by Google App Engine
This is Rietveld 408576698