2010-08-30 Eric Seidel <eric@webkit.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Aug 2010 03:44:23 +0000 (03:44 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Aug 2010 03:44:23 +0000 (03:44 +0000)
        Unreviewed, rolling out r66418.
        http://trac.webkit.org/changeset/66418
        https://bugs.webkit.org/show_bug.cgi?id=44896

        Adam tried to roll this out with:
        https://bugs.webkit.org/show_bug.cgi?id=44924
        but we hit a commit-queue edgecase and it failed, trying again.

        Causing test failures on multiple bots

        * platform/mac-leopard/svg/css/composite-shadow-example-expected.checksum:
        * platform/mac-leopard/svg/css/composite-shadow-example-expected.png:
        * platform/mac-leopard/svg/css/composite-shadow-with-opacity-expected.checksum:
        * platform/mac-leopard/svg/css/composite-shadow-with-opacity-expected.png:
        * platform/mac/svg/css/composite-shadow-example-expected.txt:
        * platform/mac/svg/css/composite-shadow-with-opacity-expected.txt:
2010-08-30  Eric Seidel  <eric@webkit.org>

        Unreviewed, rolling out r66418.
        http://trac.webkit.org/changeset/66418
        https://bugs.webkit.org/show_bug.cgi?id=44896

        Adam tried to roll this out with:
        https://bugs.webkit.org/show_bug.cgi?id=44924
        but we hit a commit-queue edgecase and it failed, trying again.

        Causing test failures on multiple bots

        * rendering/RenderForeignObject.cpp:
        (WebCore::RenderForeignObject::layout):
        * rendering/RenderObject.cpp:
        * rendering/RenderObject.h:
        (WebCore::RenderObject::setNeedsBoundariesUpdate):
        * rendering/RenderObjectChildList.cpp:
        (WebCore::RenderObjectChildList::removeChildNode):
        * rendering/RenderPath.cpp:
        (WebCore::RenderPath::layout):
        (WebCore::RenderPath::paint):
        (WebCore::RenderPath::styleWillChange):
        * rendering/RenderPath.h:
        (WebCore::RenderPath::setNeedsBoundariesUpdate):
        * rendering/RenderSVGBlock.cpp:
        * rendering/RenderSVGBlock.h:
        * rendering/RenderSVGContainer.cpp:
        (WebCore::RenderSVGContainer::RenderSVGContainer):
        (WebCore::RenderSVGContainer::layout):
        (WebCore::RenderSVGContainer::paint):
        (WebCore::RenderSVGContainer::objectBoundingBox):
        (WebCore::RenderSVGContainer::strokeBoundingBox):
        (WebCore::RenderSVGContainer::repaintRectInLocalCoordinates):
        * rendering/RenderSVGContainer.h:
        (WebCore::RenderSVGContainer::calculateLocalTransform):
        * rendering/RenderSVGGradientStop.h:
        * rendering/RenderSVGHiddenContainer.cpp:
        (WebCore::RenderSVGHiddenContainer::clippedOverflowRectForRepaint):
        (WebCore::RenderSVGHiddenContainer::objectBoundingBox):
        (WebCore::RenderSVGHiddenContainer::repaintRectInLocalCoordinates):
        * rendering/RenderSVGHiddenContainer.h:
        * rendering/RenderSVGImage.cpp:
        (WebCore::RenderSVGImage::layout):
        * rendering/RenderSVGImage.h:
        * rendering/RenderSVGInline.cpp:
        * rendering/RenderSVGInline.h:
        * rendering/RenderSVGModelObject.cpp:
        * rendering/RenderSVGModelObject.h:
        * rendering/RenderSVGRoot.cpp:
        (WebCore::RenderSVGRoot::RenderSVGRoot):
        (WebCore::RenderSVGRoot::layout):
        (WebCore::RenderSVGRoot::objectBoundingBox):
        (WebCore::RenderSVGRoot::strokeBoundingBox):
        (WebCore::RenderSVGRoot::repaintRectInLocalCoordinates):
        * rendering/RenderSVGRoot.h:
        * rendering/RenderSVGText.cpp:
        (WebCore::RenderSVGText::layout):
        * rendering/RenderSVGTransformableContainer.cpp:
        (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
        * rendering/RenderSVGTransformableContainer.h:
        * rendering/RenderSVGViewportContainer.cpp:
        (WebCore::RenderSVGViewportContainer::calcViewport):
        * rendering/SVGRenderSupport.cpp:
        (WebCore::SVGRenderSupport::computeContainerBoundingBox):
        * rendering/SVGRenderSupport.h:
        * rendering/style/SVGRenderStyle.cpp:
        (WebCore::SVGRenderStyle::diff):

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

36 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac-leopard/svg/css/composite-shadow-example-expected.checksum
LayoutTests/platform/mac-leopard/svg/css/composite-shadow-example-expected.png
LayoutTests/platform/mac-leopard/svg/css/composite-shadow-with-opacity-expected.checksum
LayoutTests/platform/mac-leopard/svg/css/composite-shadow-with-opacity-expected.png
LayoutTests/platform/mac/svg/css/composite-shadow-example-expected.txt
LayoutTests/platform/mac/svg/css/composite-shadow-with-opacity-expected.txt
WebCore/ChangeLog
WebCore/rendering/RenderForeignObject.cpp
WebCore/rendering/RenderObject.cpp
WebCore/rendering/RenderObject.h
WebCore/rendering/RenderObjectChildList.cpp
WebCore/rendering/RenderPath.cpp
WebCore/rendering/RenderPath.h
WebCore/rendering/RenderSVGBlock.cpp
WebCore/rendering/RenderSVGBlock.h
WebCore/rendering/RenderSVGContainer.cpp
WebCore/rendering/RenderSVGContainer.h
WebCore/rendering/RenderSVGGradientStop.h
WebCore/rendering/RenderSVGHiddenContainer.cpp
WebCore/rendering/RenderSVGHiddenContainer.h
WebCore/rendering/RenderSVGImage.cpp
WebCore/rendering/RenderSVGImage.h
WebCore/rendering/RenderSVGInline.cpp
WebCore/rendering/RenderSVGInline.h
WebCore/rendering/RenderSVGModelObject.cpp
WebCore/rendering/RenderSVGModelObject.h
WebCore/rendering/RenderSVGRoot.cpp
WebCore/rendering/RenderSVGRoot.h
WebCore/rendering/RenderSVGText.cpp
WebCore/rendering/RenderSVGTransformableContainer.cpp
WebCore/rendering/RenderSVGTransformableContainer.h
WebCore/rendering/RenderSVGViewportContainer.cpp
WebCore/rendering/SVGRenderSupport.cpp
WebCore/rendering/SVGRenderSupport.h
WebCore/rendering/style/SVGRenderStyle.cpp

index 0d72274a2060959981d381023f80988b25334bf7..6602e711e0d7a89fc76a9c65a3ed0a030164d252 100644 (file)
@@ -1,3 +1,22 @@
+2010-08-30  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, rolling out r66418.
+        http://trac.webkit.org/changeset/66418
+        https://bugs.webkit.org/show_bug.cgi?id=44896
+
+        Adam tried to roll this out with:
+        https://bugs.webkit.org/show_bug.cgi?id=44924
+        but we hit a commit-queue edgecase and it failed, trying again.
+
+        Causing test failures on multiple bots
+
+        * platform/mac-leopard/svg/css/composite-shadow-example-expected.checksum:
+        * platform/mac-leopard/svg/css/composite-shadow-example-expected.png:
+        * platform/mac-leopard/svg/css/composite-shadow-with-opacity-expected.checksum:
+        * platform/mac-leopard/svg/css/composite-shadow-with-opacity-expected.png:
+        * platform/mac/svg/css/composite-shadow-example-expected.txt:
+        * platform/mac/svg/css/composite-shadow-with-opacity-expected.txt:
+
 2010-08-30  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Eric Seidel.
 2010-08-30  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Eric Seidel.
index 539cb39f8dcb53b602e3134c2450085414ed043f..41e0cbf17a570c28c77a7f7a7aab06155ce97ece 100644 (file)
@@ -1 +1 @@
-8161131336b1925ffe396e63db173b6b
\ No newline at end of file
+85e4e03902685db9779422cee76a38b7
\ No newline at end of file
index a6beabfbdc2e036ff89b1364c42068a01fc73d3e..9f897585c138f7da495354c83190753856f521e5 100644 (file)
Binary files a/LayoutTests/platform/mac-leopard/svg/css/composite-shadow-example-expected.png and b/LayoutTests/platform/mac-leopard/svg/css/composite-shadow-example-expected.png differ
index 470211be0dbbbbf2556752fdc937711a64138da4..044f90a2589be254670fc146a6205ed369a410e0 100644 (file)
@@ -1 +1 @@
-87c3a71c83dd3602d760dc1558148679
\ No newline at end of file
+37ce6f48a37bde5464635bcc0926a03a
\ No newline at end of file
index fcbd8b211b0bb3d9001583dbf1f30044139668e7..18e8426b1afaeb628d8757b3dd7fbe0049e2a87a 100644 (file)
Binary files a/LayoutTests/platform/mac-leopard/svg/css/composite-shadow-with-opacity-expected.png and b/LayoutTests/platform/mac-leopard/svg/css/composite-shadow-with-opacity-expected.png differ
index ed0977fe7e6599518c2d6dfc483250bfdab3611a..074edbc278602db31d5be68f80761f651f703a63 100644 (file)
@@ -3,7 +3,7 @@ layer at (0,0) size 785x616
 layer at (0,0) size 785x616
   RenderBlock {HTML} at (0,0) size 785x616
     RenderBody {BODY} at (8,8) size 769x600
 layer at (0,0) size 785x616
   RenderBlock {HTML} at (0,0) size 785x616
     RenderBody {BODY} at (8,8) size 769x600
-      RenderSVGRoot {svg} at (40,36) size 446x160
+      RenderSVGRoot {svg} at (40,36) size 436x150
         RenderSVGContainer {g} at (40,36) size 146x140
           RenderPath {path} at (40,36) size 146x140 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M0.00,30.00 L-35.27,48.54 L-28.53,9.27 L-57.06,-18.54 L-17.63,-24.27 L-0.00,-60.00 L17.63,-24.27 L57.06,-18.54 L28.53,9.27 L35.27,48.54 Z"]
         RenderSVGContainer {g} at (200,46) size 128x125
         RenderSVGContainer {g} at (40,36) size 146x140
           RenderPath {path} at (40,36) size 146x140 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M0.00,30.00 L-35.27,48.54 L-28.53,9.27 L-57.06,-18.54 L-17.63,-24.27 L-0.00,-60.00 L17.63,-24.27 L57.06,-18.54 L28.53,9.27 L35.27,48.54 Z"]
         RenderSVGContainer {g} at (200,46) size 128x125
index 95fbf09659b4242cedb64876d4028c55b6b5d142..f741ef2e8529b2bdd066a207062e30ed6970f1ed 100644 (file)
@@ -4,7 +4,7 @@ layer at (0,0) size 785x616
   RenderBlock {HTML} at (0,0) size 785x616
     RenderBody {BODY} at (8,8) size 769x600
 layer at (8,8) size 769x600
   RenderBlock {HTML} at (0,0) size 785x616
     RenderBody {BODY} at (8,8) size 769x600
 layer at (8,8) size 769x600
-  RenderSVGRoot {svg} at (40,36) size 446x160 [opacity=0.50]
+  RenderSVGRoot {svg} at (40,36) size 436x150 [opacity=0.50]
     RenderSVGContainer {g} at (40,36) size 146x140
       RenderPath {path} at (40,36) size 146x140 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M0.00,30.00 L-35.27,48.54 L-28.53,9.27 L-57.06,-18.54 L-17.63,-24.27 L-0.00,-60.00 L17.63,-24.27 L57.06,-18.54 L28.53,9.27 L35.27,48.54 Z"]
     RenderSVGContainer {g} at (200,46) size 128x125
     RenderSVGContainer {g} at (40,36) size 146x140
       RenderPath {path} at (40,36) size 146x140 [transform={m=((1.00,0.00)(0.00,1.00)) t=(100.00,100.00)}] [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M0.00,30.00 L-35.27,48.54 L-28.53,9.27 L-57.06,-18.54 L-17.63,-24.27 L-0.00,-60.00 L17.63,-24.27 L57.06,-18.54 L28.53,9.27 L35.27,48.54 Z"]
     RenderSVGContainer {g} at (200,46) size 128x125
index f4aaaa0eba6a696d3a7d8acf634a2633489ab3ff..e874cd3b68e5f4937f34bc0508c9c8cadceca942 100644 (file)
@@ -1,3 +1,72 @@
+2010-08-30  Eric Seidel  <eric@webkit.org>
+
+        Unreviewed, rolling out r66418.
+        http://trac.webkit.org/changeset/66418
+        https://bugs.webkit.org/show_bug.cgi?id=44896
+
+        Adam tried to roll this out with:
+        https://bugs.webkit.org/show_bug.cgi?id=44924
+        but we hit a commit-queue edgecase and it failed, trying again.
+
+        Causing test failures on multiple bots
+
+        * rendering/RenderForeignObject.cpp:
+        (WebCore::RenderForeignObject::layout):
+        * rendering/RenderObject.cpp:
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::setNeedsBoundariesUpdate):
+        * rendering/RenderObjectChildList.cpp:
+        (WebCore::RenderObjectChildList::removeChildNode):
+        * rendering/RenderPath.cpp:
+        (WebCore::RenderPath::layout):
+        (WebCore::RenderPath::paint):
+        (WebCore::RenderPath::styleWillChange):
+        * rendering/RenderPath.h:
+        (WebCore::RenderPath::setNeedsBoundariesUpdate):
+        * rendering/RenderSVGBlock.cpp:
+        * rendering/RenderSVGBlock.h:
+        * rendering/RenderSVGContainer.cpp:
+        (WebCore::RenderSVGContainer::RenderSVGContainer):
+        (WebCore::RenderSVGContainer::layout):
+        (WebCore::RenderSVGContainer::paint):
+        (WebCore::RenderSVGContainer::objectBoundingBox):
+        (WebCore::RenderSVGContainer::strokeBoundingBox):
+        (WebCore::RenderSVGContainer::repaintRectInLocalCoordinates):
+        * rendering/RenderSVGContainer.h:
+        (WebCore::RenderSVGContainer::calculateLocalTransform):
+        * rendering/RenderSVGGradientStop.h:
+        * rendering/RenderSVGHiddenContainer.cpp:
+        (WebCore::RenderSVGHiddenContainer::clippedOverflowRectForRepaint):
+        (WebCore::RenderSVGHiddenContainer::objectBoundingBox):
+        (WebCore::RenderSVGHiddenContainer::repaintRectInLocalCoordinates):
+        * rendering/RenderSVGHiddenContainer.h:
+        * rendering/RenderSVGImage.cpp:
+        (WebCore::RenderSVGImage::layout):
+        * rendering/RenderSVGImage.h:
+        * rendering/RenderSVGInline.cpp:
+        * rendering/RenderSVGInline.h:
+        * rendering/RenderSVGModelObject.cpp:
+        * rendering/RenderSVGModelObject.h:
+        * rendering/RenderSVGRoot.cpp:
+        (WebCore::RenderSVGRoot::RenderSVGRoot):
+        (WebCore::RenderSVGRoot::layout):
+        (WebCore::RenderSVGRoot::objectBoundingBox):
+        (WebCore::RenderSVGRoot::strokeBoundingBox):
+        (WebCore::RenderSVGRoot::repaintRectInLocalCoordinates):
+        * rendering/RenderSVGRoot.h:
+        * rendering/RenderSVGText.cpp:
+        (WebCore::RenderSVGText::layout):
+        * rendering/RenderSVGTransformableContainer.cpp:
+        (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
+        * rendering/RenderSVGTransformableContainer.h:
+        * rendering/RenderSVGViewportContainer.cpp:
+        (WebCore::RenderSVGViewportContainer::calcViewport):
+        * rendering/SVGRenderSupport.cpp:
+        (WebCore::SVGRenderSupport::computeContainerBoundingBox):
+        * rendering/SVGRenderSupport.h:
+        * rendering/style/SVGRenderStyle.cpp:
+        (WebCore::SVGRenderStyle::diff):
+
 2010-08-30  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Eric Seidel.
 2010-08-30  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Eric Seidel.
index bfcb9408f52ebbcb0c2d959088676317211c978b..50c1a42d9d0dbbb4882a4ab6c9673a692c97565f 100644 (file)
@@ -102,20 +102,14 @@ void RenderForeignObject::layout()
     LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
     SVGForeignObjectElement* foreign = static_cast<SVGForeignObjectElement*>(node());
 
     LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
     SVGForeignObjectElement* foreign = static_cast<SVGForeignObjectElement*>(node());
 
-    bool updateCachedBoundariesInParents = false;
     if (m_needsTransformUpdate) {
         m_localTransform = foreign->animatedLocalTransform();
         m_needsTransformUpdate = false;
     if (m_needsTransformUpdate) {
         m_localTransform = foreign->animatedLocalTransform();
         m_needsTransformUpdate = false;
-        updateCachedBoundariesInParents = true;
     }
 
     }
 
-    FloatRect oldViewport = m_viewport;
-
     // Cache viewport boundaries
     FloatPoint viewportLocation(foreign->x().value(foreign), foreign->y().value(foreign));
     m_viewport = FloatRect(viewportLocation, FloatSize(foreign->width().value(foreign), foreign->height().value(foreign)));
     // Cache viewport boundaries
     FloatPoint viewportLocation(foreign->x().value(foreign), foreign->y().value(foreign));
     m_viewport = FloatRect(viewportLocation, FloatSize(foreign->width().value(foreign), foreign->height().value(foreign)));
-    if (!updateCachedBoundariesInParents)
-        updateCachedBoundariesInParents = oldViewport != m_viewport;
 
     // Set box origin to the foreignObject x/y translation, so positioned objects in XHTML content get correct
     // positions. A regular RenderBoxModelObject would pull this information from RenderStyle - in SVG those
 
     // Set box origin to the foreignObject x/y translation, so positioned objects in XHTML content get correct
     // positions. A regular RenderBoxModelObject would pull this information from RenderStyle - in SVG those
@@ -128,10 +122,6 @@ void RenderForeignObject::layout()
     RenderBlock::layout();
     ASSERT(!needsLayout());
 
     RenderBlock::layout();
     ASSERT(!needsLayout());
 
-    // If our bounds changed, notify the parents.
-    if (updateCachedBoundariesInParents)
-        RenderSVGBlock::setNeedsBoundariesUpdate();
-
     // Invalidate all resources of this client if our layout changed.
     if (layoutChanged)
         SVGResourcesCache::clientLayoutChanged(this);
     // Invalidate all resources of this client if our layout changed.
     if (layoutChanged)
         SVGResourcesCache::clientLayoutChanged(this);
index d01b92d94123d388ad9b028d50555c3f2b95cca4..576aad024ac2ecf1ad412ff17302adc57d8f1571 100644 (file)
@@ -2692,12 +2692,6 @@ RenderSVGResourceContainer* RenderObject::toRenderSVGResourceContainer()
     return 0;
 }
 
     return 0;
 }
 
-void RenderObject::setNeedsBoundariesUpdate()
-{
-    if (RenderObject* renderer = parent())
-        renderer->setNeedsBoundariesUpdate();
-}
-
 FloatRect RenderObject::objectBoundingBox() const
 {
     ASSERT_NOT_REACHED();
 FloatRect RenderObject::objectBoundingBox() const
 {
     ASSERT_NOT_REACHED();
index 9fbaf910a897d37ed90fd725decbfa7ac24b5cfd..34eba6d8f487e4e840745aee33507ef3176e446c 100644 (file)
@@ -327,7 +327,7 @@ public:
     // Unfortunately we don't have such a class yet, because it's not possible for all renderers
     // to inherit from RenderSVGObject -> RenderObject (some need RenderBlock inheritance for instance)
     virtual void setNeedsTransformUpdate() { }
     // Unfortunately we don't have such a class yet, because it's not possible for all renderers
     // to inherit from RenderSVGObject -> RenderObject (some need RenderBlock inheritance for instance)
     virtual void setNeedsTransformUpdate() { }
-    virtual void setNeedsBoundariesUpdate();
+    virtual void setNeedsBoundariesUpdate() { }
 
     // Per SVG 1.1 objectBoundingBox ignores clipping, masking, filter effects, opacity and stroke-width.
     // This is used for all computation of objectBoundingBox relative units and by SVGLocateable::getBBox().
 
     // Per SVG 1.1 objectBoundingBox ignores clipping, masking, filter effects, opacity and stroke-width.
     // This is used for all computation of objectBoundingBox relative units and by SVGLocateable::getBBox().
index 96ec8005183309c50405176766bf8be3597eb4c6..d8c79556fdb0ce2a46f8c6b3daba7d920b8df76f 100644 (file)
@@ -98,11 +98,6 @@ RenderObject* RenderObjectChildList::removeChildNode(RenderObject* owner, Render
 
         if (oldChild->isPositioned() && owner->childrenInline())
             owner->dirtyLinesFromChangedChild(oldChild);
 
         if (oldChild->isPositioned() && owner->childrenInline())
             owner->dirtyLinesFromChangedChild(oldChild);
-
-#if ENABLE(SVG)
-        // Update cached boundaries in SVG renderers, if a child is removed.
-        owner->setNeedsBoundariesUpdate();
-#endif
     }
     
     // If oldChild is the start or end of the selection, then clear the selection to
     }
     
     // If oldChild is the start or end of the selection, then clear the selection to
index 0f31df1d5ac758d2a56b791db84ca7b76137817c..86a12c84da47d555a1bd79123b6acf4737c14750 100644 (file)
@@ -101,39 +101,28 @@ void RenderPath::layout()
     LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
     SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
 
     LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
     SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
 
-    bool updateCachedBoundariesInParents = false;
-
     bool needsPathUpdate = m_needsPathUpdate;
     if (needsPathUpdate) {
         m_path = element->toPathData();
         m_needsPathUpdate = false;
     bool needsPathUpdate = m_needsPathUpdate;
     if (needsPathUpdate) {
         m_path = element->toPathData();
         m_needsPathUpdate = false;
-        updateCachedBoundariesInParents = true;
     }
 
     if (m_needsTransformUpdate) {
         m_localTransform = element->animatedLocalTransform();
         m_needsTransformUpdate = false;
     }
 
     if (m_needsTransformUpdate) {
         m_localTransform = element->animatedLocalTransform();
         m_needsTransformUpdate = false;
-        updateCachedBoundariesInParents = true;
     }
 
     }
 
-    if (m_needsBoundariesUpdate)
-        updateCachedBoundariesInParents = true;
-
     // Invalidate all resources of this client if our layout changed.
     if (m_everHadLayout && selfNeedsLayout())
         SVGResourcesCache::clientLayoutChanged(this);
 
     // At this point LayoutRepainter already grabbed the old bounds,
     // Invalidate all resources of this client if our layout changed.
     if (m_everHadLayout && selfNeedsLayout())
         SVGResourcesCache::clientLayoutChanged(this);
 
     // At this point LayoutRepainter already grabbed the old bounds,
-    // recalculate them now so repaintAfterLayout() uses the new bounds.
+    // recalculate them now so repaintAfterLayout() uses the new bounds
     if (needsPathUpdate || m_needsBoundariesUpdate) {
         updateCachedBoundaries();
         m_needsBoundariesUpdate = false;
     }
 
     if (needsPathUpdate || m_needsBoundariesUpdate) {
         updateCachedBoundaries();
         m_needsBoundariesUpdate = false;
     }
 
-    // If our bounds changed, notify the parents.
-    if (updateCachedBoundariesInParents)
-        RenderSVGModelObject::setNeedsBoundariesUpdate();
-
     repainter.repaintAfterLayout();
     setNeedsLayout(false);
 }
     repainter.repaintAfterLayout();
     setNeedsLayout(false);
 }
