| OLD | NEW | 
| (Empty) |  | 
 |   1 // Copyright 2015 The Chromium Authors. All rights reserved. | 
 |   2 // Use of this source code is governed by a BSD-style license that can be | 
 |   3 // found in the LICENSE file. | 
 |   4  | 
 |   5 #include "config.h" | 
 |   6 #include "core/css/invalidation/InvalidationData.h" | 
 |   7  | 
 |   8 namespace blink { | 
 |   9  | 
 |  10 DescendantInvalidationSet& InvalidationData::ensureDescendantInvalidationSet() | 
 |  11 { | 
 |  12     if (!m_descendants) | 
 |  13         m_descendants = DescendantInvalidationSet::create(); | 
 |  14     return *m_descendants; | 
 |  15 } | 
 |  16  | 
 |  17 SiblingInvalidationSet& InvalidationData::ensureSiblingInvalidationSet() | 
 |  18 { | 
 |  19     if (!m_siblings) | 
 |  20         m_siblings = SiblingInvalidationSet::create(); | 
 |  21     return *m_siblings; | 
 |  22 } | 
 |  23  | 
 |  24 InvalidationSet& InvalidationData::ensureInvalidationSet(InvalidationType type) | 
 |  25 { | 
 |  26     if (type == InvalidateDescendants) | 
 |  27         return ensureDescendantInvalidationSet(); | 
 |  28  | 
 |  29     return ensureSiblingInvalidationSet(); | 
 |  30 } | 
 |  31  | 
 |  32 void InvalidationData::combine(const InvalidationData& other) | 
 |  33 { | 
 |  34     if (other.descendants()) { | 
 |  35         ensureDescendantInvalidationSet().combine(*other.descendants()); | 
 |  36     } | 
 |  37  | 
 |  38     if (other.siblings()) { | 
 |  39         ensureSiblingInvalidationSet().combine(*other.siblings()); | 
 |  40     } | 
 |  41 } | 
 |  42  | 
 |  43 } // namespace blink | 
| OLD | NEW |