Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Unified Diff: Source/WebCore/rendering/svg/RenderSVGText.cpp

Issue 10456022: Merge 117975 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/rendering/svg/RenderSVGText.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « Source/WebCore/rendering/svg/RenderSVGText.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698