[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

zimmermann at webkit.org zimmermann at webkit.org
Wed Dec 22 12:54:35 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 1423ab531f76e05d634d6088b441fa57471e55fc
Author: zimmermann at webkit.org <zimmermann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 1 14:01:15 2010 +0000

    2010-08-30  Patrick Gansterer  <paroga at paroga.com>
    
             Reviewed by Dirk Schulze.
    
             RenderImage::imageChanged invalidates wrong area
             https://bugs.webkit.org/show_bug.cgi?id=43779
    
             Remove RenderImage inheritance from RenderSVGImage, it now inherits from RenderSVGModelObject.
    
             * rendering/RenderSVGImage.cpp:
             (WebCore::RenderSVGImage::RenderSVGImage):
             (WebCore::RenderSVGImage::~RenderSVGImage):
             (WebCore::RenderSVGImage::layout):
             (WebCore::RenderSVGImage::paint):
             (WebCore::RenderSVGImage::imageChanged):
             * rendering/RenderSVGImage.h:
             (WebCore::RenderSVGImage::imageResource):
             * rendering/RenderSVGModelObject.h:
             * svg/SVGImageElement.cpp:
    
    2010-09-01  Nikolas Zimmermann  <nzimmermann at rim.com>
    
            Reviewed by Dirk Schulze.
    
            RenderImage::imageChanged invalidates wrong area
            https://bugs.webkit.org/show_bug.cgi?id=43779
    
            Rebaseline SVG image dumpAsText() tests.
            A newline is gone from each of the results, after switching from RenderImage to RenderSVGModelObject in RenderSVGImage.
    
            * svg/custom/loadevents-capturing-expected.txt:
            * svg/custom/loadevents-externalresourcesrequired-expected.txt:
            * svg/custom/loadevents-normal-expected.txt:
            * svg/dynamic-updates/SVGImageElement-dom-height-attr-expected.txt:
            * svg/dynamic-updates/SVGImageElement-dom-preserveAspectRatio-attr-expected.txt:
            * svg/dynamic-updates/SVGImageElement-dom-width-attr-expected.txt:
            * svg/dynamic-updates/SVGImageElement-dom-x-attr-expected.txt:
            * svg/dynamic-updates/SVGImageElement-dom-y-attr-expected.txt:
            * svg/dynamic-updates/SVGImageElement-svgdom-height-prop-expected.txt:
            * svg/dynamic-updates/SVGImageElement-svgdom-preserveAspectRatio-prop-expected.txt:
            * svg/dynamic-updates/SVGImageElement-svgdom-width-prop-expected.txt:
            * svg/dynamic-updates/SVGImageElement-svgdom-x-prop-expected.txt:
            * svg/dynamic-updates/SVGImageElement-svgdom-y-prop-expected.txt:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66599 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index cc1473b..fb0510f 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,27 @@
+2010-09-01  Nikolas Zimmermann  <nzimmermann at rim.com>
+
+        Reviewed by Dirk Schulze.
+
+        RenderImage::imageChanged invalidates wrong area
+        https://bugs.webkit.org/show_bug.cgi?id=43779
+
+        Rebaseline SVG image dumpAsText() tests.
+        A newline is gone from each of the results, after switching from RenderImage to RenderSVGModelObject in RenderSVGImage.
+
+        * svg/custom/loadevents-capturing-expected.txt:
+        * svg/custom/loadevents-externalresourcesrequired-expected.txt:
+        * svg/custom/loadevents-normal-expected.txt:
+        * svg/dynamic-updates/SVGImageElement-dom-height-attr-expected.txt:
+        * svg/dynamic-updates/SVGImageElement-dom-preserveAspectRatio-attr-expected.txt:
+        * svg/dynamic-updates/SVGImageElement-dom-width-attr-expected.txt:
+        * svg/dynamic-updates/SVGImageElement-dom-x-attr-expected.txt:
+        * svg/dynamic-updates/SVGImageElement-dom-y-attr-expected.txt:
+        * svg/dynamic-updates/SVGImageElement-svgdom-height-prop-expected.txt:
+        * svg/dynamic-updates/SVGImageElement-svgdom-preserveAspectRatio-prop-expected.txt:
+        * svg/dynamic-updates/SVGImageElement-svgdom-width-prop-expected.txt:
+        * svg/dynamic-updates/SVGImageElement-svgdom-x-prop-expected.txt:
+        * svg/dynamic-updates/SVGImageElement-svgdom-y-prop-expected.txt:
+
 2010-09-01  Mahesh Kulkarni  <mahesh.kulkarni at nokia.com>
 
         Reviewed by Laszlo Gombos.
diff --git a/LayoutTests/svg/custom/loadevents-capturing-expected.txt b/LayoutTests/svg/custom/loadevents-capturing-expected.txt
index ae82132..6cf4a41 100644
--- a/LayoutTests/svg/custom/loadevents-capturing-expected.txt
+++ b/LayoutTests/svg/custom/loadevents-capturing-expected.txt
@@ -1,4 +1,3 @@
-
 This tests that load dispatching works when there are no
 direct listeners, but there are capturing event listeners on an ancestor. Bug 16447
 Passed
diff --git a/LayoutTests/svg/custom/loadevents-externalresourcesrequired-expected.txt b/LayoutTests/svg/custom/loadevents-externalresourcesrequired-expected.txt
index e132026..5234abe 100644
--- a/LayoutTests/svg/custom/loadevents-externalresourcesrequired-expected.txt
+++ b/LayoutTests/svg/custom/loadevents-externalresourcesrequired-expected.txt
@@ -1,3 +1,2 @@
-
 This tests load dispatching order with externalResourcesRequired. Bug 16447
 Passed
diff --git a/LayoutTests/svg/custom/loadevents-normal-expected.txt b/LayoutTests/svg/custom/loadevents-normal-expected.txt
index 9e1683c..68dd59b 100644
--- a/LayoutTests/svg/custom/loadevents-normal-expected.txt
+++ b/LayoutTests/svg/custom/loadevents-normal-expected.txt
@@ -1,3 +1,2 @@
-
 This tests normal load dispatching order. Bug 16447
 Passed
diff --git a/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-height-attr-expected.txt b/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-height-attr-expected.txt
index 7fdb0cb..23a137d 100644
--- a/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-height-attr-expected.txt
+++ b/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-height-attr-expected.txt
@@ -1,6 +1,5 @@
 SVG 1.1 dynamic update tests
 
-
 Tests dynamic updates of the 'height' attribute of the SVGImageElement object
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-preserveAspectRatio-attr-expected.txt b/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-preserveAspectRatio-attr-expected.txt
index 1eb6e96..7b331a4 100644
--- a/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-preserveAspectRatio-attr-expected.txt
+++ b/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-preserveAspectRatio-attr-expected.txt
@@ -1,6 +1,5 @@
 SVG 1.1 dynamic update tests
 
-
 Tests dynamic updates of the 'preserveAspectRatio' attribute of the SVGImageElement object
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-width-attr-expected.txt b/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-width-attr-expected.txt
index 736fa78..11d6582 100644
--- a/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-width-attr-expected.txt
+++ b/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-width-attr-expected.txt
@@ -1,6 +1,5 @@
 SVG 1.1 dynamic update tests
 
-
 Tests dynamic updates of the 'width' attribute of the SVGImageElement object
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-x-attr-expected.txt b/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-x-attr-expected.txt
index 6682f52..77f0212 100644
--- a/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-x-attr-expected.txt
+++ b/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-x-attr-expected.txt
@@ -1,6 +1,5 @@
 SVG 1.1 dynamic update tests
 
-
 Tests dynamic updates of the 'x' attribute of the SVGImageElement object
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-y-attr-expected.txt b/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-y-attr-expected.txt
index e31492d..ab5aeb4 100644
--- a/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-y-attr-expected.txt
+++ b/LayoutTests/svg/dynamic-updates/SVGImageElement-dom-y-attr-expected.txt
@@ -1,6 +1,5 @@
 SVG 1.1 dynamic update tests
 
-
 Tests dynamic updates of the 'y' attribute of the SVGImageElement object
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-height-prop-expected.txt b/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-height-prop-expected.txt
index 559a4ae..07407a6 100644
--- a/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-height-prop-expected.txt
+++ b/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-height-prop-expected.txt
@@ -1,6 +1,5 @@
 SVG 1.1 dynamic update tests
 
-
 Tests dynamic updates of the 'height' property of the SVGImageElement object
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-preserveAspectRatio-prop-expected.txt b/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-preserveAspectRatio-prop-expected.txt
index eb7ffb5..4194c7f 100644
--- a/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-preserveAspectRatio-prop-expected.txt
+++ b/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-preserveAspectRatio-prop-expected.txt
@@ -1,6 +1,5 @@
 SVG 1.1 dynamic update tests
 
-
 Tests dynamic updates of the 'preserveAspectRatio' property of the SVGImageElement object
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-width-prop-expected.txt b/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-width-prop-expected.txt
index f5b026f..6756ffc 100644
--- a/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-width-prop-expected.txt
+++ b/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-width-prop-expected.txt
@@ -1,6 +1,5 @@
 SVG 1.1 dynamic update tests
 
-
 Tests dynamic updates of the 'width' property of the SVGImageElement object
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-x-prop-expected.txt b/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-x-prop-expected.txt
index d88b59c..50c4099 100644
--- a/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-x-prop-expected.txt
+++ b/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-x-prop-expected.txt
@@ -1,6 +1,5 @@
 SVG 1.1 dynamic update tests
 
-
 Tests dynamic updates of the 'x' property of the SVGImageElement object
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-y-prop-expected.txt b/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-y-prop-expected.txt
index f03540a..d448624 100644
--- a/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-y-prop-expected.txt
+++ b/LayoutTests/svg/dynamic-updates/SVGImageElement-svgdom-y-prop-expected.txt
@@ -1,6 +1,5 @@
 SVG 1.1 dynamic update tests
 
-
 Tests dynamic updates of the 'y' property of the SVGImageElement object
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a42f9da..e2d36eb 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-08-30  Patrick Gansterer  <paroga at paroga.com>
+
+         Reviewed by Dirk Schulze.
+
+         RenderImage::imageChanged invalidates wrong area
+         https://bugs.webkit.org/show_bug.cgi?id=43779
+
+         Remove RenderImage inheritance from RenderSVGImage, it now inherits from RenderSVGModelObject.
+
+         * rendering/RenderSVGImage.cpp:
+         (WebCore::RenderSVGImage::RenderSVGImage):
+         (WebCore::RenderSVGImage::~RenderSVGImage):
+         (WebCore::RenderSVGImage::layout):
+         (WebCore::RenderSVGImage::paint):
+         (WebCore::RenderSVGImage::imageChanged):
+         * rendering/RenderSVGImage.h:
+         (WebCore::RenderSVGImage::imageResource):
+         * rendering/RenderSVGModelObject.h:
+         * svg/SVGImageElement.cpp:
+
 2010-09-01  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Reviewed by Dirk Schulze.
diff --git a/WebCore/rendering/RenderSVGImage.cpp b/WebCore/rendering/RenderSVGImage.cpp
index 5e30465..0056fa3 100644
--- a/WebCore/rendering/RenderSVGImage.cpp
+++ b/WebCore/rendering/RenderSVGImage.cpp
@@ -5,6 +5,7 @@
     Copyright (C) 2007, 2008, 2009 Rob Buis <buis at kde.org>
     Copyright (C) 2009, Google, Inc.
     Copyright (C) 2009 Dirk Schulze <krit at webkit.org>
+    Copyright (C) 2010 Patrick Gansterer <paroga at paroga.com>
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -32,6 +33,7 @@
 #include "FloatQuad.h"
 #include "GraphicsContext.h"
 #include "PointerEventsHitRules.h"
+#include "RenderImageResource.h"
 #include "RenderLayer.h"
 #include "RenderSVGResourceContainer.h"
 #include "RenderSVGResourceFilter.h"
@@ -44,10 +46,16 @@
 namespace WebCore {
 
 RenderSVGImage::RenderSVGImage(SVGImageElement* impl)
-    : RenderImage(impl)
+    : RenderSVGModelObject(impl)
     , m_needsTransformUpdate(true)
+    , m_imageResource(RenderImageResource::create())
 {
-    setImageResource(RenderImageResource::create());
+    m_imageResource->initialize(this);
+}
+
+RenderSVGImage::~RenderSVGImage()
+{
+    m_imageResource->shutdown();
 }
 
 void RenderSVGImage::layout()
@@ -64,12 +72,6 @@ void RenderSVGImage::layout()
         updateCachedBoundariesInParents = true;
     }
 
-    // minimum height
-    setHeight(imageResource()->errorOccurred() ? intrinsicSize().height() : 0);
-
-    calcWidth();
-    calcHeight();
-
     // FIXME: Optimize caching the repaint rects.
     FloatRect oldBoundaries = m_localBounds;
     m_localBounds = FloatRect(image->x().value(image), image->y().value(image), image->width().value(image), image->height().value(image));
@@ -84,7 +86,7 @@ void RenderSVGImage::layout()
 
     // If our bounds changed, notify the parents.
     if (updateCachedBoundariesInParents)
-        RenderImage::setNeedsBoundariesUpdate();
+        RenderSVGModelObject::setNeedsBoundariesUpdate();
 
     repainter.repaintAfterLayout();
     setNeedsLayout(false);
@@ -92,58 +94,43 @@ void RenderSVGImage::layout()
 
 void RenderSVGImage::paint(PaintInfo& paintInfo, int, int)
 {
-    if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN)
+    if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || !m_imageResource->hasImage())
         return;
 