@@ -183,7 +172,8 @@ void RenderPath::paint(PaintInfo& paintInfo, int, int)
         return;
 
     FloatRect boundingBox = repaintRectInLocalCoordinates();
         return;
 
     FloatRect boundingBox = repaintRectInLocalCoordinates();
-    if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTransform, paintInfo))
+    FloatRect nonLocalBoundingBox = m_localTransform.mapRect(boundingBox);
+    if (!nonLocalBoundingBox.intersects(paintInfo.rect))
         return;
 
     PaintInfo childPaintInfo(paintInfo);
         return;
 
     PaintInfo childPaintInfo(paintInfo);
@@ -280,6 +270,13 @@ FloatRect RenderPath::calculateMarkerBoundsIfNeeded()
     return m_markerLayoutInfo.calculateBoundaries(markerStart, markerMid, markerEnd, svgStyle->strokeWidth().value(svgElement), m_path);
 }
 
     return m_markerLayoutInfo.calculateBoundaries(markerStart, markerMid, markerEnd, svgStyle->strokeWidth().value(svgElement), m_path);
 }
 
+void RenderPath::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
+{
+    if (diff == StyleDifferenceLayout)
+        setNeedsBoundariesUpdate();
+    RenderSVGModelObject::styleWillChange(diff, newStyle);
+}
+
 void RenderPath::updateCachedBoundaries()
 {
     if (m_path.isEmpty()) {
 void RenderPath::updateCachedBoundaries()
 {
     if (m_path.isEmpty()) {
index 1d35a01cc5a7c4458e4a535ee6d6066492ff07ee..1bdac07367e0b33752fe77bdd60293cb961f1b25 100644 (file)
@@ -41,8 +41,8 @@ public:
     RenderPath(SVGStyledTransformableElement*);
 
     const Path& path() const { return m_path; }
     RenderPath(SVGStyledTransformableElement*);
 
     const Path& path() const { return m_path; }
+    void setNeedsBoundariesUpdate() { m_needsBoundariesUpdate = true; }
     void setNeedsPathUpdate() { m_needsPathUpdate = true; }
     void setNeedsPathUpdate() { m_needsPathUpdate = true; }
-    virtual void setNeedsBoundariesUpdate() { m_needsBoundariesUpdate = true; }
     virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
 
 private:
     virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
 
 private:
@@ -63,6 +63,7 @@ private:
     virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
 
     virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
     virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
 
     virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
+    virtual void styleWillChange(StyleDifference, const RenderStyle*);
 
     FloatRect calculateMarkerBoundsIfNeeded();
     void updateCachedBoundaries();
 
     FloatRect calculateMarkerBoundsIfNeeded();
     void updateCachedBoundaries();
index b2d727a11f43b6393416bc89daef746e48758ba1..d6022b51792a6021877d8134db24d5aefb6238b3 100644 (file)
@@ -81,13 +81,6 @@ void RenderSVGBlock::destroy()
     RenderBlock::destroy();
 }
 
     RenderBlock::destroy();
 }
 
-void RenderSVGBlock::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
-{
-    if (diff == StyleDifferenceLayout)
-        setNeedsBoundariesUpdate();
-    RenderBlock::styleWillChange(diff, newStyle);
-}
-
 void RenderSVGBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderBlock::styleDidChange(diff, oldStyle);
 void RenderSVGBlock::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderBlock::styleDidChange(diff, oldStyle);
index c1379da7a35b69d49c1216ed6ae1439a5e08de3e..c4337cc910708ac27abd28dd35f869d3cd64e048 100644 (file)
@@ -40,7 +40,6 @@ private:
     virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
 
     virtual void destroy();
     virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
 
     virtual void destroy();
-    virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     virtual void updateFromElement();
 };
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     virtual void updateFromElement();
 };
