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

Side by Side Diff: Source/core/css/invalidation/DescendantInvalidationSet.h

Issue 1317533002: Sibling invalidation sets (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: CORE_EXPORT Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 void setTreeBoundaryCrossing() { m_treeBoundaryCrossing = true; } 72 void setTreeBoundaryCrossing() { m_treeBoundaryCrossing = true; }
73 bool treeBoundaryCrossing() const { return m_treeBoundaryCrossing; } 73 bool treeBoundaryCrossing() const { return m_treeBoundaryCrossing; }
74 74
75 void setInsertionPointCrossing() { m_insertionPointCrossing = true; } 75 void setInsertionPointCrossing() { m_insertionPointCrossing = true; }
76 bool insertionPointCrossing() const { return m_insertionPointCrossing; } 76 bool insertionPointCrossing() const { return m_insertionPointCrossing; }
77 77
78 void setCustomPseudoInvalid() { m_customPseudoInvalid = true; } 78 void setCustomPseudoInvalid() { m_customPseudoInvalid = true; }
79 bool customPseudoInvalid() const { return m_customPseudoInvalid; } 79 bool customPseudoInvalid() const { return m_customPseudoInvalid; }
80 80
81 unsigned maxDirectAdjacentSelectors() const { return m_maxDirectAdjacentSele ctors; }
82 void setMaxDirectAdjacentSelectors(unsigned value) { m_maxDirectAdjacentSele ctors = std::max(value, m_maxDirectAdjacentSelectors); }
83
81 bool isEmpty() const { return !m_classes && !m_ids && !m_tagNames && !m_attr ibutes && !m_customPseudoInvalid; } 84 bool isEmpty() const { return !m_classes && !m_ids && !m_tagNames && !m_attr ibutes && !m_customPseudoInvalid; }
82 85
83 DECLARE_TRACE(); 86 DECLARE_TRACE();
84 87
85 void toTracedValue(TracedValue*) const; 88 void toTracedValue(TracedValue*) const;
86 89
87 #ifndef NDEBUG 90 #ifndef NDEBUG
88 void show() const; 91 void show() const;
89 #endif 92 #endif
90 93
91 private: 94 private:
92 DescendantInvalidationSet(); 95 DescendantInvalidationSet();
93 96
94 WillBeHeapHashSet<AtomicString>& ensureClassSet(); 97 WillBeHeapHashSet<AtomicString>& ensureClassSet();
95 WillBeHeapHashSet<AtomicString>& ensureIdSet(); 98 WillBeHeapHashSet<AtomicString>& ensureIdSet();
96 WillBeHeapHashSet<AtomicString>& ensureTagNameSet(); 99 WillBeHeapHashSet<AtomicString>& ensureTagNameSet();
97 WillBeHeapHashSet<AtomicString>& ensureAttributeSet(); 100 WillBeHeapHashSet<AtomicString>& ensureAttributeSet();
98 101
99 // FIXME: optimize this if it becomes a memory issue. 102 // FIXME: optimize this if it becomes a memory issue.
100 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_classes; 103 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_classes;
101 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_ids; 104 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_ids;
102 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_tagNames; 105 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_tagNames;
103 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_attributes; 106 OwnPtrWillBeMember<WillBeHeapHashSet<AtomicString>> m_attributes;
104 107
108 unsigned m_maxDirectAdjacentSelectors;
109
105 // If true, all descendants might be invalidated, so a full subtree recalc i s required. 110 // If true, all descendants might be invalidated, so a full subtree recalc i s required.
106 unsigned m_allDescendantsMightBeInvalid : 1; 111 unsigned m_allDescendantsMightBeInvalid : 1;
107 112
108 // If true, all descendants which are custom pseudo elements must be invalid ated. 113 // If true, all descendants which are custom pseudo elements must be invalid ated.
109 unsigned m_customPseudoInvalid : 1; 114 unsigned m_customPseudoInvalid : 1;
110 115
111 // If true, the invalidation must traverse into ShadowRoots with this set. 116 // If true, the invalidation must traverse into ShadowRoots with this set.
112 unsigned m_treeBoundaryCrossing : 1; 117 unsigned m_treeBoundaryCrossing : 1;
113 118
114 // If true, insertion point descendants must be invalidated. 119 // If true, insertion point descendants must be invalidated.
115 unsigned m_insertionPointCrossing : 1; 120 unsigned m_insertionPointCrossing : 1;
121
122 friend class RuleFeatureSetTest;
116 }; 123 };
117 124
118 } // namespace blink 125 } // namespace blink
119 126
120 #endif // DescendantInvalidationSet_h 127 #endif // DescendantInvalidationSet_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698