-    paintInfo.context->save();
-    paintInfo.context->concatCTM(localToParentTransform());
-
-    if (paintInfo.phase == PaintPhaseForeground) {
-        PaintInfo savedInfo(paintInfo);
-
-        if (SVGRenderSupport::prepareToRenderSVGContent(this, paintInfo)) {
-            Image* image = imageResource()->image();
-            FloatRect destRect = m_localBounds;
-            FloatRect srcRect(0, 0, image->width(), image->height());
-
-            SVGImageElement* imageElt = static_cast<SVGImageElement*>(node());
-            if (imageElt->preserveAspectRatio().align() != SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE)
-                imageElt->preserveAspectRatio().transformRect(destRect, srcRect);
+    FloatRect boundingBox = repaintRectInLocalCoordinates();
+    if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTransform, paintInfo))
+        return;
 
-            paintInfo.context->drawImage(image, DeviceColorSpace, destRect, srcRect);
-        }
-        SVGRenderSupport::finishRenderSVGContent(this, paintInfo, savedInfo.context);
-    }
+    PaintInfo childPaintInfo(paintInfo);
+    bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline);
+    if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) {
+        childPaintInfo.context->save();
+        childPaintInfo.applyTransform(m_localTransform);
 
-    if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth())
-        paintOutline(paintInfo.context, 0, 0, width(), height());
+        if (childPaintInfo.phase == PaintPhaseForeground) {
+            PaintInfo savedInfo(childPaintInfo);
 
-    paintInfo.context->restore();
-}
+            if (SVGRenderSupport::prepareToRenderSVGContent(this, childPaintInfo)) {
+                Image* image = m_imageResource->image();
+                FloatRect destRect = m_localBounds;
+                FloatRect srcRect(0, 0, image->width(), image->height());
 
-void RenderSVGImage::destroy()
-{
-    SVGResourcesCache::clientDestroyed(this);
-    RenderImage::destroy();
-}
+                SVGImageElement* imageElement = static_cast<SVGImageElement*>(node());
+                if (imageElement->preserveAspectRatio().align() != SVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE)
+                    imageElement->preserveAspectRatio().transformRect(destRect, srcRect);
 
-void RenderSVGImage::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
-{
-    if (diff == StyleDifferenceLayout)
-        setNeedsBoundariesUpdate();
-    RenderImage::styleWillChange(diff, newStyle);
-}
+                childPaintInfo.context->drawImage(image, DeviceColorSpace, destRect, srcRect);
+            }
 