index 8c9927008435cf2665c8ffe82eb3d9a13959e83e..bab07a4b997a1d80a67e0cd74d213456985a788c 100644 (file)
@@ -39,7 +39,6 @@ namespace WebCore {
 RenderSVGContainer::RenderSVGContainer(SVGStyledElement* node)
     : RenderSVGModelObject(node)
     , m_drawsContents(true)
 RenderSVGContainer::RenderSVGContainer(SVGStyledElement* node)
     : RenderSVGModelObject(node)
     , m_drawsContents(true)
-    , m_needsBoundariesUpdate(true)
 {
 }
 
 {
 }
 
@@ -56,7 +55,7 @@ void RenderSVGContainer::layout()
     LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
 
     // Allow RenderSVGTransformableContainer to update its transform.
     LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
 
     // Allow RenderSVGTransformableContainer to update its transform.
-    bool updatedTransform = calculateLocalTransform();
+    calculateLocalTransform();
 
     SVGRenderSupport::layoutChildren(this, selfNeedsLayout());
 
 
     SVGRenderSupport::layoutChildren(this, selfNeedsLayout());
 
@@ -64,16 +63,6 @@ void RenderSVGContainer::layout()
     if (m_everHadLayout && selfNeedsLayout())
         SVGResourcesCache::clientLayoutChanged(this);
 
     if (m_everHadLayout && selfNeedsLayout())
         SVGResourcesCache::clientLayoutChanged(this);
 
-    // At this point LayoutRepainter already grabbed the old bounds,
-    // recalculate them now so repaintAfterLayout() uses the new bounds.
-    if (m_needsBoundariesUpdate || updatedTransform) {
-        updateCachedBoundaries();
-        m_needsBoundariesUpdate = false;
-    
-        // If our bounds changed, notify the parents.
-        RenderSVGModelObject::setNeedsBoundariesUpdate();
-    }
-
     repainter.repaintAfterLayout();
     setNeedsLayout(false);
 }
     repainter.repaintAfterLayout();
     setNeedsLayout(false);
 }
