OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> | 2 * Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz> |
3 * Copyright (C) 2006 Apple Inc. All rights reserved. | 3 * Copyright (C) 2006 Apple Inc. All rights reserved. |
4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 SVGResourcesCache::clientWasAddedToTree(child, child->styleRef()); | 131 SVGResourcesCache::clientWasAddedToTree(child, child->styleRef()); |
132 | 132 |
133 if (LayoutSVGText* textLayoutObject = LayoutSVGText::locateLayoutSVGTextAnce
stor(this)) | 133 if (LayoutSVGText* textLayoutObject = LayoutSVGText::locateLayoutSVGTextAnce
stor(this)) |
134 textLayoutObject->subtreeChildWasAdded(child); | 134 textLayoutObject->subtreeChildWasAdded(child); |
135 } | 135 } |
136 | 136 |
137 void LayoutSVGInline::removeChild(LayoutObject* child) | 137 void LayoutSVGInline::removeChild(LayoutObject* child) |
138 { | 138 { |
139 SVGResourcesCache::clientWillBeRemovedFromTree(child); | 139 SVGResourcesCache::clientWillBeRemovedFromTree(child); |
140 | 140 |
141 LayoutSVGText* textLayoutObject = LayoutSVGText::locateLayoutSVGTextAncestor
(this); | 141 if (LayoutSVGText* textLayoutObject = LayoutSVGText::locateLayoutSVGTextAnce
stor(this)) |
142 if (!textLayoutObject) { | 142 textLayoutObject->subtreeChildWillBeRemoved(child); |
143 LayoutInline::removeChild(child); | |
144 return; | |
145 } | |
146 Vector<SVGTextLayoutAttributes*, 2> affectedAttributes; | |
147 textLayoutObject->subtreeChildWillBeRemoved(child, affectedAttributes); | |
148 LayoutInline::removeChild(child); | 143 LayoutInline::removeChild(child); |
149 textLayoutObject->subtreeChildWasRemoved(affectedAttributes); | |
150 } | 144 } |
151 | 145 |
152 void LayoutSVGInline::invalidateTreeIfNeeded(const PaintInvalidationState& paint
InvalidationState) | 146 void LayoutSVGInline::invalidateTreeIfNeeded(const PaintInvalidationState& paint
InvalidationState) |
153 { | 147 { |
154 ASSERT(!needsLayout()); | 148 ASSERT(!needsLayout()); |
155 | 149 |
156 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) | 150 if (!shouldCheckForPaintInvalidation(paintInvalidationState)) |
157 return; | 151 return; |
158 | 152 |
159 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th
is); | 153 PaintInvalidationState newPaintInvalidationState(paintInvalidationState, *th
is); |
160 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio
nState); | 154 PaintInvalidationReason reason = invalidatePaintIfNeeded(newPaintInvalidatio
nState); |
161 clearPaintInvalidationFlags(newPaintInvalidationState); | 155 clearPaintInvalidationFlags(newPaintInvalidationState); |
162 | 156 |
163 if (reason == PaintInvalidationDelayedFull) | 157 if (reason == PaintInvalidationDelayedFull) |
164 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); | 158 paintInvalidationState.pushDelayedPaintInvalidationTarget(*this); |
165 | 159 |
166 if (reason == PaintInvalidationSVGResourceChange) | 160 if (reason == PaintInvalidationSVGResourceChange) |
167 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); | 161 newPaintInvalidationState.setForceSubtreeInvalidationWithinContainer(); |
168 | 162 |
169 newPaintInvalidationState.updateForChildren(); | 163 newPaintInvalidationState.updateForChildren(); |
170 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); | 164 invalidatePaintOfSubtreesIfNeeded(newPaintInvalidationState); |
171 } | 165 } |
172 | 166 |
173 } // namespace blink | 167 } // namespace blink |
OLD | NEW |