-void RenderSVGImage::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
-{
-    RenderImage::styleDidChange(diff, oldStyle);
-    SVGResourcesCache::clientStyleChanged(this, diff, style());
-}
+            SVGRenderSupport::finishRenderSVGContent(this, childPaintInfo, savedInfo.context);
+        }
 
-void RenderSVGImage::updateFromElement()
-{
-    RenderImage::updateFromElement();
-    SVGResourcesCache::clientUpdatedFromElement(this, style());
+        if (drawsOutline)
+            paintOutline(childPaintInfo.context, static_cast<int>(boundingBox.x()), static_cast<int>(boundingBox.y()),
+                static_cast<int>(boundingBox.width()), static_cast<int>(boundingBox.height()));
+        
+        childPaintInfo.context->restore();
+    }
 }
 
 bool RenderSVGImage::nodeAtFloatPoint(const HitTestRequest& request, HitTestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction)
@@ -171,12 +158,6 @@ bool RenderSVGImage::nodeAtFloatPoint(const HitTestRequest& request, HitTestResu
     return false;
 }
 
-bool RenderSVGImage::nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int, int, int, HitTestAction)
-{
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
 FloatRect RenderSVGImage::repaintRectInLocalCoordinates() const
 {
     // If we already have a cached repaint rect, return that
@@ -189,10 +170,8 @@ FloatRect RenderSVGImage::repaintRectInLocalCoordinates() const
     return m_cachedLocalRepaintRect;
 }
 
-void RenderSVGImage::imageChanged(WrappedImagePtr image, const IntRect* rect)
+void RenderSVGImage::imageChanged(WrappedImagePtr, const IntRect*)
 {
-    RenderImage::imageChanged(image, rect);
-
     // The image resource defaults to nullImage until the resource arrives.
     // This empty image may be cached by SVG resources which must be invalidated.
     if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(this))
@@ -204,21 +183,6 @@ void RenderSVGImage::imageChanged(WrappedImagePtr image, const IntRect* rect)
     repaint();
 }
 
