OLD | NEW |
---|---|
1 | 1 |
2 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #include "config.h" | 6 #include "config.h" |
7 | 7 |
8 #include "core/css/invalidation/StyleInvalidator.h" | 8 #include "core/css/invalidation/StyleInvalidator.h" |
9 | 9 |
10 #include "core/css/invalidation/DescendantInvalidationSet.h" | 10 #include "core/css/invalidation/DescendantInvalidationSet.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 { | 138 { |
139 RecursionCheckpoint checkpoint(&recursionData); | 139 RecursionCheckpoint checkpoint(&recursionData); |
140 | 140 |
141 bool thisElementNeedsStyleRecalc = checkInvalidationSetsAgainstElement(eleme nt, recursionData); | 141 bool thisElementNeedsStyleRecalc = checkInvalidationSetsAgainstElement(eleme nt, recursionData); |
142 | 142 |
143 bool someChildrenNeedStyleRecalc = false; | 143 bool someChildrenNeedStyleRecalc = false; |
144 if (recursionData.hasInvalidationSets() || element.childNeedsStyleInvalidati on()) | 144 if (recursionData.hasInvalidationSets() || element.childNeedsStyleInvalidati on()) |
145 someChildrenNeedStyleRecalc = invalidateChildren(element, recursionData) ; | 145 someChildrenNeedStyleRecalc = invalidateChildren(element, recursionData) ; |
146 | 146 |
147 if (thisElementNeedsStyleRecalc) { | 147 if (thisElementNeedsStyleRecalc) { |
148 element.setNeedsStyleRecalc(recursionData.wholeSubtreeInvalid() ? Subtre eStyleChange : LocalStyleChange); | 148 element.setNeedsStyleRecalc(StyleChangeReasonForTracing::StyleInvalidato r, recursionData.wholeSubtreeInvalid() ? SubtreeStyleChange : LocalStyleChange); |
esprehn
2014/09/19 04:53:09
I'm not sure this is really adding value for devel
kouhei (in TOK)
2014/09/22 09:03:54
This is to be addressed in next CL. I’m adding Tra
| |
149 } else if (recursionData.hasInvalidationSets() && someChildrenNeedStyleRecal c) { | 149 } else if (recursionData.hasInvalidationSets() && someChildrenNeedStyleRecal c) { |
150 // Clone the RenderStyle in order to preserve correct style sharing, if possible. Otherwise recalc style. | 150 // Clone the RenderStyle in order to preserve correct style sharing, if possible. Otherwise recalc style. |
151 if (RenderObject* renderer = element.renderer()) | 151 if (RenderObject* renderer = element.renderer()) |
152 renderer->setStyleInternal(RenderStyle::clone(renderer->style())); | 152 renderer->setStyleInternal(RenderStyle::clone(renderer->style())); |
153 else | 153 else |
154 element.setNeedsStyleRecalc(LocalStyleChange); | 154 element.setNeedsStyleRecalc(StyleChangeReasonForTracing::StyleInvali dator, LocalStyleChange); |
155 } | 155 } |
156 | 156 |
157 element.clearChildNeedsStyleInvalidation(); | 157 element.clearChildNeedsStyleInvalidation(); |
158 element.clearNeedsStyleInvalidation(); | 158 element.clearNeedsStyleInvalidation(); |
159 | 159 |
160 return thisElementNeedsStyleRecalc; | 160 return thisElementNeedsStyleRecalc; |
161 } | 161 } |
162 | 162 |
163 void StyleInvalidator::trace(Visitor* visitor) | 163 void StyleInvalidator::trace(Visitor* visitor) |
164 { | 164 { |
165 #if ENABLE(OILPAN) | 165 #if ENABLE(OILPAN) |
166 visitor->trace(m_pendingInvalidationMap); | 166 visitor->trace(m_pendingInvalidationMap); |
167 #endif | 167 #endif |
168 } | 168 } |
169 | 169 |
170 } // namespace blink | 170 } // namespace blink |
OLD | NEW |