@@ -97,10 +86,6 @@ void RenderSVGContainer::paint(PaintInfo& paintInfo, int, int)
     if (!firstChild() && !selfWillPaint())
         return;
 
     if (!firstChild() && !selfWillPaint())
         return;
 
-    FloatRect repaintRect = repaintRectInLocalCoordinates();
-    if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(repaintRect, localToParentTransform(), paintInfo))
-        return;
-
     PaintInfo childPaintInfo(paintInfo);
     childPaintInfo.context->save();
 
     PaintInfo childPaintInfo(paintInfo);
     childPaintInfo.context->save();
 
@@ -130,7 +115,7 @@ void RenderSVGContainer::paint(PaintInfo& paintInfo, int, int)
     // FIXME: This means our focus ring won't share our rotation like it should.
     // We should instead disable our clip during PaintPhaseOutline
     if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE) {
     // FIXME: This means our focus ring won't share our rotation like it should.
     // We should instead disable our clip during PaintPhaseOutline
     if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE) {
-        IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(repaintRect));
+        IntRect paintRectInParent = enclosingIntRect(localToParentTransform().mapRect(repaintRectInLocalCoordinates()));
         paintOutline(paintInfo.context, paintRectInParent.x(), paintRectInParent.y(), paintRectInParent.width(), paintRectInParent.height());
     }
 }
         paintOutline(paintInfo.context, paintRectInParent.x(), paintRectInParent.y(), paintRectInParent.width(), paintRectInParent.height());
     }
 }
@@ -143,14 +128,21 @@ void RenderSVGContainer::addFocusRingRects(Vector<IntRect>& rects, int, int)
         rects.append(paintRectInParent);
 }
 
         rects.append(paintRectInParent);
 }
 
-void RenderSVGContainer::updateCachedBoundaries()
+FloatRect RenderSVGContainer::objectBoundingBox() const
 {
 {
-    m_objectBoundingBox = FloatRect();
-    m_strokeBoundingBox = FloatRect();
-    m_repaintBoundingBox = FloatRect();
+    return SVGRenderSupport::computeContainerBoundingBox(this, SVGRenderSupport::ObjectBoundingBox);
+}
 
 
-    SVGRenderSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m_strokeBoundingBox, m_repaintBoundingBox);
-    SVGRenderSupport::intersectRepaintRectWithResources(this, m_repaintBoundingBox);
+FloatRect RenderSVGContainer::strokeBoundingBox() const
+{
+    return SVGRenderSupport::computeContainerBoundingBox(this, SVGRenderSupport::StrokeBoundingBox);
+}
+
+FloatRect RenderSVGContainer::repaintRectInLocalCoordinates() const
+{
+    FloatRect repaintRect = SVGRenderSupport::computeContainerBoundingBox(this, SVGRenderSupport::RepaintBoundingBox);
+    SVGRenderSupport::intersectRepaintRectWithResources(this, repaintRect);
+    return repaintRect;
 }
 
 bool RenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction)
 }
 
 bool RenderSVGContainer::nodeAtFloatPoint(const HitTestRequest& request, HitTestResult& result, const FloatPoint& pointInParent, HitTestAction hitTestAction)