-IntRect RenderSVGImage::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer)
-{
-    return SVGRenderSupport::clippedOverflowRectForRepaint(this, repaintContainer);
-}
-
-void RenderSVGImage::computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed)
-{
-    SVGRenderSupport::computeRectForRepaint(this, repaintContainer, repaintRect, fixed);
-}
-
-void RenderSVGImage::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed , bool useTransforms, TransformState& transformState) const
-{
-    SVGRenderSupport::mapLocalToContainer(this, repaintContainer, fixed, useTransforms, transformState);
-}
-
 void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, int, int)
 {
     // this is called from paint() after the localTransform has already been applied
@@ -227,17 +191,6 @@ void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, int, int)
         rects.append(contentRect);
 }
 
-void RenderSVGImage::absoluteRects(Vector<IntRect>&, int, int)
-{
-    // This code path should never be taken for SVG, as we're assuming useTransforms=true everywhere, absoluteQuads should be used.
-    ASSERT_NOT_REACHED();
-}
-
-void RenderSVGImage::absoluteQuads(Vector<FloatQuad>& quads)
-{
-    quads.append(localToAbsoluteQuad(strokeBoundingBox()));
-}
-
-}
+} // namespace WebCore
 
 #endif // ENABLE(SVG)
diff --git a/WebCore/rendering/RenderSVGImage.h b/WebCore/rendering/RenderSVGImage.h
index 105f0ab..da94568 100644
--- a/WebCore/rendering/RenderSVGImage.h
+++ b/WebCore/rendering/RenderSVGImage.h
@@ -3,6 +3,7 @@
     Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
     Copyright (C) 2007 Rob Buis <buis at kde.org>
     Copyright (C) 2009 Google, Inc.
