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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 if (UNLIKELY(*s_tracingEnabled)) \ | 46 if (UNLIKELY(*s_tracingEnabled)) \ |
47 TRACE_STYLE_INVALIDATOR_INVALIDATION_SELECTORPART(element, reason, inval
idationSet, singleSelectorPart); | 47 TRACE_STYLE_INVALIDATOR_INVALIDATION_SELECTORPART(element, reason, inval
idationSet, singleSelectorPart); |
48 | 48 |
49 void InvalidationSet::cacheTracingFlag() | 49 void InvalidationSet::cacheTracingFlag() |
50 { | 50 { |
51 s_tracingEnabled = TRACE_EVENT_API_GET_CATEGORY_ENABLED(TRACE_DISABLED_BY_DE
FAULT("devtools.timeline.invalidationTracking")); | 51 s_tracingEnabled = TRACE_EVENT_API_GET_CATEGORY_ENABLED(TRACE_DISABLED_BY_DE
FAULT("devtools.timeline.invalidationTracking")); |
52 } | 52 } |
53 | 53 |
54 InvalidationSet::InvalidationSet() | 54 InvalidationSet::InvalidationSet() |
55 : m_allDescendantsMightBeInvalid(false) | 55 : m_allDescendantsMightBeInvalid(false) |
| 56 , m_invalidatesSelf(false) |
56 , m_customPseudoInvalid(false) | 57 , m_customPseudoInvalid(false) |
57 , m_treeBoundaryCrossing(false) | 58 , m_treeBoundaryCrossing(false) |
58 , m_insertionPointCrossing(false) | 59 , m_insertionPointCrossing(false) |
59 { | 60 { |
60 } | 61 } |
61 | 62 |
62 bool InvalidationSet::invalidatesElement(Element& element) const | 63 bool InvalidationSet::invalidatesElement(Element& element) const |
63 { | 64 { |
64 if (m_allDescendantsMightBeInvalid) | 65 if (m_allDescendantsMightBeInvalid) |
65 return true; | 66 return true; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 { | 101 { |
101 // No longer bother combining data structures, since the whole subtree is de
emed invalid. | 102 // No longer bother combining data structures, since the whole subtree is de
emed invalid. |
102 if (wholeSubtreeInvalid()) | 103 if (wholeSubtreeInvalid()) |
103 return; | 104 return; |
104 | 105 |
105 if (other.wholeSubtreeInvalid()) { | 106 if (other.wholeSubtreeInvalid()) { |
106 setWholeSubtreeInvalid(); | 107 setWholeSubtreeInvalid(); |
107 return; | 108 return; |
108 } | 109 } |
109 | 110 |
| 111 if (other.invalidatesSelf()) |
| 112 setInvalidatesSelf(); |
| 113 |
110 if (other.customPseudoInvalid()) | 114 if (other.customPseudoInvalid()) |
111 setCustomPseudoInvalid(); | 115 setCustomPseudoInvalid(); |
112 | 116 |
113 if (other.treeBoundaryCrossing()) | 117 if (other.treeBoundaryCrossing()) |
114 setTreeBoundaryCrossing(); | 118 setTreeBoundaryCrossing(); |
115 | 119 |
116 if (other.insertionPointCrossing()) | 120 if (other.insertionPointCrossing()) |
117 setInsertionPointCrossing(); | 121 setInsertionPointCrossing(); |
118 | 122 |
119 if (other.m_classes) { | 123 if (other.m_classes) { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 { | 273 { |
270 RefPtr<TracedValue> value = TracedValue::create(); | 274 RefPtr<TracedValue> value = TracedValue::create(); |
271 value->beginArray("InvalidationSet"); | 275 value->beginArray("InvalidationSet"); |
272 toTracedValue(value.get()); | 276 toTracedValue(value.get()); |
273 value->endArray(); | 277 value->endArray(); |
274 fprintf(stderr, "%s\n", value->asTraceFormat().ascii().data()); | 278 fprintf(stderr, "%s\n", value->asTraceFormat().ascii().data()); |
275 } | 279 } |
276 #endif // NDEBUG | 280 #endif // NDEBUG |
277 | 281 |
278 } // namespace blink | 282 } // namespace blink |
OLD | NEW |