2007-10-17 Eric Seidel <eric@webkit.org>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Oct 2007 18:33:25 +0000 (18:33 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Oct 2007 18:33:25 +0000 (18:33 +0000)
        Reviewed by Mark Rowe.

        Remove a couple more uses of svg_dynamic_cast.

        No functional changes, no tests.

        * ksvg2/svg/SVGPatternElement.cpp:
        (WebCore::SVGPatternElement::buildPattern):

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

WebCore/ChangeLog
WebCore/ksvg2/svg/SVGPatternElement.cpp

index e7f57b0..d25d370 100644 (file)
@@ -1,3 +1,14 @@
+2007-10-17  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Mark Rowe.
+        
+        Remove a couple more uses of svg_dynamic_cast.
+
+        No functional changes, no tests.
+
+        * ksvg2/svg/SVGPatternElement.cpp:
+        (WebCore::SVGPatternElement::buildPattern):
+
 2007-10-17  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Eric and Geoff.
index 6928692..69a53cf 100644 (file)
@@ -159,16 +159,9 @@ void SVGPatternElement::buildPattern(const FloatRect& targetRect) const
     RenderStyle* style = renderer()->style();
     if (style->overflowX() == OVISIBLE && style->overflowY() == OVISIBLE) {
         for (Node* n = attributes.patternContentElement()->firstChild(); n; n = n->nextSibling()) {
-            SVGElement* elem = svg_dynamic_cast(n);
-            if (!elem || !elem->isStyledTransformable())
+            if (!n->isSVGElement() || !static_cast<SVGElement*>(n)->isStyledTransformable() || !n->renderer())
                 continue;
-
-            SVGStyledElement* e = static_cast<SVGStyledElement*>(elem);
-            RenderObject* item = e->renderer();
-            if (!item)
-                continue;
-
-            patternContentBoundaries.unite(item->relativeBBox(true));
+            patternContentBoundaries.unite(n->renderer()->relativeBBox(true));
         }
     }
 
@@ -217,16 +210,9 @@ void SVGPatternElement::buildPattern(const FloatRect& targetRect) const
 
     // Render subtree into ImageBuffer
     for (Node* n = attributes.patternContentElement()->firstChild(); n; n = n->nextSibling()) {
-        SVGElement* elem = svg_dynamic_cast(n);
-        if (!elem || !elem->isStyled())
+        if (!n->isSVGElement() || !static_cast<SVGElement*>(n)->isStyled() || !n->renderer())
             continue;
-
-        SVGStyledElement* e = static_cast<SVGStyledElement*>(elem);
-        RenderObject* item = e->renderer();
-        if (!item)
-            continue;
-
-        renderSubtreeToImage(patternImage.get(), item);
+        renderSubtreeToImage(patternImage.get(), n->renderer());
     }
 
     context->restore();