| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 } | 55 } |
| 56 | 56 |
| 57 InvalidationSet::InvalidationSet(InvalidationType type) | 57 InvalidationSet::InvalidationSet(InvalidationType type) |
| 58 : m_refCount(1), | 58 : m_refCount(1), |
| 59 m_type(type), | 59 m_type(type), |
| 60 m_allDescendantsMightBeInvalid(false), | 60 m_allDescendantsMightBeInvalid(false), |
| 61 m_invalidatesSelf(false), | 61 m_invalidatesSelf(false), |
| 62 m_customPseudoInvalid(false), | 62 m_customPseudoInvalid(false), |
| 63 m_treeBoundaryCrossing(false), | 63 m_treeBoundaryCrossing(false), |
| 64 m_insertionPointCrossing(false), | 64 m_insertionPointCrossing(false), |
| 65 m_invalidatesSlotted(false) {} | 65 m_invalidatesSlotted(false), |
| 66 m_appliesToRuleSetInvalidations(false) {} |
| 66 | 67 |
| 67 bool InvalidationSet::invalidatesElement(Element& element) const { | 68 bool InvalidationSet::invalidatesElement(Element& element) const { |
| 68 if (m_allDescendantsMightBeInvalid) | 69 if (m_allDescendantsMightBeInvalid) |
| 69 return true; | 70 return true; |
| 70 | 71 |
| 71 if (m_tagNames && m_tagNames->contains(element.tagQName().localName())) { | 72 if (m_tagNames && m_tagNames->contains(element.tagQName().localName())) { |
| 72 TRACE_STYLE_INVALIDATOR_INVALIDATION_SELECTORPART_IF_ENABLED( | 73 TRACE_STYLE_INVALIDATOR_INVALIDATION_SELECTORPART_IF_ENABLED( |
| 73 element, InvalidationSetMatchedTagName, *this, | 74 element, InvalidationSetMatchedTagName, *this, |
| 74 element.tagQName().localName()); | 75 element.tagQName().localName()); |
| 75 return true; | 76 return true; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 143 |
| 143 if (other.treeBoundaryCrossing()) | 144 if (other.treeBoundaryCrossing()) |
| 144 setTreeBoundaryCrossing(); | 145 setTreeBoundaryCrossing(); |
| 145 | 146 |
| 146 if (other.insertionPointCrossing()) | 147 if (other.insertionPointCrossing()) |
| 147 setInsertionPointCrossing(); | 148 setInsertionPointCrossing(); |
| 148 | 149 |
| 149 if (other.invalidatesSlotted()) | 150 if (other.invalidatesSlotted()) |
| 150 setInvalidatesSlotted(); | 151 setInvalidatesSlotted(); |
| 151 | 152 |
| 153 if (other.appliesToRuleSetInvalidations()) |
| 154 setAppliesToRuleSetInvalidations(); |
| 155 |
| 152 if (other.m_classes) { | 156 if (other.m_classes) { |
| 153 for (const auto& className : *other.m_classes) | 157 for (const auto& className : *other.m_classes) |
| 154 addClass(className); | 158 addClass(className); |
| 155 } | 159 } |
| 156 | 160 |
| 157 if (other.m_ids) { | 161 if (other.m_ids) { |
| 158 for (const auto& id : *other.m_ids) | 162 for (const auto& id : *other.m_ids) |
| 159 addId(id); | 163 addId(id); |
| 160 } | 164 } |
| 161 | 165 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 if (m_allDescendantsMightBeInvalid) | 256 if (m_allDescendantsMightBeInvalid) |
| 253 value->setBoolean("allDescendantsMightBeInvalid", true); | 257 value->setBoolean("allDescendantsMightBeInvalid", true); |
| 254 if (m_customPseudoInvalid) | 258 if (m_customPseudoInvalid) |
| 255 value->setBoolean("customPseudoInvalid", true); | 259 value->setBoolean("customPseudoInvalid", true); |
| 256 if (m_treeBoundaryCrossing) | 260 if (m_treeBoundaryCrossing) |
| 257 value->setBoolean("treeBoundaryCrossing", true); | 261 value->setBoolean("treeBoundaryCrossing", true); |
| 258 if (m_insertionPointCrossing) | 262 if (m_insertionPointCrossing) |
| 259 value->setBoolean("insertionPointCrossing", true); | 263 value->setBoolean("insertionPointCrossing", true); |
| 260 if (m_invalidatesSlotted) | 264 if (m_invalidatesSlotted) |
| 261 value->setBoolean("invalidatesSlotted", true); | 265 value->setBoolean("invalidatesSlotted", true); |
| 266 if (m_appliesToRuleSetInvalidations) |
| 267 value->setBoolean("appliesToRuleSetInvalidations", true); |
| 262 | 268 |
| 263 if (m_ids) { | 269 if (m_ids) { |
| 264 value->beginArray("ids"); | 270 value->beginArray("ids"); |
| 265 for (const auto& id : *m_ids) | 271 for (const auto& id : *m_ids) |
| 266 value->pushString(id); | 272 value->pushString(id); |
| 267 value->endArray(); | 273 value->endArray(); |
| 268 } | 274 } |
| 269 | 275 |
| 270 if (m_classes) { | 276 if (m_classes) { |
| 271 value->beginArray("classes"); | 277 value->beginArray("classes"); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 return *m_siblingDescendantInvalidationSet; | 319 return *m_siblingDescendantInvalidationSet; |
| 314 } | 320 } |
| 315 | 321 |
| 316 DescendantInvalidationSet& SiblingInvalidationSet::ensureDescendants() { | 322 DescendantInvalidationSet& SiblingInvalidationSet::ensureDescendants() { |
| 317 if (!m_descendantInvalidationSet) | 323 if (!m_descendantInvalidationSet) |
| 318 m_descendantInvalidationSet = DescendantInvalidationSet::create(); | 324 m_descendantInvalidationSet = DescendantInvalidationSet::create(); |
| 319 return *m_descendantInvalidationSet; | 325 return *m_descendantInvalidationSet; |
| 320 } | 326 } |
| 321 | 327 |
| 322 } // namespace blink | 328 } // namespace blink |
| OLD | NEW |