2011-05-22 Dirk Schulze <krit@webkit.org>
authorkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 May 2011 10:13:54 +0000 (10:13 +0000)
committerkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 22 May 2011 10:13:54 +0000 (10:13 +0000)
        Reviewed by Nikolas Zimmermann.

        Don't do manually style resolution for SVGElements with renderer
        https://bugs.webkit.org/show_bug.cgi?id=59176

        General clean-up.

        Don't resolve style manually, instead ask the RenderObject for its style.

        Cleanup svgattrs.in, some SVG element names were accidently listed there as attributes.

        No new tests needed. No change of behavior.

        * svg/SVGFEDiffuseLightingElement.cpp:
        (WebCore::SVGFEDiffuseLightingElement::build):
        * svg/SVGFEDropShadowElement.cpp:
        (WebCore::SVGFEDropShadowElement::build):
        * svg/SVGFEFloodElement.cpp:
        (WebCore::SVGFEFloodElement::build):
        * svg/SVGFESpecularLightingElement.cpp:
        (WebCore::SVGFESpecularLightingElement::build):
        * svg/svgattrs.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87028 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp
Source/WebCore/svg/SVGFEDropShadowElement.cpp
Source/WebCore/svg/SVGFEFloodElement.cpp
Source/WebCore/svg/SVGFESpecularLightingElement.cpp
Source/WebCore/svg/svgattrs.in

index 8eefc58..9398eb4 100644 (file)
@@ -1,3 +1,28 @@
+2011-05-22  Dirk Schulze  <krit@webkit.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Don't do manually style resolution for SVGElements with renderer
+        https://bugs.webkit.org/show_bug.cgi?id=59176
+
+        General clean-up.
+
+        Don't resolve style manually, instead ask the RenderObject for its style.
+
+        Cleanup svgattrs.in, some SVG element names were accidently listed there as attributes.
+
+        No new tests needed. No change of behavior.
+
+        * svg/SVGFEDiffuseLightingElement.cpp:
+        (WebCore::SVGFEDiffuseLightingElement::build):
+        * svg/SVGFEDropShadowElement.cpp:
+        (WebCore::SVGFEDropShadowElement::build):
+        * svg/SVGFEFloodElement.cpp:
+        (WebCore::SVGFEFloodElement::build):
+        * svg/SVGFESpecularLightingElement.cpp:
+        (WebCore::SVGFESpecularLightingElement::build):
+        * svg/svgattrs.in:
+
 2011-05-21  Dirk Schulze  <krit@webkit.org>
 
         Reviewed by Darin Adler.
index ee2dacf..80b7798 100644 (file)
@@ -266,8 +266,12 @@ PassRefPtr<FilterEffect> SVGFEDiffuseLightingElement::build(SVGFilterBuilder* fi
     if (!lightSource)
         return 0;
 
-    RefPtr<RenderStyle> filterStyle = styleForRenderer();
-    Color color = filterStyle->svgStyle()->lightingColor();
+    RenderObject* renderer = this->renderer();
+    if (!renderer)
+        return 0;
+    
+    ASSERT(renderer->style());
+    Color color = renderer->style()->svgStyle()->lightingColor();
 
     RefPtr<FilterEffect> effect = FEDiffuseLighting::create(filter, color, surfaceScale(), diffuseConstant(),
                                                                 kernelUnitLengthX(), kernelUnitLengthY(), lightSource.release());
index ad9d3c9..323ef9a 100644 (file)
@@ -188,7 +188,6 @@ PassRefPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuilder* filterB
         return 0;
     
     ASSERT(renderer->style());
-    ASSERT(renderer->style()->svgStyle());
     const SVGRenderStyle* svgStyle = renderer->style()->svgStyle();
     
     Color color = svgStyle->floodColor();
index 5012325..76756fb 100644 (file)
@@ -61,10 +61,15 @@ bool SVGFEFloodElement::setFilterEffectAttribute(FilterEffect* effect, const Qua
 
 PassRefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter* filter)
 {
-    RefPtr<RenderStyle> filterStyle = styleForRenderer();
-
-    Color color = filterStyle->svgStyle()->floodColor();
-    float opacity = filterStyle->svgStyle()->floodOpacity();
+    RenderObject* renderer = this->renderer();
+    if (!renderer)
+        return 0;
+    
+    ASSERT(renderer->style());
+    const SVGRenderStyle* svgStyle = renderer->style()->svgStyle();
+
+    Color color = svgStyle->floodColor();
+    float opacity = svgStyle->floodOpacity();
 
     return FEFlood::create(filter, color, opacity);
 }
index 0d377d4..0fcb735 100644 (file)
@@ -280,9 +280,12 @@ PassRefPtr<FilterEffect> SVGFESpecularLightingElement::build(SVGFilterBuilder* f
     if (!lightSource)
         return 0;
 
-    RefPtr<RenderStyle> filterStyle = styleForRenderer();
-
-    Color color = filterStyle->svgStyle()->lightingColor();
+    RenderObject* renderer = this->renderer();
+    if (!renderer)
+        return 0;
+    
+    ASSERT(renderer->style());
+    Color color = renderer->style()->svgStyle()->lightingColor();
 
     RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, surfaceScale(), specularConstant(),
                                           specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), lightSource.release());
index dbe7663..688f250 100644 (file)
@@ -54,11 +54,6 @@ enable-background
 end
 exponent
 externalResourcesRequired
-feColorMatrix
-feComposite
-feGaussianBlur
-feMorphology
-feTile
 fill
 fill-opacity
 fill-rule