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

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

Issue 2303443003: CSS: Additional asserts for style invalidation (Closed)
Patch Set: Created 4 years, 3 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 return true; 97 return true;
98 } 98 }
99 } 99 }
100 } 100 }
101 101
102 return false; 102 return false;
103 } 103 }
104 104
105 void InvalidationSet::combine(const InvalidationSet& other) 105 void InvalidationSet::combine(const InvalidationSet& other)
106 { 106 {
107 ASSERT(type() == other.type()); 107 RELEASE_ASSERT(m_isAlive);
108 RELEASE_ASSERT(other.m_isAlive);
109 RELEASE_ASSERT(type() == other.type());
108 if (type() == InvalidateSiblings) { 110 if (type() == InvalidateSiblings) {
109 SiblingInvalidationSet& siblings = toSiblingInvalidationSet(*this); 111 SiblingInvalidationSet& siblings = toSiblingInvalidationSet(*this);
110 const SiblingInvalidationSet& otherSiblings = toSiblingInvalidationSet(o ther); 112 const SiblingInvalidationSet& otherSiblings = toSiblingInvalidationSet(o ther);
111 113
112 siblings.updateMaxDirectAdjacentSelectors(otherSiblings.maxDirectAdjacen tSelectors()); 114 siblings.updateMaxDirectAdjacentSelectors(otherSiblings.maxDirectAdjacen tSelectors());
113 if (otherSiblings.siblingDescendants()) 115 if (otherSiblings.siblingDescendants())
114 siblings.ensureSiblingDescendants().combine(*otherSiblings.siblingDe scendants()); 116 siblings.ensureSiblingDescendants().combine(*otherSiblings.siblingDe scendants());
115 if (otherSiblings.descendants()) 117 if (otherSiblings.descendants())
116 siblings.ensureDescendants().combine(*otherSiblings.descendants()); 118 siblings.ensureDescendants().combine(*otherSiblings.descendants());
117 } 119 }
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 } 317 }
316 318
317 DescendantInvalidationSet& SiblingInvalidationSet::ensureDescendants() 319 DescendantInvalidationSet& SiblingInvalidationSet::ensureDescendants()
318 { 320 {
319 if (!m_descendantInvalidationSet) 321 if (!m_descendantInvalidationSet)
320 m_descendantInvalidationSet = DescendantInvalidationSet::create(); 322 m_descendantInvalidationSet = DescendantInvalidationSet::create();
321 return *m_descendantInvalidationSet; 323 return *m_descendantInvalidationSet;
322 } 324 }
323 325
324 } // namespace blink 326 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698