Title: [112618] branches/chromium/1025

Diff

Copied: branches/chromium/1025/LayoutTests/svg/text/text-positioning-remove-child-crash-expected.txt (from rev 110307, trunk/LayoutTests/svg/text/text-positioning-remove-child-crash-expected.txt) (0 => 112618)


--- branches/chromium/1025/LayoutTests/svg/text/text-positioning-remove-child-crash-expected.txt	                        (rev 0)
+++ branches/chromium/1025/LayoutTests/svg/text/text-positioning-remove-child-crash-expected.txt	2012-03-30 00:23:13 UTC (rev 112618)
@@ -0,0 +1,2 @@
+Test passes if it does not crash when run with libgmalloc.
+PASS

Copied: branches/chromium/1025/LayoutTests/svg/text/text-positioning-remove-child-crash.svg (from rev 110307, trunk/LayoutTests/svg/text/text-positioning-remove-child-crash.svg) (0 => 112618)


--- branches/chromium/1025/LayoutTests/svg/text/text-positioning-remove-child-crash.svg	                        (rev 0)
+++ branches/chromium/1025/LayoutTests/svg/text/text-positioning-remove-child-crash.svg	2012-03-30 00:23:13 UTC (rev 112618)
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+    <text y="50">Test passes if it does not crash when run with libgmalloc.</text>
+    <script>
+        if (window.layoutTestController)
+            layoutTestController.dumpAsText();
+    </script>
+    <text><a id="a"><tspan>FAIL</tspan></a></text>
+
+<script><![CDATA[
+document.execCommand("SelectAll");
+document.getElementById("a").textContent = "PASS";
+]]></script>
+</svg>

Modified: branches/chromium/1025/Source/WebCore/svg/SVGAElement.cpp (112617 => 112618)


--- branches/chromium/1025/Source/WebCore/svg/SVGAElement.cpp	2012-03-30 00:21:00 UTC (rev 112617)
+++ branches/chromium/1025/Source/WebCore/svg/SVGAElement.cpp	2012-03-30 00:23:13 UTC (rev 112618)
@@ -39,6 +39,7 @@
 #include "MouseEvent.h"
 #include "PlatformMouseEvent.h"
 #include "RenderSVGInline.h"
+#include "RenderSVGText.h"
 #include "RenderSVGTransformableContainer.h"
 #include "ResourceRequest.h"
 #include "SVGElementInstance.h"
@@ -236,6 +237,19 @@
     return SVGElement::childShouldCreateRenderer(child);
 }
 
+void SVGAElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
+{
+    SVGStyledTransformableElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
+
+    if (changedByParser || !renderer())
+        return;
+
+    // Invalidate the TextPosition cache in SVGTextLayoutAttributesBuilder as it may now point
+    // to no-longer existing SVGTextPositioningElements and thus needs to be rebuilt.
+    if (RenderSVGText* textRenderer = RenderSVGText::locateRenderSVGTextAncestor(renderer()))
+        textRenderer->textDOMChanged();
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(SVG)

Modified: branches/chromium/1025/Source/WebCore/svg/SVGAElement.h (112617 => 112618)


--- branches/chromium/1025/Source/WebCore/svg/SVGAElement.h	2012-03-30 00:21:00 UTC (rev 112617)
+++ branches/chromium/1025/Source/WebCore/svg/SVGAElement.h	2012-03-30 00:23:13 UTC (rev 112618)
@@ -40,6 +40,9 @@
 public:
     static PassRefPtr<SVGAElement> create(const QualifiedName&, Document*);
 
+protected:
+    virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0) OVERRIDE;
+
 private:
     SVGAElement(const QualifiedName&, Document*);
 

Modified: branches/chromium/1025/Source/WebCore/svg/SVGTextContentElement.cpp (112617 => 112618)


--- branches/chromium/1025/Source/WebCore/svg/SVGTextContentElement.cpp	2012-03-30 00:21:00 UTC (rev 112617)
+++ branches/chromium/1025/Source/WebCore/svg/SVGTextContentElement.cpp	2012-03-30 00:23:13 UTC (rev 112618)
@@ -316,7 +316,7 @@
         return;
 
     // Invalidate the TextPosition cache in SVGTextLayoutAttributesBuilder as it may now point
-    // to no-longer existing SVGTextPositioningElements and thus needs to be rebuild.
+    // to no-longer existing SVGTextPositioningElements and thus needs to be rebuilt.
     if (RenderSVGText* textRenderer = RenderSVGText::locateRenderSVGTextAncestor(renderer()))
         textRenderer->textDOMChanged();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to