index b0c952f4a2ddf6cda49fe6aa5a938e2f8aa6644b..0a122cda1e76434a70c62060cb0cf6766ca53b94 100644 (file)
@@ -43,7 +43,6 @@ public:
     bool drawsContents() const { return m_drawsContents; }
 
     virtual void paint(PaintInfo&, int parentX, int parentY);
     bool drawsContents() const { return m_drawsContents; }
 
     virtual void paint(PaintInfo&, int parentX, int parentY);
-    virtual void setNeedsBoundariesUpdate() { m_needsBoundariesUpdate = true; }
 
 protected:
     virtual RenderObjectChildList* virtualChildren() { return children(); }
 
 protected:
     virtual RenderObjectChildList* virtualChildren() { return children(); }
@@ -56,14 +55,14 @@ protected:
 
     virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
 
 
     virtual void addFocusRingRects(Vector<IntRect>&, int tx, int ty);
 
-    virtual FloatRect objectBoundingBox() const { return m_objectBoundingBox; }
-    virtual FloatRect strokeBoundingBox() const { return m_strokeBoundingBox; }
-    virtual FloatRect repaintRectInLocalCoordinates() const { return m_repaintBoundingBox; }
+    virtual FloatRect objectBoundingBox() const;
+    virtual FloatRect strokeBoundingBox() const;
+    virtual FloatRect repaintRectInLocalCoordinates() const;
 
     virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
 
     // Allow RenderSVGTransformableContainer to hook in at the right time in layout()
 
     virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
 
     // Allow RenderSVGTransformableContainer to hook in at the right time in layout()
-    virtual bool calculateLocalTransform() { return false; }
+    virtual void calculateLocalTransform() { }
 
     // Allow RenderSVGViewportContainer to hook in at the right times in layout(), paint() and nodeAtFloatPoint()
     virtual void calcViewport() { }
 
     // Allow RenderSVGViewportContainer to hook in at the right times in layout(), paint() and nodeAtFloatPoint()
     virtual void calcViewport() { }
@@ -71,15 +70,10 @@ protected:
     virtual bool pointIsInsideViewportClip(const FloatPoint& /*pointInParent*/) { return true; }
 
     bool selfWillPaint();
     virtual bool pointIsInsideViewportClip(const FloatPoint& /*pointInParent*/) { return true; }
 
     bool selfWillPaint();
-    void updateCachedBoundaries();
 
 private:
     RenderObjectChildList m_children;
 
 private:
     RenderObjectChildList m_children;
-    FloatRect m_objectBoundingBox;
-    FloatRect m_strokeBoundingBox;
-    FloatRect m_repaintBoundingBox;
     bool m_drawsContents : 1;
     bool m_drawsContents : 1;
-    bool m_needsBoundariesUpdate : 1;
 };
   
 inline RenderSVGContainer* toRenderSVGContainer(RenderObject* object)
 };
   
 inline RenderSVGContainer* toRenderSVGContainer(RenderObject* object)
index f06a9a59d85614ce6ecf1071f45aa2ab79dab2e8..45da7b4e677a1c376207e0ea46ec520674288ced 100644 (file)
@@ -46,7 +46,6 @@ public:
     // https://bugs.webkit.org/show_bug.cgi?id=20400
     virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject*) { return IntRect(); }
     virtual FloatRect objectBoundingBox() const { return FloatRect(); }
     // https://bugs.webkit.org/show_bug.cgi?id=20400
     virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject*) { return IntRect(); }
     virtual FloatRect objectBoundingBox() const { return FloatRect(); }
-    virtual FloatRect strokeBoundingBox() const { return FloatRect(); }
     virtual FloatRect repaintRectInLocalCoordinates() const { return FloatRect(); }
 
 protected:
     virtual FloatRect repaintRectInLocalCoordinates() const { return FloatRect(); }
 
 protected:
index ee1d214c78159e20b00759e8b564ce72b02632fc..0af4236db023fc736bbeca16379cca2f4f84d18f 100644 (file)
@@ -47,6 +47,11 @@ void RenderSVGHiddenContainer::paint(PaintInfo&, int, int)
     // This subtree does not paint.
 }
 
     // This subtree does not paint.
 }
 
+IntRect RenderSVGHiddenContainer::clippedOverflowRectForRepaint(RenderBoxModelObject* /*repaintContainer*/)
+{
+    return IntRect();
+}
+
 void RenderSVGHiddenContainer::absoluteQuads(Vector<FloatQuad>&)
 {
     // This subtree does not take up space or paint
 void RenderSVGHiddenContainer::absoluteQuads(Vector<FloatQuad>&)
 {
     // This subtree does not take up space or paint
@@ -57,6 +62,16 @@ bool RenderSVGHiddenContainer::nodeAtFloatPoint(const HitTestRequest&, HitTestRe
     return false;
 }
 
     return false;
 }
 
+FloatRect RenderSVGHiddenContainer::objectBoundingBox() const
+{
+    return FloatRect();
+}
+
+FloatRect RenderSVGHiddenContainer::repaintRectInLocalCoordinates() const
+{
+    return FloatRect();
+}
+
 }
 
 #endif // ENABLE(SVG)
 }
 
 #endif // ENABLE(SVG)
index 97800d46c6354fbf4a5dd5f6d9b31fe654d1dc84..e0daac1943f29351086ce79b8cbc960bad99e320 100644 (file)
@@ -47,9 +47,12 @@ namespace WebCore {
 
         virtual void paint(PaintInfo&, int parentX, int parentY);
         
 
         virtual void paint(PaintInfo&, int parentX, int parentY);
         
-        virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject*) { return IntRect(); }
+        virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
         virtual void absoluteQuads(Vector<FloatQuad>&);
 
         virtual void absoluteQuads(Vector<FloatQuad>&);
 
+        virtual FloatRect objectBoundingBox() const;
+        virtual FloatRect repaintRectInLocalCoordinates() const;
+
         virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
     };
 }
         virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
     };
 }
index 5e30465334a53ee2dedfa385dd094287e2e34db1..6214ffee4aaf4ba28d03adec00df8e78a8129b7c 100644 (file)
@@ -57,11 +57,9 @@ void RenderSVGImage::layout()
     LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
     SVGImageElement* image = static_cast<SVGImageElement*>(node());
 
     LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
     SVGImageElement* image = static_cast<SVGImageElement*>(node());
 
-    bool updateCachedBoundariesInParents = false;
     if (m_needsTransformUpdate) {
         m_localTransform = image->animatedLocalTransform();
         m_needsTransformUpdate = false;
     if (m_needsTransformUpdate) {
         m_localTransform = image->animatedLocalTransform();
         m_needsTransformUpdate = false;
-        updateCachedBoundariesInParents = true;
     }
 
     // minimum height
     }
 
     // minimum height
@@ -71,21 +69,13 @@ void RenderSVGImage::layout()
     calcHeight();
 
     // FIXME: Optimize caching the repaint rects.
     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));
     m_cachedLocalRepaintRect = FloatRect();
 
     m_localBounds = FloatRect(image->x().value(image), image->y().value(image), image->width().value(image), image->height().value(image));
     m_cachedLocalRepaintRect = FloatRect();
 
-    if (!updateCachedBoundariesInParents)
-        updateCachedBoundariesInParents = oldBoundaries != m_localBounds;
-
     // Invalidate all resources of this client if our layout changed.
     if (m_everHadLayout && selfNeedsLayout())
         SVGResourcesCache::clientLayoutChanged(this);
 
     // Invalidate all resources of this client if our layout changed.
     if (m_everHadLayout && selfNeedsLayout())
         SVGResourcesCache::clientLayoutChanged(this);
 
-    // If our bounds changed, notify the parents.
-    if (updateCachedBoundariesInParents)
-        RenderImage::setNeedsBoundariesUpdate();
-
     repainter.repaintAfterLayout();
     setNeedsLayout(false);
 }
     repainter.repaintAfterLayout();
     setNeedsLayout(false);
 }
@@ -127,13 +117,6 @@ void RenderSVGImage::destroy()
     RenderImage::destroy();
 }
 
     RenderImage::destroy();
 }
 
