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

Side by Side Diff: third_party/WebKit/Source/core/css/invalidation/InvalidationSet.h

Issue 1717703002: Use invalidation sets to invalidate slotted elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed expected text Created 4 years, 10 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 void setTreeBoundaryCrossing() { m_treeBoundaryCrossing = true; } 103 void setTreeBoundaryCrossing() { m_treeBoundaryCrossing = true; }
104 bool treeBoundaryCrossing() const { return m_treeBoundaryCrossing; } 104 bool treeBoundaryCrossing() const { return m_treeBoundaryCrossing; }
105 105
106 void setInsertionPointCrossing() { m_insertionPointCrossing = true; } 106 void setInsertionPointCrossing() { m_insertionPointCrossing = true; }
107 bool insertionPointCrossing() const { return m_insertionPointCrossing; } 107 bool insertionPointCrossing() const { return m_insertionPointCrossing; }
108 108
109 void setCustomPseudoInvalid() { m_customPseudoInvalid = true; } 109 void setCustomPseudoInvalid() { m_customPseudoInvalid = true; }
110 bool customPseudoInvalid() const { return m_customPseudoInvalid; } 110 bool customPseudoInvalid() const { return m_customPseudoInvalid; }
111 111
112 bool isEmpty() const { return !m_classes && !m_ids && !m_tagNames && !m_attr ibutes && !m_customPseudoInvalid && !m_insertionPointCrossing; } 112 void setInvalidatesSlotted() { m_invalidatesSlotted = true; }
113 bool invalidatesSlotted() const { return m_invalidatesSlotted; }
114
115 bool isEmpty() const { return !m_classes && !m_ids && !m_tagNames && !m_attr ibutes && !m_customPseudoInvalid && !m_insertionPointCrossing && !m_invalidatesS lotted; }
113 116
114 void toTracedValue(TracedValue*) const; 117 void toTracedValue(TracedValue*) const;
115 118
116 #ifndef NDEBUG 119 #ifndef NDEBUG
117 void show() const; 120 void show() const;
118 #endif 121 #endif
119 122
120 const HashSet<AtomicString>& classSetForTesting() const { ASSERT(m_classes); return *m_classes; } 123 const HashSet<AtomicString>& classSetForTesting() const { ASSERT(m_classes); return *m_classes; }
121 const HashSet<AtomicString>& idSetForTesting() const { ASSERT(m_ids); return *m_ids; } 124 const HashSet<AtomicString>& idSetForTesting() const { ASSERT(m_ids); return *m_ids; }
122 const HashSet<AtomicString>& tagNameSetForTesting() const { ASSERT(m_tagName s); return *m_tagNames; } 125 const HashSet<AtomicString>& tagNameSetForTesting() const { ASSERT(m_tagName s); return *m_tagNames; }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 unsigned m_invalidatesSelf : 1; 160 unsigned m_invalidatesSelf : 1;
158 161
159 // If true, all descendants which are custom pseudo elements must be invalid ated. 162 // If true, all descendants which are custom pseudo elements must be invalid ated.
160 unsigned m_customPseudoInvalid : 1; 163 unsigned m_customPseudoInvalid : 1;
161 164
162 // If true, the invalidation must traverse into ShadowRoots with this set. 165 // If true, the invalidation must traverse into ShadowRoots with this set.
163 unsigned m_treeBoundaryCrossing : 1; 166 unsigned m_treeBoundaryCrossing : 1;
164 167
165 // If true, insertion point descendants must be invalidated. 168 // If true, insertion point descendants must be invalidated.
166 unsigned m_insertionPointCrossing : 1; 169 unsigned m_insertionPointCrossing : 1;
170
171 // If true, distributed nodes of <slot> elements need to be invalidated.
172 unsigned m_invalidatesSlotted : 1;
167 }; 173 };
168 174
169 class CORE_EXPORT DescendantInvalidationSet final : public InvalidationSet { 175 class CORE_EXPORT DescendantInvalidationSet final : public InvalidationSet {
170 public: 176 public:
171 static PassRefPtr<DescendantInvalidationSet> create() 177 static PassRefPtr<DescendantInvalidationSet> create()
172 { 178 {
173 return adoptRef(new DescendantInvalidationSet); 179 return adoptRef(new DescendantInvalidationSet);
174 } 180 }
175 181
176 private: 182 private:
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 InvalidationSetVector descendants; 220 InvalidationSetVector descendants;
215 InvalidationSetVector siblings; 221 InvalidationSetVector siblings;
216 }; 222 };
217 223
218 DEFINE_TYPE_CASTS(DescendantInvalidationSet, InvalidationSet, value, value->isDe scendantInvalidationSet(), value.isDescendantInvalidationSet()); 224 DEFINE_TYPE_CASTS(DescendantInvalidationSet, InvalidationSet, value, value->isDe scendantInvalidationSet(), value.isDescendantInvalidationSet());
219 DEFINE_TYPE_CASTS(SiblingInvalidationSet, InvalidationSet, value, value->isSibli ngInvalidationSet(), value.isSiblingInvalidationSet()); 225 DEFINE_TYPE_CASTS(SiblingInvalidationSet, InvalidationSet, value, value->isSibli ngInvalidationSet(), value.isSiblingInvalidationSet());
220 226
221 } // namespace blink 227 } // namespace blink
222 228
223 #endif // InvalidationSet_h 229 #endif // InvalidationSet_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698