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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 s_tracingEnabled = TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(TRACE_DISABLED
_BY_DEFAULT("devtools.timeline.invalidationTracking")); | 50 s_tracingEnabled = TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(TRACE_DISABLED
_BY_DEFAULT("devtools.timeline.invalidationTracking")); |
51 } | 51 } |
52 | 52 |
53 InvalidationSet::InvalidationSet(InvalidationType type) | 53 InvalidationSet::InvalidationSet(InvalidationType type) |
54 : m_type(type) | 54 : m_type(type) |
55 , m_allDescendantsMightBeInvalid(false) | 55 , m_allDescendantsMightBeInvalid(false) |
56 , m_invalidatesSelf(false) | 56 , m_invalidatesSelf(false) |
57 , m_customPseudoInvalid(false) | 57 , m_customPseudoInvalid(false) |
58 , m_treeBoundaryCrossing(false) | 58 , m_treeBoundaryCrossing(false) |
59 , m_insertionPointCrossing(false) | 59 , m_insertionPointCrossing(false) |
| 60 , m_invalidatesSlotted(false) |
60 { | 61 { |
61 } | 62 } |
62 | 63 |
63 bool InvalidationSet::invalidatesElement(Element& element) const | 64 bool InvalidationSet::invalidatesElement(Element& element) const |
64 { | 65 { |
65 if (m_allDescendantsMightBeInvalid) | 66 if (m_allDescendantsMightBeInvalid) |
66 return true; | 67 return true; |
67 | 68 |
68 if (m_tagNames && m_tagNames->contains(element.tagQName().localName())) { | 69 if (m_tagNames && m_tagNames->contains(element.tagQName().localName())) { |
69 TRACE_STYLE_INVALIDATOR_INVALIDATION_SELECTORPART_IF_ENABLED(element, In
validationSetMatchedTagName, *this, element.tagQName().localName()); | 70 TRACE_STYLE_INVALIDATOR_INVALIDATION_SELECTORPART_IF_ENABLED(element, In
validationSetMatchedTagName, *this, element.tagQName().localName()); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 126 |
126 if (other.customPseudoInvalid()) | 127 if (other.customPseudoInvalid()) |
127 setCustomPseudoInvalid(); | 128 setCustomPseudoInvalid(); |
128 | 129 |
129 if (other.treeBoundaryCrossing()) | 130 if (other.treeBoundaryCrossing()) |
130 setTreeBoundaryCrossing(); | 131 setTreeBoundaryCrossing(); |
131 | 132 |
132 if (other.insertionPointCrossing()) | 133 if (other.insertionPointCrossing()) |
133 setInsertionPointCrossing(); | 134 setInsertionPointCrossing(); |
134 | 135 |
| 136 if (other.invalidatesSlotted()) |
| 137 setInvalidatesSlotted(); |
| 138 |
135 if (other.m_classes) { | 139 if (other.m_classes) { |
136 for (const auto& className : *other.m_classes) | 140 for (const auto& className : *other.m_classes) |
137 addClass(className); | 141 addClass(className); |
138 } | 142 } |
139 | 143 |
140 if (other.m_ids) { | 144 if (other.m_ids) { |
141 for (const auto& id : *other.m_ids) | 145 for (const auto& id : *other.m_ids) |
142 addId(id); | 146 addId(id); |
143 } | 147 } |
144 | 148 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 223 |
220 void InvalidationSet::setWholeSubtreeInvalid() | 224 void InvalidationSet::setWholeSubtreeInvalid() |
221 { | 225 { |
222 if (m_allDescendantsMightBeInvalid) | 226 if (m_allDescendantsMightBeInvalid) |
223 return; | 227 return; |
224 | 228 |
225 m_allDescendantsMightBeInvalid = true; | 229 m_allDescendantsMightBeInvalid = true; |
226 m_customPseudoInvalid = false; | 230 m_customPseudoInvalid = false; |
227 m_treeBoundaryCrossing = false; | 231 m_treeBoundaryCrossing = false; |
228 m_insertionPointCrossing = false; | 232 m_insertionPointCrossing = false; |
| 233 m_invalidatesSlotted = false; |
229 m_classes = nullptr; | 234 m_classes = nullptr; |
230 m_ids = nullptr; | 235 m_ids = nullptr; |
231 m_tagNames = nullptr; | 236 m_tagNames = nullptr; |
232 m_attributes = nullptr; | 237 m_attributes = nullptr; |
233 } | 238 } |
234 | 239 |
235 void InvalidationSet::toTracedValue(TracedValue* value) const | 240 void InvalidationSet::toTracedValue(TracedValue* value) const |
236 { | 241 { |
237 value->beginDictionary(); | 242 value->beginDictionary(); |
238 | 243 |
239 value->setString("id", descendantInvalidationSetToIdString(*this)); | 244 value->setString("id", descendantInvalidationSetToIdString(*this)); |
240 | 245 |
241 if (m_allDescendantsMightBeInvalid) | 246 if (m_allDescendantsMightBeInvalid) |
242 value->setBoolean("allDescendantsMightBeInvalid", true); | 247 value->setBoolean("allDescendantsMightBeInvalid", true); |
243 if (m_customPseudoInvalid) | 248 if (m_customPseudoInvalid) |
244 value->setBoolean("customPseudoInvalid", true); | 249 value->setBoolean("customPseudoInvalid", true); |
245 if (m_treeBoundaryCrossing) | 250 if (m_treeBoundaryCrossing) |
246 value->setBoolean("treeBoundaryCrossing", true); | 251 value->setBoolean("treeBoundaryCrossing", true); |
247 if (m_insertionPointCrossing) | 252 if (m_insertionPointCrossing) |
248 value->setBoolean("insertionPointCrossing", true); | 253 value->setBoolean("insertionPointCrossing", true); |
| 254 if (m_invalidatesSlotted) |
| 255 value->setBoolean("invalidatesSlotted", true); |
249 | 256 |
250 if (m_ids) { | 257 if (m_ids) { |
251 value->beginArray("ids"); | 258 value->beginArray("ids"); |
252 for (const auto& id : *m_ids) | 259 for (const auto& id : *m_ids) |
253 value->pushString(id); | 260 value->pushString(id); |
254 value->endArray(); | 261 value->endArray(); |
255 } | 262 } |
256 | 263 |
257 if (m_classes) { | 264 if (m_classes) { |
258 value->beginArray("classes"); | 265 value->beginArray("classes"); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 } | 311 } |
305 | 312 |
306 DescendantInvalidationSet& SiblingInvalidationSet::ensureDescendants() | 313 DescendantInvalidationSet& SiblingInvalidationSet::ensureDescendants() |
307 { | 314 { |
308 if (!m_descendantInvalidationSet) | 315 if (!m_descendantInvalidationSet) |
309 m_descendantInvalidationSet = DescendantInvalidationSet::create(); | 316 m_descendantInvalidationSet = DescendantInvalidationSet::create(); |
310 return *m_descendantInvalidationSet; | 317 return *m_descendantInvalidationSet; |
311 } | 318 } |
312 | 319 |
313 } // namespace blink | 320 } // namespace blink |
OLD | NEW |