-void RenderSVGImage::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
-{
-    if (diff == StyleDifferenceLayout)
-        setNeedsBoundariesUpdate();
-    RenderImage::styleWillChange(diff, newStyle);
-}
-
 void RenderSVGImage::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderImage::styleDidChange(diff, oldStyle);
 void RenderSVGImage::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderImage::styleDidChange(diff, oldStyle);
index 105f0ab0ec0b0777d2d67eb69fb40fac973983b0..38e3a13643be51412f4bcb7b9b05249a5fc1ccf5 100644 (file)
@@ -65,7 +65,6 @@ private:
     virtual void paint(PaintInfo&, int parentX, int parentY);
 
     virtual void destroy();
     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 void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     virtual void updateFromElement();
 
index bc6bc12a2a38a5d50de92bf5f88165525466716b..93e6a067fb286abedbd5a96b7434a202168b2fd9 100644 (file)
@@ -99,13 +99,6 @@ void RenderSVGInline::destroy()
     RenderInline::destroy();
 }
 
     RenderInline::destroy();
 }
 
-void RenderSVGInline::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
-{
-    if (diff == StyleDifferenceLayout)
-        setNeedsBoundariesUpdate();
-    RenderInline::styleWillChange(diff, newStyle);
-}
-
 void RenderSVGInline::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderInline::styleDidChange(diff, oldStyle);
 void RenderSVGInline::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderInline::styleDidChange(diff, oldStyle);
index fb38f1bbc9141e70f3ef0c1ec62ad001e1f6c1a5..56d911f0dee63f389bc58c6db482a4b219250adf 100644 (file)
@@ -56,7 +56,6 @@ private:
     virtual InlineFlowBox* createInlineFlowBox();
 
     virtual void destroy();
     virtual InlineFlowBox* createInlineFlowBox();
 
     virtual void destroy();
-    virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     virtual void updateFromElement();
 };
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     virtual void updateFromElement();
 };
index 28760a04f7b4e30731b662c6bca8fa21d29f2803..5a19749660d6e0099be9e0d6e21ddd802914bdfc 100644 (file)
@@ -87,13 +87,6 @@ void RenderSVGModelObject::destroy()
     RenderObject::destroy();
 }
 
     RenderObject::destroy();
 }
 
-void RenderSVGModelObject::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
-{
-    if (diff == StyleDifferenceLayout)
-        setNeedsBoundariesUpdate();
-    RenderObject::styleWillChange(diff, newStyle);
-}
-
 void RenderSVGModelObject::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderObject::styleDidChange(diff, oldStyle);
 void RenderSVGModelObject::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderObject::styleDidChange(diff, oldStyle);
index 87717c2351d2816d635ec43916bfbb24a53b2eec..35c4dc304b9bf26e058759d12038381f3d5b117b 100644 (file)
@@ -61,7 +61,6 @@ public:
     virtual void destroy();
 
     virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&) const;
     virtual void destroy();
 
     virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&) const;
-    virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     virtual void updateFromElement();
 
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     virtual void updateFromElement();
 
index 24284691184351881b7d31ac5b8881ce47e27914..59956688e57d08041b291c77985bac0b6c11611f 100644 (file)
@@ -48,7 +48,6 @@ namespace WebCore {
 RenderSVGRoot::RenderSVGRoot(SVGStyledElement* node)
     : RenderBox(node)
     , m_isLayoutSizeChanged(false)
 RenderSVGRoot::RenderSVGRoot(SVGStyledElement* node)
     : RenderBox(node)
     , m_isLayoutSizeChanged(false)
-    , m_needsBoundariesOrTransformUpdate(true)
 {
     setReplaced(true);
 }
 {
     setReplaced(true);
 }
@@ -125,13 +124,6 @@ void RenderSVGRoot::layout()
     SVGRenderSupport::layoutChildren(this, needsLayout);
     m_isLayoutSizeChanged = false;
 
     SVGRenderSupport::layoutChildren(this, needsLayout);
     m_isLayoutSizeChanged = false;
 
-    // At this point LayoutRepainter already grabbed the old bounds,
-    // recalculate them now so repaintAfterLayout() uses the new bounds.
-    if (m_needsBoundariesOrTransformUpdate) {
-        updateCachedBoundaries();
-        m_needsBoundariesOrTransformUpdate = false;
-    }
-
     repainter.repaintAfterLayout();
 
     view()->enableLayoutState();
     repainter.repaintAfterLayout();
 
     view()->enableLayoutState();
@@ -204,13 +196,6 @@ void RenderSVGRoot::destroy()
     RenderBox::destroy();
 }
 
     RenderBox::destroy();
 }
 
-void RenderSVGRoot::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
-{
-    if (diff == StyleDifferenceLayout)
-        setNeedsBoundariesUpdate();
-    RenderBox::styleWillChange(diff, newStyle);
-}
-
 void RenderSVGRoot::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderBox::styleDidChange(diff, oldStyle);
 void RenderSVGRoot::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 {
     RenderBox::styleDidChange(diff, oldStyle);
@@ -282,6 +267,28 @@ const AffineTransform& RenderSVGRoot::localToParentTransform() const
     return m_localToParentTransform;
 }
 
     return m_localToParentTransform;
 }
 
+FloatRect RenderSVGRoot::objectBoundingBox() const
+{
+    return SVGRenderSupport::computeContainerBoundingBox(this, SVGRenderSupport::ObjectBoundingBox);
+}
+
+FloatRect RenderSVGRoot::strokeBoundingBox() const
+{
+    return SVGRenderSupport::computeContainerBoundingBox(this, SVGRenderSupport::StrokeBoundingBox);
+}
+
+FloatRect RenderSVGRoot::repaintRectInLocalCoordinates() const
+{
+    FloatRect repaintRect = SVGRenderSupport::computeContainerBoundingBox(this, SVGRenderSupport::RepaintBoundingBox);
+
+    const SVGRenderStyle* svgStyle = style()->svgStyle();
+    if (const ShadowData* shadow = svgStyle->shadow())
+        shadow->adjustRectForShadow(repaintRect);
+
+    repaintRect.inflate(borderAndPaddingWidth());
+    return repaintRect;
+}
+
 IntRect RenderSVGRoot::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer)
 {
     return SVGRenderSupport::clippedOverflowRectForRepaint(this, repaintContainer);
 IntRect RenderSVGRoot::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer)
 {
     return SVGRenderSupport::clippedOverflowRectForRepaint(this, repaintContainer);
@@ -313,22 +320,6 @@ void RenderSVGRoot::mapLocalToContainer(RenderBoxModelObject* repaintContainer,
     RenderBox::mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState);
 }
 
     RenderBox::mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState);
 }
 
-void RenderSVGRoot::updateCachedBoundaries()
-{
-    m_objectBoundingBox = FloatRect();
-    m_strokeBoundingBox = FloatRect();
-    m_repaintBoundingBox = FloatRect();
-
-    SVGRenderSupport::computeContainerBoundingBoxes(this, m_objectBoundingBox, m_strokeBoundingBox, m_repaintBoundingBox);
-    SVGRenderSupport::intersectRepaintRectWithResources(this, m_repaintBoundingBox);
-
-    const SVGRenderStyle* svgStyle = style()->svgStyle();
-    if (const ShadowData* shadow = svgStyle->shadow())
-        shadow->adjustRectForShadow(m_repaintBoundingBox);
-
-    m_repaintBoundingBox.inflate(borderAndPaddingWidth());
-}
-
 bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
 {
     IntPoint pointInContainer(_x, _y);
 bool RenderSVGRoot::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int _x, int _y, int _tx, int _ty, HitTestAction hitTestAction)
 {
     IntPoint pointInContainer(_x, _y);
index 63a7b3fa60cc55077afe3da5b6592de8313c6ce2..b90113c55741ed990bf6524e65f6d158b32def61 100644 (file)
@@ -41,8 +41,6 @@ public:
     RenderObjectChildList* children() { return &m_children; }
 
     bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; }
     RenderObjectChildList* children() { return &m_children; }
 
     bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; }
-    virtual void setNeedsBoundariesUpdate() { m_needsBoundariesOrTransformUpdate = true; }
-    virtual void setNeedsTransformUpdate() { m_needsBoundariesOrTransformUpdate = true; }
 
 private:
     virtual RenderObjectChildList* virtualChildren() { return children(); }
 
 private:
     virtual RenderObjectChildList* virtualChildren() { return children(); }