+    Copyright (C) 2010 Patrick Gansterer <paroga at paroga.com>
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -26,20 +27,25 @@
 #if ENABLE(SVG)
 #include "AffineTransform.h"
 #include "FloatRect.h"
-#include "RenderImage.h"
+#include "RenderSVGModelObject.h"
 #include "SVGPreserveAspectRatio.h"
 #include "SVGRenderSupport.h"
 
 namespace WebCore {
 
+class RenderImageResource;
 class SVGImageElement;
 
-class RenderSVGImage : public RenderImage {
+class RenderSVGImage : public RenderSVGModelObject {
 public:
     RenderSVGImage(SVGImageElement*);
+    virtual ~RenderSVGImage();
 
     virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
 
+    RenderImageResource* imageResource() { return m_imageResource.get(); }
+    const RenderImageResource* imageResource() const { return m_imageResource.get(); }
+
 private:
     virtual const char* renderName() const { return "RenderSVGImage"; }
     virtual bool isSVGImage() const { return true; }
@@ -50,29 +56,16 @@ private:
     virtual FloatRect strokeBoundingBox() const { return m_localBounds; }
     virtual FloatRect repaintRectInLocalCoordinates() const;
 
-    virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
-    virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false);
-
-    virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&) const;
-
-    virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
-    virtual void absoluteQuads(Vector<FloatQuad>&);
     virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
 
     virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
-    
+
     virtual void layout();
     virtual void paint(PaintInfo&, int parentX, int parentY);
 
-    virtual void destroy();
-    virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
-    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
-    virtual void updateFromElement();
-
     virtual bool requiresLayer() const { return false; }
 
     virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
-    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
 
     virtual AffineTransform localTransform() const { return m_localTransform; }
 
@@ -80,6 +73,7 @@ private:
     AffineTransform m_localTransform;
     FloatRect m_localBounds;
     mutable FloatRect m_cachedLocalRepaintRect;
+    OwnPtr<RenderImageResource> m_imageResource;
 };
 
 inline RenderSVGImage* toRenderSVGImage(RenderObject* object)
