| Index: Source/WebCore/rendering/svg/RenderSVGText.cpp
|
| ===================================================================
|
| --- Source/WebCore/rendering/svg/RenderSVGText.cpp (revision 118875)
|
| +++ Source/WebCore/rendering/svg/RenderSVGText.cpp (working copy)
|
| @@ -168,6 +168,7 @@
|
| void RenderSVGText::subtreeChildWasAdded(RenderObject* child)
|
| {
|
| ASSERT(child);
|
| + ASSERT(child->isSVGInlineText() || child->isSVGInline());
|
| if (!shouldHandleSubtreeMutations() || documentBeingDestroyed())
|
| return;
|
|
|
| @@ -234,9 +235,10 @@
|
| RenderSVGBlock::willBeDestroyed();
|
| }
|
|
|
| -void RenderSVGText::subtreeChildWillBeRemoved(RenderSVGInlineText* text, Vector<SVGTextLayoutAttributes*, 2>& affectedAttributes)
|
| +void RenderSVGText::subtreeChildWillBeRemoved(RenderObject* child, Vector<SVGTextLayoutAttributes*, 2>& affectedAttributes)
|
| {
|
| - ASSERT(text);
|
| + ASSERT(child);
|
| + ASSERT(child->isSVGInlineText() || child->isSVGInline());
|
| if (!shouldHandleSubtreeMutations())
|
| return;
|
|
|
| @@ -245,10 +247,11 @@
|
| // The positioning elements cache depends on the size of each text renderer in the
|
| // subtree. If this changes, clear the cache. It's going to be rebuilt below.
|
| m_layoutAttributesBuilder.clearTextPositioningElements();
|
| - if (m_layoutAttributes.isEmpty())
|
| + if (m_layoutAttributes.isEmpty() || child->isSVGInline())
|
| return;
|
|
|
| // This logic requires that the 'text' child is still inserted in the tree.
|
| + RenderSVGInlineText* text = toRenderSVGInlineText(child);
|
| bool stopAfterNext = false;
|
| SVGTextLayoutAttributes* previous = 0;
|
| SVGTextLayoutAttributes* next = 0;
|
| @@ -519,14 +522,8 @@
|
|
|
| void RenderSVGText::removeChild(RenderObject* child)
|
| {
|
| - if (!child->isSVGInlineText()) {
|
| - RenderSVGBlock::removeChild(child);
|
| - return;
|
| - }
|
| -
|
| - RenderSVGInlineText* text = toRenderSVGInlineText(child);
|
| Vector<SVGTextLayoutAttributes*, 2> affectedAttributes;
|
| - subtreeChildWillBeRemoved(text, affectedAttributes);
|
| + subtreeChildWillBeRemoved(child, affectedAttributes);
|
| RenderSVGBlock::removeChild(child);
|
| subtreeChildWasRemoved(affectedAttributes);
|
| }
|
|
|