@@ -60,7 +58,6 @@ private:
     virtual void paint(PaintInfo&, int parentX, int parentY);
 
     virtual void destroy();
     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 void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
     virtual void updateFromElement();
 
@@ -69,9 +66,9 @@ private:
     bool fillContains(const FloatPoint&) const;
     bool strokeContains(const FloatPoint&) const;
 
     bool fillContains(const FloatPoint&) const;
     bool strokeContains(const FloatPoint&) const;
 
-    virtual FloatRect objectBoundingBox() const { return m_objectBoundingBox; }
-    virtual FloatRect strokeBoundingBox() const { return m_strokeBoundingBox; }
-    virtual FloatRect repaintRectInLocalCoordinates() const { return m_repaintBoundingBox; }
+    virtual FloatRect objectBoundingBox() const;
+    virtual FloatRect strokeBoundingBox() const;
+    virtual FloatRect repaintRectInLocalCoordinates() const;
 
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
 
 
     virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
 
@@ -83,7 +80,6 @@ private:
     void calcViewport();
 
     bool selfWillPaint();
     void calcViewport();
 
     bool selfWillPaint();
-    void updateCachedBoundaries();
 
     IntSize parentOriginToBorderBox() const;
     IntSize borderOriginToContentBox() const;
 
     IntSize parentOriginToBorderBox() const;
     IntSize borderOriginToContentBox() const;
@@ -92,12 +88,8 @@ private:
 
     RenderObjectChildList m_children;
     FloatSize m_viewportSize;
 
     RenderObjectChildList m_children;
     FloatSize m_viewportSize;
-    FloatRect m_objectBoundingBox;
-    FloatRect m_strokeBoundingBox;
-    FloatRect m_repaintBoundingBox;
     mutable AffineTransform m_localToParentTransform;
     bool m_isLayoutSizeChanged : 1;
     mutable AffineTransform m_localToParentTransform;
     bool m_isLayoutSizeChanged : 1;
-    bool m_needsBoundariesOrTransformUpdate : 1;
 };
 
 inline RenderSVGRoot* toRenderSVGRoot(RenderObject* object)
 };
 
 inline RenderSVGRoot* toRenderSVGRoot(RenderObject* object)
index 80b8a91f13fc7a59a35cb6f3a13e584a168774a8..4b70643e031d76d4d3d3d97c8fcb75b237892327 100644 (file)
@@ -75,12 +75,10 @@ void RenderSVGText::layout()
     ASSERT(needsLayout());
     LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
 
     ASSERT(needsLayout());
     LayoutRepainter repainter(*this, m_everHadLayout && checkForRepaintDuringLayout());
 
-    bool updateCachedBoundariesInParents = false;
     if (m_needsTransformUpdate) {
         SVGTextElement* text = static_cast<SVGTextElement*>(node());
         m_localTransform = text->animatedLocalTransform();
         m_needsTransformUpdate = false;
     if (m_needsTransformUpdate) {
         SVGTextElement* text = static_cast<SVGTextElement*>(node());
         m_localTransform = text->animatedLocalTransform();
         m_needsTransformUpdate = false;
-        updateCachedBoundariesInParents = true;
     }
 
     // Reduced version of RenderBlock::layoutBlock(), which only takes care of SVG text.
     }
 
     // Reduced version of RenderBlock::layoutBlock(), which only takes care of SVG text.
@@ -97,22 +95,13 @@ void RenderSVGText::layout()
     if (!firstChild())
         setChildrenInline(true);
 
     if (!firstChild())
         setChildrenInline(true);
 
-    // FIXME: We need to find a way to only layout the child boxes, if needed.
-    FloatRect oldBoundaries = objectBoundingBox();
     ASSERT(childrenInline());
     forceLayoutInlineChildren();
 
     ASSERT(childrenInline());
     forceLayoutInlineChildren();
 
-    if (!updateCachedBoundariesInParents)
-        updateCachedBoundariesInParents = oldBoundaries != objectBoundingBox();
-
     // Invalidate all resources of this client if our layout changed.
     if (m_everHadLayout && selfNeedsLayout())
         SVGResourcesCache::clientLayoutChanged(this);
 
     // Invalidate all resources of this client if our layout changed.
     if (m_everHadLayout && selfNeedsLayout())
         SVGResourcesCache::clientLayoutChanged(this);
 
-    // If our bounds changed, notify the parents.
-    if (updateCachedBoundariesInParents)
-        RenderSVGBlock::setNeedsBoundariesUpdate();
-
     repainter.repaintAfterLayout();
     setNeedsLayout(false);
 }
     repainter.repaintAfterLayout();
     setNeedsLayout(false);
 }
index c7d2029bf9cead8352450535620535d627ef691a..94b9eea3b8376ce7734f6af93e5363d13218b3b9 100644 (file)
@@ -35,7 +35,7 @@ RenderSVGTransformableContainer::RenderSVGTransformableContainer(SVGStyledTransf
 {
 }
 
 {
 }
 
-bool RenderSVGTransformableContainer::calculateLocalTransform()
+void RenderSVGTransformableContainer::calculateLocalTransform()
 {
     SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
 
 {
     SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
 
@@ -46,18 +46,17 @@ bool RenderSVGTransformableContainer::calculateLocalTransform()
     }
 
     if (!element->hasTagName(SVGNames::gTag) || !static_cast<SVGGElement*>(element)->isShadowTreeContainerElement())
     }
 
     if (!element->hasTagName(SVGNames::gTag) || !static_cast<SVGGElement*>(element)->isShadowTreeContainerElement())
-        return needsUpdate;
+        return;
 
     FloatSize translation = static_cast<SVGShadowTreeContainerElement*>(element)->containerTranslation();
     if (translation.width() == 0 && translation.height() == 0)
 
     FloatSize translation = static_cast<SVGShadowTreeContainerElement*>(element)->containerTranslation();
     if (translation.width() == 0 && translation.height() == 0)
-        return needsUpdate;
+        return;
 
     // FIXME: Could optimize this case for use to avoid refetching the animatedLocalTransform() here, if only the containerTranslation() changed.
     if (!needsUpdate)
         m_localTransform = element->animatedLocalTransform();
 
     m_localTransform.translate(translation.width(), translation.height());
 
     // FIXME: Could optimize this case for use to avoid refetching the animatedLocalTransform() here, if only the containerTranslation() changed.
     if (!needsUpdate)
         m_localTransform = element->animatedLocalTransform();
 
     m_localTransform.translate(translation.width(), translation.height());
-    return true;
 }
 
 }
 }
 
 }
index b63b91c5e9ce95c9412f38cff4c5d315ae523946..e6de054991c55bfcd761e4ad1bb259a32e46b9ce 100644 (file)
@@ -35,7 +35,7 @@ namespace WebCore {
         virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
 
     private:
         virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
 
     private:
-        virtual bool calculateLocalTransform();
+        virtual void calculateLocalTransform();
         virtual AffineTransform localTransform() const { return m_localTransform; }
 
         bool m_needsTransformUpdate : 1;
         virtual AffineTransform localTransform() const { return m_localTransform; }
 
         bool m_needsTransformUpdate : 1;
index ccf67fa9395309046b6d5e6f72aaee0885bb8bed..f314bde07c0cfdc53350a8cfd4a24caaf7466bea 100644 (file)
@@ -48,15 +48,10 @@ void RenderSVGViewportContainer::calcViewport()
      SVGElement* element = static_cast<SVGElement*>(node());
      if (element->hasTagName(SVGNames::svgTag)) {
          SVGSVGElement* svg = static_cast<SVGSVGElement*>(element);
      SVGElement* element = static_cast<SVGElement*>(node());
      if (element->hasTagName(SVGNames::svgTag)) {
          SVGSVGElement* svg = static_cast<SVGSVGElement*>(element);
-
-         FloatRect oldViewport = m_viewport;
          m_viewport = FloatRect(svg->x().value(svg)
                                 , svg->y().value(svg)
                                 , svg->width().value(svg)
                                 , svg->height().value(svg));
          m_viewport = FloatRect(svg->x().value(svg)
                                 , svg->y().value(svg)
                                 , svg->width().value(svg)
                                 , svg->height().value(svg));
-
-        if (oldViewport != m_viewport)
-            setNeedsBoundariesUpdate();
     }
 }
 
     }
 }
 
