Title: [87028] trunk/Source/WebCore
Revision
87028
Author
[email protected]
Date
2011-05-22 03:13:54 -0700 (Sun, 22 May 2011)

Log Message

2011-05-22  Dirk Schulze  <[email protected]>

        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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (87027 => 87028)


--- trunk/Source/WebCore/ChangeLog	2011-05-22 06:58:30 UTC (rev 87027)
+++ trunk/Source/WebCore/ChangeLog	2011-05-22 10:13:54 UTC (rev 87028)
@@ -1,3 +1,28 @@
+2011-05-22  Dirk Schulze  <[email protected]>
+
+        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  <[email protected]>
 
         Reviewed by Darin Adler.

Modified: trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp (87027 => 87028)


--- trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp	2011-05-22 06:58:30 UTC (rev 87027)
+++ trunk/Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp	2011-05-22 10:13:54 UTC (rev 87028)
@@ -266,8 +266,12 @@
     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());

Modified: trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp (87027 => 87028)


--- trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp	2011-05-22 06:58:30 UTC (rev 87027)
+++ trunk/Source/WebCore/svg/SVGFEDropShadowElement.cpp	2011-05-22 10:13:54 UTC (rev 87028)
@@ -188,7 +188,6 @@
         return 0;
     
     ASSERT(renderer->style());
-    ASSERT(renderer->style()->svgStyle());
     const SVGRenderStyle* svgStyle = renderer->style()->svgStyle();
     
     Color color = svgStyle->floodColor();

Modified: trunk/Source/WebCore/svg/SVGFEFloodElement.cpp (87027 => 87028)


--- trunk/Source/WebCore/svg/SVGFEFloodElement.cpp	2011-05-22 06:58:30 UTC (rev 87027)
+++ trunk/Source/WebCore/svg/SVGFEFloodElement.cpp	2011-05-22 10:13:54 UTC (rev 87028)
@@ -61,10 +61,15 @@
 
 PassRefPtr<FilterEffect> SVGFEFloodElement::build(SVGFilterBuilder*, Filter* filter)
 {
-    RefPtr<RenderStyle> filterStyle = styleForRenderer();
+    RenderObject* renderer = this->renderer();
+    if (!renderer)
+        return 0;
+    
+    ASSERT(renderer->style());
+    const SVGRenderStyle* svgStyle = renderer->style()->svgStyle();
 
-    Color color = filterStyle->svgStyle()->floodColor();
-    float opacity = filterStyle->svgStyle()->floodOpacity();
+    Color color = svgStyle->floodColor();
+    float opacity = svgStyle->floodOpacity();
 
     return FEFlood::create(filter, color, opacity);
 }

Modified: trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp (87027 => 87028)


--- trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp	2011-05-22 06:58:30 UTC (rev 87027)
+++ trunk/Source/WebCore/svg/SVGFESpecularLightingElement.cpp	2011-05-22 10:13:54 UTC (rev 87028)
@@ -280,10 +280,13 @@
     if (!lightSource)
         return 0;
 
-    RefPtr<RenderStyle> filterStyle = styleForRenderer();
+    RenderObject* renderer = this->renderer();
+    if (!renderer)
+        return 0;
+    
+    ASSERT(renderer->style());
+    Color color = renderer->style()->svgStyle()->lightingColor();
 
-    Color color = filterStyle->svgStyle()->lightingColor();
-
     RefPtr<FilterEffect> effect = FESpecularLighting::create(filter, color, surfaceScale(), specularConstant(),
                                           specularExponent(), kernelUnitLengthX(), kernelUnitLengthY(), lightSource.release());
     effect->inputEffects().append(input1);

Modified: trunk/Source/WebCore/svg/svgattrs.in (87027 => 87028)


--- trunk/Source/WebCore/svg/svgattrs.in	2011-05-22 06:58:30 UTC (rev 87027)
+++ trunk/Source/WebCore/svg/svgattrs.in	2011-05-22 10:13:54 UTC (rev 87028)
@@ -54,11 +54,6 @@
 end
 exponent
 externalResourcesRequired
-feColorMatrix
-feComposite
-feGaussianBlur
-feMorphology
-feTile
 fill
 fill-opacity
 fill-rule
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to