Index: Source/core/css/invalidation/InvalidationSet.h |
diff --git a/Source/core/css/invalidation/InvalidationSet.h b/Source/core/css/invalidation/InvalidationSet.h |
index 28bc2ce50ffeb8fcf0eab90ed253b34854c900d3..d518e7982936bed74435576384a083c7683609a3 100644 |
--- a/Source/core/css/invalidation/InvalidationSet.h |
+++ b/Source/core/css/invalidation/InvalidationSet.h |
@@ -45,8 +45,8 @@ namespace blink { |
class Element; |
class TracedValue; |
-// Tracks data to determine which elements of a DOM subtree need to have style |
-// recalculated. |
+// Tracks data to determine which descendants in a DOM subtree, or |
+// siblings and their descendants, need to have style recalculated. |
class CORE_EXPORT InvalidationSet final : public RefCountedWillBeGarbageCollected<InvalidationSet> { |
WTF_MAKE_NONCOPYABLE(InvalidationSet); |
public: |
@@ -66,6 +66,10 @@ public: |
void addTagName(const AtomicString& tagName); |
void addAttribute(const AtomicString& attributeLocalName); |
+ const InvalidationSet* descendants() const { return m_descendantInvalidationSet.get(); } |
+ |
+ InvalidationSet& ensureDescendantInvalidationSet(); |
+ |
void setWholeSubtreeInvalid(); |
bool wholeSubtreeInvalid() const { return m_allDescendantsMightBeInvalid; } |
@@ -81,6 +85,9 @@ public: |
void setCustomPseudoInvalid() { m_customPseudoInvalid = true; } |
bool customPseudoInvalid() const { return m_customPseudoInvalid; } |
+ unsigned maxDirectAdjacentSelectors() const { return m_maxDirectAdjacentSelectors; } |
+ void updateMaxDirectAdjacentSelectors(unsigned value) { m_maxDirectAdjacentSelectors = std::max(value, m_maxDirectAdjacentSelectors); } |
+ |
bool isEmpty() const { return !m_classes && !m_ids && !m_tagNames && !m_attributes && !m_customPseudoInvalid; } |
DECLARE_TRACE(); |
@@ -119,6 +126,23 @@ private: |
// If true, insertion point descendants must be invalidated. |
unsigned m_insertionPointCrossing : 1; |
+ |
+ // Only for sibling invalidation sets, indicates the maximum possible number of siblings affected. |
+ unsigned m_maxDirectAdjacentSelectors; |
rune
2015/10/02 13:17:59
Can we use sub-classing instead?
SiblingInvalidat
Eric Willigers
2015/10/14 00:25:40
Done.
|
+ |
+ // Only for sibling invalidation sets, indicates the descendants of siblings. |
+ RefPtrWillBeMember<InvalidationSet> m_descendantInvalidationSet; |
+ |
+ friend class RuleFeatureSetTest; |
+}; |
+ |
+using InvalidationSetVector = WillBeHeapVector<RefPtrWillBeMember<InvalidationSet>>; |
+ |
+struct InvalidationLists { |
+ STACK_ALLOCATED(); |
+ |
+ InvalidationSetVector descendants; |
+ InvalidationSetVector siblings; |
}; |
} // namespace blink |