diff --git a/WebCore/rendering/RenderSVGModelObject.h b/WebCore/rendering/RenderSVGModelObject.h
index 87717c2..9de217c 100644
--- a/WebCore/rendering/RenderSVGModelObject.h
+++ b/WebCore/rendering/RenderSVGModelObject.h
@@ -39,7 +39,7 @@
 namespace WebCore {
 
 // Most renderers in the SVG rendering tree will inherit from this class
-// but not all. (e.g. RenderSVGForeignObject, RenderSVGBlock, RenderSVGImage) thus methods
+// but not all. (e.g. RenderSVGForeignObject, RenderSVGBlock) thus methods
 // required by SVG renders need to be declared on RenderObject, but shared
 // logic can go in this class or in SVGRenderSupport.
 
diff --git a/WebCore/svg/SVGImageElement.cpp b/WebCore/svg/SVGImageElement.cpp
index c422e81..f6fa013 100644
--- a/WebCore/svg/SVGImageElement.cpp
+++ b/WebCore/svg/SVGImageElement.cpp
@@ -26,6 +26,7 @@
 
 #include "Attribute.h"
 #include "CSSPropertyNames.h"
+#include "RenderImageResource.h"
 #include "RenderSVGImage.h"
 #include "RenderSVGResource.h"
 #include "SVGDocument.h"

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list