index 644ff70d2f087dac0bc8cd02cae005143ec4e3df..fc99c9157d559feb1af355d3f3ca38f2c6433239 100644 (file)
@@ -161,31 +161,29 @@ void SVGRenderSupport::finishRenderSVGContent(RenderObject* object, PaintInfo& p
         paintInfo.context->endTransparencyLayer();
 }
 
         paintInfo.context->endTransparencyLayer();
 }
 
-void SVGRenderSupport::computeContainerBoundingBoxes(const RenderObject* container, FloatRect& objectBoundingBox, FloatRect& strokeBoundingBox, FloatRect& repaintBoundingBox)
+FloatRect SVGRenderSupport::computeContainerBoundingBox(const RenderObject* container, ContainerBoundingBoxMode mode)
 {
 {
+    FloatRect boundingBox;
+
     for (RenderObject* current = container->firstChild(); current; current = current->nextSibling()) {
     for (RenderObject* current = container->firstChild(); current; current = current->nextSibling()) {
-        if (current->isSVGHiddenContainer())
-            continue;
-
-        const AffineTransform& transform = current->localToParentTransform();
-        if (transform.isIdentity()) {
-            objectBoundingBox.unite(current->objectBoundingBox());
-            strokeBoundingBox.unite(current->strokeBoundingBox());
-            repaintBoundingBox.unite(current->repaintRectInLocalCoordinates());
-        } else {
-            objectBoundingBox.unite(transform.mapRect(current->objectBoundingBox()));
-            strokeBoundingBox.unite(transform.mapRect(current->strokeBoundingBox()));
-            repaintBoundingBox.unite(transform.mapRect(current->repaintRectInLocalCoordinates()));
+        FloatRect childBoundingBox;
+
+        switch (mode) {
+        case ObjectBoundingBox:
+            childBoundingBox = current->objectBoundingBox();
+            break;
+        case StrokeBoundingBox:
+            childBoundingBox = current->strokeBoundingBox();
+            break;
+        case RepaintBoundingBox:
+            childBoundingBox = current->repaintRectInLocalCoordinates();
+            break;
         }
         }
-    }
-}
 
 
-bool SVGRenderSupport::paintInfoIntersectsRepaintRect(const FloatRect& localRepaintRect, const AffineTransform& localTransform, const PaintInfo& paintInfo)
-{
-    if (localTransform.isIdentity())
-        return localRepaintRect.intersects(paintInfo.rect);
+        boundingBox.unite(current->localToParentTransform().mapRect(childBoundingBox));
+    }
 
 
-    return localTransform.mapRect(localRepaintRect).intersects(paintInfo.rect);
+    return boundingBox;
 }
 
 const RenderSVGRoot* SVGRenderSupport::findTreeRootObject(const RenderObject* start)
 }
 
 const RenderSVGRoot* SVGRenderSupport::findTreeRootObject(const RenderObject* start)
index 9242a92cab83ec35bc568dffdec86871a5bc7f88..2de1e991b690e1edd7c6a0ab002fb53ed1d87115 100644 (file)
 #if ENABLE(SVG)
 #include "PaintInfo.h"
 
 #if ENABLE(SVG)
 #include "PaintInfo.h"
 
-#include <wtf/Noncopyable.h>
-
 namespace WebCore {
 
 class FloatPoint;
 class FloatRect;
 namespace WebCore {
 
 class FloatPoint;
 class FloatRect;
+class ImageBuffer;
 class RenderBoxModelObject;
 class RenderObject;
 class RenderStyle;
 class RenderBoxModelObject;
 class RenderObject;
 class RenderStyle;
@@ -41,7 +40,7 @@ class RenderSVGRoot;
 class TransformState;
 
 // SVGRendererSupport is a helper class sharing code between all SVG renderers.
 class TransformState;
 
 // SVGRendererSupport is a helper class sharing code between all SVG renderers.
-class SVGRenderSupport : public Noncopyable {
+class SVGRenderSupport {
 public:
     // Used by all SVG renderers who apply clip/filter/etc. resources to the renderer content
     static bool prepareToRenderSVGContent(RenderObject*, PaintInfo&);
 public:
     // Used by all SVG renderers who apply clip/filter/etc. resources to the renderer content
     static bool prepareToRenderSVGContent(RenderObject*, PaintInfo&);
@@ -59,11 +58,15 @@ public:
     // Determines whether the passed point lies in a clipping area
     static bool pointInClippingArea(RenderObject*, const FloatPoint&);
 
     // Determines whether the passed point lies in a clipping area
     static bool pointInClippingArea(RenderObject*, const FloatPoint&);
 
-    // Traverses all children of given container and returns the union object/stroke/repaintBoundingBox.
-    static void computeContainerBoundingBoxes(const RenderObject* container, FloatRect& objectBoundingBox, FloatRect& strokeBoundingBox, FloatRect& repaintBoundingBox);
+    enum ContainerBoundingBoxMode {
+        ObjectBoundingBox,
+        StrokeBoundingBox,
+        RepaintBoundingBox
+    };
 
 
-    // Determines wheter the renderer needs to be painted.
-    static bool paintInfoIntersectsRepaintRect(const FloatRect& localRepaintRect, const AffineTransform& localTransform, const PaintInfo& paintInfo);
+    // Used to share the "walk all the children" logic between objectBoundingBox
+    // and repaintRectInLocalCoordinates in RenderSVGRoot and RenderSVGContainer
+    static FloatRect computeContainerBoundingBox(const RenderObject* container, ContainerBoundingBoxMode);
 
     // Important functions used by nearly all SVG renderers centralizing coordinate transformations / repaint rect calculations
     static IntRect clippedOverflowRectForRepaint(RenderObject*, RenderBoxModelObject* repaintContainer);
 
     // Important functions used by nearly all SVG renderers centralizing coordinate transformations / repaint rect calculations
     static IntRect clippedOverflowRectForRepaint(RenderObject*, RenderBoxModelObject* repaintContainer);
@@ -76,6 +79,11 @@ public:
     // FIXME: These methods do not belong here.
     static const RenderObject* findTextRootObject(const RenderObject* start);
     static const RenderSVGRoot* findTreeRootObject(const RenderObject* start);
     // FIXME: These methods do not belong here.
     static const RenderObject* findTextRootObject(const RenderObject* start);
     static const RenderSVGRoot* findTreeRootObject(const RenderObject* start);
+
+private:
+    // This class is not constructable.
+    SVGRenderSupport();
+    ~SVGRenderSupport();
 };
 
 } // namespace WebCore
 };
 
 } // namespace WebCore
index 7d1ad3bbb3f9775d61e9185f9f218c934707414f..51d2f204a091c5b66e4d896979ccaae9e51d5417 100644 (file)
@@ -162,10 +162,6 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
         || svg_inherited_flags._joinStyle != other->svg_inherited_flags._joinStyle)
         return StyleDifferenceLayout;
 
         || svg_inherited_flags._joinStyle != other->svg_inherited_flags._joinStyle)
         return StyleDifferenceLayout;
 
-    // Shadow changes require relayouts, as they affect the repaint rects.
-    if (shadowSVG != other->shadowSVG)
-        return StyleDifferenceLayout;
-
     // Some stroke properties, requires relayouts, as the cached stroke boundaries need to be recalculated.
     if (stroke != other->stroke) {
         if (stroke->width != other->stroke->width
     // Some stroke properties, requires relayouts, as the cached stroke boundaries need to be recalculated.
     if (stroke != other->stroke) {
         if (stroke->width != other->stroke->width
@@ -182,6 +178,10 @@ StyleDifference SVGRenderStyle::diff(const SVGRenderStyle* other) const
 
     // NOTE: All comparisions below may only return StyleDifferenceRepaint
 
 
     // NOTE: All comparisions below may only return StyleDifferenceRepaint
 
+    // Shadow changes need to cause repaints.
+    if (shadowSVG != other->shadowSVG)
+        return StyleDifferenceRepaint;
+
     // Painting related properties only need repaints. 
     if (miscNotEqual) {
         if (misc->floodColor != other->misc->floodColor
     // Painting related properties only need repaints. 
     if (miscNotEqual) {
         if (misc->floodColor != other->misc->floodColor