Title: [118425] branches/chromium/1132
Revision
118425
Author
[email protected]
Date
2012-05-24 15:16:47 -0700 (Thu, 24 May 2012)

Log Message

Merge 116647
BUG=123631
Review URL: https://chromiumcodereview.appspot.com/10442022

Modified Paths

Added Paths

Diff

Copied: branches/chromium/1132/ManualTests/bugzilla-83979.svg (from rev 116647, trunk/ManualTests/bugzilla-83979.svg) (0 => 118425)


--- branches/chromium/1132/ManualTests/bugzilla-83979.svg	                        (rev 0)
+++ branches/chromium/1132/ManualTests/bugzilla-83979.svg	2012-05-24 22:16:47 UTC (rev 118425)
@@ -0,0 +1,16 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+  <defs>
+    <filter id="ds2">
+      <feGaussianBlur id="blur" result="blur"/>
+    </filter>
+  </defs>
+  <text x="50" y="50">This test passes if it does not crash after load in Debug builds.</text>
+  <image id="image" xlink:href="" xmlns='http://www.w3.org/2000/svg'%3E%3Crect/%3E%3C/svg%3E" width="50" height="50" filter="url(#ds2)"/>
+<script><![CDATA[
+for (var i = 0; i < 10000; i++) {
+}
+document.getElementById("blur").appendChild(document.getElementById("image").cloneNode());
+for (var i = 0; i < 10000; i++) {
+}
+]]></script>
+</svg>

Modified: branches/chromium/1132/Source/WebCore/svg/SVGFilterElement.cpp (118424 => 118425)


--- branches/chromium/1132/Source/WebCore/svg/SVGFilterElement.cpp	2012-05-24 22:16:37 UTC (rev 118424)
+++ branches/chromium/1132/Source/WebCore/svg/SVGFilterElement.cpp	2012-05-24 22:16:47 UTC (rev 118425)
@@ -27,6 +27,7 @@
 #include "SVGFilterElement.h"
 
 #include "Attr.h"
+#include "NodeRenderingContext.h"
 #include "RenderSVGResourceFilter.h"
 #include "SVGElementInstance.h"
 #include "SVGFilterBuilder.h"
@@ -193,6 +194,45 @@
     return new (arena) RenderSVGResourceFilter(this);
 }
 
+bool SVGFilterElement::childShouldCreateRenderer(const NodeRenderingContext& childContext) const
+{
+    if (!childContext.node()->isSVGElement())
+        return false;
+
+    Element* element = static_cast<Element*>(childContext.node());
+
+    DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, allowedChildElementTags, ());
+    if (allowedChildElementTags.isEmpty()) {
+        allowedChildElementTags.add(SVGNames::feBlendTag);
+        allowedChildElementTags.add(SVGNames::feColorMatrixTag);
+        allowedChildElementTags.add(SVGNames::feComponentTransferTag);
+        allowedChildElementTags.add(SVGNames::feCompositeTag);
+        allowedChildElementTags.add(SVGNames::feConvolveMatrixTag);
+        allowedChildElementTags.add(SVGNames::feDiffuseLightingTag);
+        allowedChildElementTags.add(SVGNames::feDisplacementMapTag);
+        allowedChildElementTags.add(SVGNames::feDistantLightTag);
+        allowedChildElementTags.add(SVGNames::feDropShadowTag);
+        allowedChildElementTags.add(SVGNames::feFloodTag);
+        allowedChildElementTags.add(SVGNames::feFuncATag);
+        allowedChildElementTags.add(SVGNames::feFuncBTag);
+        allowedChildElementTags.add(SVGNames::feFuncGTag);
+        allowedChildElementTags.add(SVGNames::feFuncRTag);
+        allowedChildElementTags.add(SVGNames::feGaussianBlurTag);
+        allowedChildElementTags.add(SVGNames::feImageTag);
+        allowedChildElementTags.add(SVGNames::feMergeTag);
+        allowedChildElementTags.add(SVGNames::feMergeNodeTag);
+        allowedChildElementTags.add(SVGNames::feMorphologyTag);
+        allowedChildElementTags.add(SVGNames::feOffsetTag);
+        allowedChildElementTags.add(SVGNames::fePointLightTag);
+        allowedChildElementTags.add(SVGNames::feSpecularLightingTag);
+        allowedChildElementTags.add(SVGNames::feSpotLightTag);
+        allowedChildElementTags.add(SVGNames::feTileTag);
+        allowedChildElementTags.add(SVGNames::feTurbulenceTag);
+    }
+
+    return allowedChildElementTags.contains<QualifiedName, SVGAttributeHashTranslator>(element->tagQName());
+}
+
 bool SVGFilterElement::selfHasRelativeLengths() const
 {
     return x().isRelative()

Modified: branches/chromium/1132/Source/WebCore/svg/SVGFilterElement.h (118424 => 118425)


--- branches/chromium/1132/Source/WebCore/svg/SVGFilterElement.h	2012-05-24 22:16:37 UTC (rev 118424)
+++ branches/chromium/1132/Source/WebCore/svg/SVGFilterElement.h	2012-05-24 22:16:47 UTC (rev 118425)
@@ -55,7 +55,8 @@
     virtual void svgAttributeChanged(const QualifiedName&);
     virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
 
-    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
+    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE;
+    virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const OVERRIDE;
 
     virtual bool selfHasRelativeLengths() const;
 

Modified: branches/chromium/1132/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h (118424 => 118425)


--- branches/chromium/1132/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h	2012-05-24 22:16:37 UTC (rev 118424)
+++ branches/chromium/1132/Source/WebCore/svg/SVGFilterPrimitiveStandardAttributes.h	2012-05-24 22:16:47 UTC (rev 118425)
@@ -68,8 +68,9 @@
 private:
     virtual bool isFilterEffect() const { return true; }
 
-    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-    virtual bool rendererIsNeeded(const NodeRenderingContext&);
+    virtual RenderObject* createRenderer(RenderArena*, RenderStyle*) OVERRIDE;
+    virtual bool rendererIsNeeded(const NodeRenderingContext&) OVERRIDE;
+    virtual bool childShouldCreateRenderer(const NodeRenderingContext&) const OVERRIDE { return false; }
 
     BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
         DECLARE_ANIMATED_LENGTH(X, x)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to