| OLD | NEW |
| 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 Loading... |
| 102 element, InvalidationSetMatchedAttribute, *this, attribute); | 102 element, InvalidationSetMatchedAttribute, *this, attribute); |
| 103 return true; | 103 return true; |
| 104 } | 104 } |
| 105 } | 105 } |
| 106 } | 106 } |
| 107 | 107 |
| 108 return false; | 108 return false; |
| 109 } | 109 } |
| 110 | 110 |
| 111 void InvalidationSet::combine(const InvalidationSet& other) { | 111 void InvalidationSet::combine(const InvalidationSet& other) { |
| 112 RELEASE_ASSERT(m_isAlive); | 112 CHECK(m_isAlive); |
| 113 RELEASE_ASSERT(other.m_isAlive); | 113 CHECK(other.m_isAlive); |
| 114 RELEASE_ASSERT(&other != this); | 114 CHECK_NE(&other, this); |
| 115 RELEASE_ASSERT(type() == other.type()); | 115 CHECK_EQ(type(), other.type()); |
| 116 if (type() == InvalidateSiblings) { | 116 if (type() == InvalidateSiblings) { |
| 117 SiblingInvalidationSet& siblings = toSiblingInvalidationSet(*this); | 117 SiblingInvalidationSet& siblings = toSiblingInvalidationSet(*this); |
| 118 const SiblingInvalidationSet& otherSiblings = | 118 const SiblingInvalidationSet& otherSiblings = |
| 119 toSiblingInvalidationSet(other); | 119 toSiblingInvalidationSet(other); |
| 120 | 120 |
| 121 siblings.updateMaxDirectAdjacentSelectors( | 121 siblings.updateMaxDirectAdjacentSelectors( |
| 122 otherSiblings.maxDirectAdjacentSelectors()); | 122 otherSiblings.maxDirectAdjacentSelectors()); |
| 123 if (otherSiblings.siblingDescendants()) | 123 if (otherSiblings.siblingDescendants()) |
| 124 siblings.ensureSiblingDescendants().combine( | 124 siblings.ensureSiblingDescendants().combine( |
| 125 *otherSiblings.siblingDescendants()); | 125 *otherSiblings.siblingDescendants()); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 HashSet<AtomicString>& InvalidationSet::ensureAttributeSet() { | 201 HashSet<AtomicString>& InvalidationSet::ensureAttributeSet() { |
| 202 if (!m_attributes) | 202 if (!m_attributes) |
| 203 m_attributes = WTF::wrapUnique(new HashSet<AtomicString>); | 203 m_attributes = WTF::wrapUnique(new HashSet<AtomicString>); |
| 204 return *m_attributes; | 204 return *m_attributes; |
| 205 } | 205 } |
| 206 | 206 |
| 207 void InvalidationSet::addClass(const AtomicString& className) { | 207 void InvalidationSet::addClass(const AtomicString& className) { |
| 208 if (wholeSubtreeInvalid()) | 208 if (wholeSubtreeInvalid()) |
| 209 return; | 209 return; |
| 210 RELEASE_ASSERT(!className.isEmpty()); | 210 CHECK(!className.isEmpty()); |
| 211 ensureClassSet().insert(className); | 211 ensureClassSet().insert(className); |
| 212 } | 212 } |
| 213 | 213 |
| 214 void InvalidationSet::addId(const AtomicString& id) { | 214 void InvalidationSet::addId(const AtomicString& id) { |
| 215 if (wholeSubtreeInvalid()) | 215 if (wholeSubtreeInvalid()) |
| 216 return; | 216 return; |
| 217 RELEASE_ASSERT(!id.isEmpty()); | 217 CHECK(!id.isEmpty()); |
| 218 ensureIdSet().insert(id); | 218 ensureIdSet().insert(id); |
| 219 } | 219 } |
| 220 | 220 |
| 221 void InvalidationSet::addTagName(const AtomicString& tagName) { | 221 void InvalidationSet::addTagName(const AtomicString& tagName) { |
| 222 if (wholeSubtreeInvalid()) | 222 if (wholeSubtreeInvalid()) |
| 223 return; | 223 return; |
| 224 RELEASE_ASSERT(!tagName.isEmpty()); | 224 CHECK(!tagName.isEmpty()); |
| 225 ensureTagNameSet().insert(tagName); | 225 ensureTagNameSet().insert(tagName); |
| 226 } | 226 } |
| 227 | 227 |
| 228 void InvalidationSet::addAttribute(const AtomicString& attribute) { | 228 void InvalidationSet::addAttribute(const AtomicString& attribute) { |
| 229 if (wholeSubtreeInvalid()) | 229 if (wholeSubtreeInvalid()) |
| 230 return; | 230 return; |
| 231 RELEASE_ASSERT(!attribute.isEmpty()); | 231 CHECK(!attribute.isEmpty()); |
| 232 ensureAttributeSet().insert(attribute); | 232 ensureAttributeSet().insert(attribute); |
| 233 } | 233 } |
| 234 | 234 |
| 235 void InvalidationSet::setWholeSubtreeInvalid() { | 235 void InvalidationSet::setWholeSubtreeInvalid() { |
| 236 if (m_allDescendantsMightBeInvalid) | 236 if (m_allDescendantsMightBeInvalid) |
| 237 return; | 237 return; |
| 238 | 238 |
| 239 m_allDescendantsMightBeInvalid = true; | 239 m_allDescendantsMightBeInvalid = true; |
| 240 m_customPseudoInvalid = false; | 240 m_customPseudoInvalid = false; |
| 241 m_treeBoundaryCrossing = false; | 241 m_treeBoundaryCrossing = false; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 return *m_siblingDescendantInvalidationSet; | 316 return *m_siblingDescendantInvalidationSet; |
| 317 } | 317 } |
| 318 | 318 |
| 319 DescendantInvalidationSet& SiblingInvalidationSet::ensureDescendants() { | 319 DescendantInvalidationSet& SiblingInvalidationSet::ensureDescendants() { |
| 320 if (!m_descendantInvalidationSet) | 320 if (!m_descendantInvalidationSet) |
| 321 m_descendantInvalidationSet = DescendantInvalidationSet::create(); | 321 m_descendantInvalidationSet = DescendantInvalidationSet::create(); |
| 322 return *m_descendantInvalidationSet; | 322 return *m_descendantInvalidationSet; |
| 323 } | 323 } |
| 324 | 324 |
| 325 } // namespace blink | 325 } // namespace blink |
| OLD | NEW |