Title: [118876] branches/chromium/1132

Diff

Copied: branches/chromium/1132/LayoutTests/svg/custom/bug86781-expected.txt (from rev 117975, trunk/LayoutTests/svg/custom/bug86781-expected.txt) (0 => 118876)


--- branches/chromium/1132/LayoutTests/svg/custom/bug86781-expected.txt	                        (rev 0)
+++ branches/chromium/1132/LayoutTests/svg/custom/bug86781-expected.txt	2012-05-30 01:51:04 UTC (rev 118876)
@@ -0,0 +1,3 @@
+PASS
+
+

Copied: branches/chromium/1132/LayoutTests/svg/custom/bug86781.html (from rev 117975, trunk/LayoutTests/svg/custom/bug86781.html) (0 => 118876)


--- branches/chromium/1132/LayoutTests/svg/custom/bug86781.html	                        (rev 0)
+++ branches/chromium/1132/LayoutTests/svg/custom/bug86781.html	2012-05-30 01:51:04 UTC (rev 118876)
@@ -0,0 +1,47 @@
+<html>
+<head>
+</head>
+<body>
+<svg width="100" height="200">
+    <g>
+        <text y="20"><tspan id="tspan">PASS</tspan></text>
+    </g>
+ <br>   
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+document.execCommand("SelectAll");
+function remove_tspan() {
+var elem = document.getElementById("tspan");
+for (i=0;i<elem.childNodes.length;i++) {
+  elem.parentNode.appendChild(elem.childNodes[i]);
+}
+elem.parentNode.removeChild(elem);
+}
+remove_tspan();
+var head = document.getElementsByTagName("head")[0];
+var style = document.createElement("style");
+style.type = "text/css";
+style.innerHTML="* { \n\
+-webkit-animation-name: name; \n\
+-webkit-animation-duration: 0.01s; \n\
+} \n\
+@-webkit-keyframes name { \n\
+  from { \n\
+    -webkit-column-rule-color: #7e4e51; \n\
+  } \n\
+  to { \n\
+    -webkit-column-rule-color: rgb(19,55,215); \n\
+  } \n\
+} \n\
+";
+head.appendChild(style);
+
+if (window.layoutTestController)
+    setTimeout("layoutTestController.notifyDone()", 50);
+</script>
+</svg>
+</body>
+</html>

Modified: branches/chromium/1132/Source/WebCore/rendering/svg/RenderSVGInline.cpp (118875 => 118876)


--- branches/chromium/1132/Source/WebCore/rendering/svg/RenderSVGInline.cpp	2012-05-30 01:47:44 UTC (rev 118875)
+++ branches/chromium/1132/Source/WebCore/rendering/svg/RenderSVGInline.cpp	2012-05-30 01:51:04 UTC (rev 118876)
@@ -129,15 +129,13 @@
 
 void RenderSVGInline::removeChild(RenderObject* child)
 {
-    RenderSVGText* textRenderer = child->isSVGInlineText() ? RenderSVGText::locateRenderSVGTextAncestor(this) : 0;
+    RenderSVGText* textRenderer = RenderSVGText::locateRenderSVGTextAncestor(this);
     if (!textRenderer) {
         RenderInline::removeChild(child);
         return;
     }
-
-    RenderSVGInlineText* text = toRenderSVGInlineText(child);
     Vector<SVGTextLayoutAttributes*, 2> affectedAttributes;
-    textRenderer->subtreeChildWillBeRemoved(text, affectedAttributes);
+    textRenderer->subtreeChildWillBeRemoved(child, affectedAttributes);
     RenderInline::removeChild(child);
     textRenderer->subtreeChildWasRemoved(affectedAttributes);
 }

Modified: branches/chromium/1132/Source/WebCore/rendering/svg/RenderSVGText.cpp (118875 => 118876)


--- branches/chromium/1132/Source/WebCore/rendering/svg/RenderSVGText.cpp	2012-05-30 01:47:44 UTC (rev 118875)
+++ branches/chromium/1132/Source/WebCore/rendering/svg/RenderSVGText.cpp	2012-05-30 01:51:04 UTC (rev 118876)
@@ -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);
 }

Modified: branches/chromium/1132/Source/WebCore/rendering/svg/RenderSVGText.h (118875 => 118876)


--- branches/chromium/1132/Source/WebCore/rendering/svg/RenderSVGText.h	2012-05-30 01:47:44 UTC (rev 118875)
+++ branches/chromium/1132/Source/WebCore/rendering/svg/RenderSVGText.h	2012-05-30 01:51:04 UTC (rev 118876)
@@ -52,7 +52,7 @@
     Vector<SVGTextLayoutAttributes*>& layoutAttributes() { return m_layoutAttributes; }
 
     void subtreeChildWasAdded(RenderObject*);
-    void subtreeChildWillBeRemoved(RenderSVGInlineText*, Vector<SVGTextLayoutAttributes*, 2>& affectedAttributes);
+    void subtreeChildWillBeRemoved(RenderObject*, Vector<SVGTextLayoutAttributes*, 2>& affectedAttributes);
     void subtreeChildWasRemoved(const Vector<SVGTextLayoutAttributes*, 2>& affectedAttributes);
     void subtreeStyleDidChange(RenderSVGInlineText*);
     void subtreeTextDidChange(RenderSVGInlineText*);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to