OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 ASSERT(this == owner->virtualChildren()); | 58 ASSERT(this == owner->virtualChildren()); |
59 | 59 |
60 if (oldChild->isFloatingOrOutOfFlowPositioned()) | 60 if (oldChild->isFloatingOrOutOfFlowPositioned()) |
61 toLayoutBox(oldChild)->removeFloatingOrPositionedChildFromBlockLists(); | 61 toLayoutBox(oldChild)->removeFloatingOrPositionedChildFromBlockLists(); |
62 | 62 |
63 { | 63 { |
64 // So that we'll get the appropriate dirty bit set (either that a normal flow child got yanked or | 64 // So that we'll get the appropriate dirty bit set (either that a normal flow child got yanked or |
65 // that a positioned child got yanked). We also issue paint invalidation s, so that the area exposed when the child | 65 // that a positioned child got yanked). We also issue paint invalidation s, so that the area exposed when the child |
66 // disappears gets paint invalidated properly. | 66 // disappears gets paint invalidated properly. |
67 if (!owner->documentBeingDestroyed() && notifyRenderer && oldChild->ever HadLayout()) { | 67 if (!owner->documentBeingDestroyed() && notifyRenderer && oldChild->ever HadLayout()) { |
68 oldChild->setNeedsLayoutAndPrefWidthsRecalc(); | 68 oldChild->setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason ::DomChanged); |
esprehn
2015/03/23 20:19:44
This doesn't mean the dom changed, it could just m
pdr.
2015/03/24 03:56:19
Good catch.
I updated this to be "RemovedFromLayo
| |
69 invalidatePaintOnRemoval(*oldChild); | 69 invalidatePaintOnRemoval(*oldChild); |
70 } | 70 } |
71 } | 71 } |
72 | 72 |
73 // If we have a line box wrapper, delete it. | 73 // If we have a line box wrapper, delete it. |
74 if (oldChild->isBox()) | 74 if (oldChild->isBox()) |
75 toLayoutBox(oldChild)->deleteLineBoxWrapper(); | 75 toLayoutBox(oldChild)->deleteLineBoxWrapper(); |
76 | 76 |
77 // If oldChild is the start or end of the selection, then clear the selectio n to | 77 // If oldChild is the start or end of the selection, then clear the selectio n to |
78 // avoid problems of invalid pointers. | 78 // avoid problems of invalid pointers. |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 setLastChild(newChild); | 149 setLastChild(newChild); |
150 } | 150 } |
151 | 151 |
152 if (!owner->documentBeingDestroyed() && notifyRenderer) | 152 if (!owner->documentBeingDestroyed() && notifyRenderer) |
153 newChild->insertedIntoTree(); | 153 newChild->insertedIntoTree(); |
154 | 154 |
155 if (!owner->documentBeingDestroyed()) { | 155 if (!owner->documentBeingDestroyed()) { |
156 LayoutCounter::rendererSubtreeAttached(newChild); | 156 LayoutCounter::rendererSubtreeAttached(newChild); |
157 } | 157 } |
158 | 158 |
159 newChild->setNeedsLayoutAndPrefWidthsRecalc(); | 159 newChild->setNeedsLayoutAndPrefWidthsRecalc(LayoutInvalidationReason::DomCha nged); |
esprehn
2015/03/23 20:19:44
This doesn't mean the dom changed, it could just m
| |
160 newChild->setShouldDoFullPaintInvalidation(PaintInvalidationRendererInsertio n); | 160 newChild->setShouldDoFullPaintInvalidation(PaintInvalidationRendererInsertio n); |
161 if (!owner->normalChildNeedsLayout()) | 161 if (!owner->normalChildNeedsLayout()) |
162 owner->setChildNeedsLayout(); // We may supply the static position for a n absolute positioned child. | 162 owner->setChildNeedsLayout(); // We may supply the static position for a n absolute positioned child. |
163 | 163 |
164 if (AXObjectCache* cache = owner->document().axObjectCache()) | 164 if (AXObjectCache* cache = owner->document().axObjectCache()) |
165 cache->childrenChanged(owner); | 165 cache->childrenChanged(owner); |
166 } | 166 } |
167 | 167 |
168 void LayoutObjectChildList::invalidatePaintOnRemoval(const LayoutObject& oldChil d) | 168 void LayoutObjectChildList::invalidatePaintOnRemoval(const LayoutObject& oldChil d) |
169 { | 169 { |
170 if (!oldChild.isRooted()) | 170 if (!oldChild.isRooted()) |
171 return; | 171 return; |
172 if (oldChild.isBody()) { | 172 if (oldChild.isBody()) { |
173 oldChild.view()->setShouldDoFullPaintInvalidation(); | 173 oldChild.view()->setShouldDoFullPaintInvalidation(); |
174 return; | 174 return; |
175 } | 175 } |
176 | 176 |
177 DisableCompositingQueryAsserts disabler; | 177 DisableCompositingQueryAsserts disabler; |
178 // FIXME: We should not allow paint invalidation out of paint invalidation s tate. crbug.com/457415 | 178 // FIXME: We should not allow paint invalidation out of paint invalidation s tate. crbug.com/457415 |
179 DisablePaintInvalidationStateAsserts paintInvalidationAssertDisabler; | 179 DisablePaintInvalidationStateAsserts paintInvalidationAssertDisabler; |
180 const LayoutBoxModelObject* paintInvalidationContainer = oldChild.containerF orPaintInvalidation(); | 180 const LayoutBoxModelObject* paintInvalidationContainer = oldChild.containerF orPaintInvalidation(); |
181 oldChild.invalidatePaintUsingContainer(paintInvalidationContainer, oldChild. previousPaintInvalidationRect(), PaintInvalidationRendererRemoval); | 181 oldChild.invalidatePaintUsingContainer(paintInvalidationContainer, oldChild. previousPaintInvalidationRect(), PaintInvalidationRendererRemoval); |
182 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) | 182 if (RuntimeEnabledFeatures::slimmingPaintEnabled()) |
183 oldChild.invalidateDisplayItemClients(*paintInvalidationContainer); | 183 oldChild.invalidateDisplayItemClients(*paintInvalidationContainer); |
184 } | 184 } |
185 | 185 |
186 } // namespace blink | 186 } // namespace blink |
OLD | NEW |