Diff
Modified: branches/safari-536.28-branch/LayoutTests/ChangeLog (137488 => 137489)
--- branches/safari-536.28-branch/LayoutTests/ChangeLog 2012-12-12 19:23:48 UTC (rev 137488)
+++ branches/safari-536.28-branch/LayoutTests/ChangeLog 2012-12-12 19:27:35 UTC (rev 137489)
@@ -1,3 +1,21 @@
+2012-12-12 Lucas Forschler <[email protected]>
+
+ Merge r137393
+
+ 2012-12-11 Tim Horton <[email protected]>
+
+ -webkit-svg-shadow radius changes don't cause children's boundaries to be recomputed
+ https://bugs.webkit.org/show_bug.cgi?id=104722
+ <rdar://problem/12821080>
+
+ Reviewed by Simon Fraser.
+
+ Add a text repaint test that ensures that a child (a path, in this case)
+ recomputes its bounds after its parent's shadow is expanded.
+
+ * svg/repaint/repaint-webkit-svg-shadow-container-expected.txt: Added.
+ * svg/repaint/repaint-webkit-svg-shadow-container.html: Added.
+
2012-11-26 Lucas Forschler <[email protected]>
Merge r133834
Copied: branches/safari-536.28-branch/LayoutTests/svg/repaint/repaint-webkit-svg-shadow-container-expected.txt (from rev 137393, trunk/LayoutTests/svg/repaint/repaint-webkit-svg-shadow-container-expected.txt) (0 => 137489)
--- branches/safari-536.28-branch/LayoutTests/svg/repaint/repaint-webkit-svg-shadow-container-expected.txt (rev 0)
+++ branches/safari-536.28-branch/LayoutTests/svg/repaint/repaint-webkit-svg-shadow-container-expected.txt 2012-12-12 19:27:35 UTC (rev 137489)
@@ -0,0 +1,6 @@
+ (repaint rects
+ (rect 8 8 300 300)
+ (rect 8 8 510 510)
+ (rect 8 8 600 600)
+)
+
Copied: branches/safari-536.28-branch/LayoutTests/svg/repaint/repaint-webkit-svg-shadow-container.html (from rev 137393, trunk/LayoutTests/svg/repaint/repaint-webkit-svg-shadow-container.html) (0 => 137489)
--- branches/safari-536.28-branch/LayoutTests/svg/repaint/repaint-webkit-svg-shadow-container.html (rev 0)
+++ branches/safari-536.28-branch/LayoutTests/svg/repaint/repaint-webkit-svg-shadow-container.html 2012-12-12 19:27:35 UTC (rev 137489)
@@ -0,0 +1,18 @@
+<html>
+ <head>
+ <title>Test passes if shadow is not clipped after the shadow change.</title>
+ <script src=""
+ <script>
+ function repaintTest() {
+ document.getElementById("g").setAttribute("style", "-webkit-svg-shadow: 50px 50px 100px black;")
+ }
+ </script>
+ </head>
+ <body _onload_="runRepaintTest()">
+ <svg xmlns="http://www.w3.org/2000/svg">
+ <g id="g" style="-webkit-svg-shadow: 50px 50px 10px black;">
+ <rect width="100" height="100" x="50" y="50" fill="black" />
+ </g>
+ </svg>
+ </body>
+</html>
Modified: branches/safari-536.28-branch/Source/WebCore/ChangeLog (137488 => 137489)
--- branches/safari-536.28-branch/Source/WebCore/ChangeLog 2012-12-12 19:23:48 UTC (rev 137488)
+++ branches/safari-536.28-branch/Source/WebCore/ChangeLog 2012-12-12 19:27:35 UTC (rev 137489)
@@ -1,3 +1,30 @@
+2012-12-12 Lucas Forschler <[email protected]>
+
+ Merge r137393
+
+ 2012-12-11 Tim Horton <[email protected]>
+
+ -webkit-svg-shadow radius changes don't cause children's boundaries to be recomputed
+ https://bugs.webkit.org/show_bug.cgi?id=104722
+ <rdar://problem/12821080>
+
+ Reviewed by Simon Fraser.
+
+ Changes to -webkit-svg-shadow currently cause a relayout of the directly affected renderer
+ and its parents, but not its children. However, children have the shadow radius
+ baked into their cached boundaries, so these need to be invalidated.
+
+ Test: svg/repaint/repaint-webkit-svg-shadow-container.html
+
+ * rendering/RenderObject.h: Expose needsBoundariesUpdate().
+ * rendering/svg/RenderSVGContainer.h: Expose needsBoundariesUpdate().
+ * rendering/svg/RenderSVGImage.h: Expose needsBoundariesUpdate().
+ * rendering/svg/RenderSVGRoot.h: Expose needsBoundariesUpdate().
+ * rendering/svg/RenderSVGShape.h: Expose needsBoundariesUpdate().
+ * rendering/svg/SVGRenderSupport.cpp:
+ (WebCore::SVGRenderSupport::layoutChildren): If the renderer has a shadow and
+ is in needs of a boundaries update, mark children as needing boundaries updates too.
+
2012-11-29 Simon Fraser <[email protected]>
<rdar://problem/12781055>
Modified: branches/safari-536.28-branch/Source/WebCore/rendering/RenderObject.h (137488 => 137489)
--- branches/safari-536.28-branch/Source/WebCore/rendering/RenderObject.h 2012-12-12 19:23:48 UTC (rev 137488)
+++ branches/safari-536.28-branch/Source/WebCore/rendering/RenderObject.h 2012-12-12 19:27:35 UTC (rev 137489)
@@ -446,6 +446,7 @@
// to inherit from RenderSVGObject -> RenderObject (some need RenderBlock inheritance for instance)
virtual void setNeedsTransformUpdate() { }
virtual void setNeedsBoundariesUpdate();
+ virtual bool needsBoundariesUpdate() { return false; }
// 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 SVGLocatable::getBBox().
Modified: branches/safari-536.28-branch/Source/WebCore/rendering/svg/RenderSVGContainer.h (137488 => 137489)
--- branches/safari-536.28-branch/Source/WebCore/rendering/svg/RenderSVGContainer.h 2012-12-12 19:23:48 UTC (rev 137488)
+++ branches/safari-536.28-branch/Source/WebCore/rendering/svg/RenderSVGContainer.h 2012-12-12 19:27:35 UTC (rev 137489)
@@ -41,6 +41,7 @@
virtual void paint(PaintInfo&, const LayoutPoint&);
virtual void setNeedsBoundariesUpdate() { m_needsBoundariesUpdate = true; }
+ virtual bool needsBoundariesUpdate() OVERRIDE { return m_needsBoundariesUpdate; }
virtual bool didTransformToRootUpdate() { return false; }
bool isObjectBoundingBoxValid() const { return m_objectBoundingBoxValid; }
Modified: branches/safari-536.28-branch/Source/WebCore/rendering/svg/RenderSVGImage.h (137488 => 137489)
--- branches/safari-536.28-branch/Source/WebCore/rendering/svg/RenderSVGImage.h 2012-12-12 19:23:48 UTC (rev 137488)
+++ branches/safari-536.28-branch/Source/WebCore/rendering/svg/RenderSVGImage.h 2012-12-12 19:27:35 UTC (rev 137489)
@@ -43,6 +43,7 @@
bool updateImageViewport();
virtual void setNeedsBoundariesUpdate() { m_needsBoundariesUpdate = true; }
+ virtual bool needsBoundariesUpdate() OVERRIDE { return m_needsBoundariesUpdate; }
virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
RenderImageResource* imageResource() { return m_imageResource.get(); }
Modified: branches/safari-536.28-branch/Source/WebCore/rendering/svg/RenderSVGRoot.h (137488 => 137489)
--- branches/safari-536.28-branch/Source/WebCore/rendering/svg/RenderSVGRoot.h 2012-12-12 19:23:48 UTC (rev 137488)
+++ branches/safari-536.28-branch/Source/WebCore/rendering/svg/RenderSVGRoot.h 2012-12-12 19:27:35 UTC (rev 137489)
@@ -48,6 +48,7 @@
bool isLayoutSizeChanged() const { return m_isLayoutSizeChanged; }
virtual void setNeedsBoundariesUpdate() { m_needsBoundariesOrTransformUpdate = true; }
+ virtual bool needsBoundariesUpdate() OVERRIDE { return m_needsBoundariesOrTransformUpdate; }
virtual void setNeedsTransformUpdate() { m_needsBoundariesOrTransformUpdate = true; }
IntSize containerSize() const { return m_containerSize; }
Modified: branches/safari-536.28-branch/Source/WebCore/rendering/svg/RenderSVGShape.h (137488 => 137489)
--- branches/safari-536.28-branch/Source/WebCore/rendering/svg/RenderSVGShape.h 2012-12-12 19:23:48 UTC (rev 137488)
+++ branches/safari-536.28-branch/Source/WebCore/rendering/svg/RenderSVGShape.h 2012-12-12 19:27:35 UTC (rev 137489)
@@ -72,6 +72,7 @@
void setNeedsShapeUpdate() { m_needsShapeUpdate = true; }
virtual void setNeedsBoundariesUpdate() { m_needsBoundariesUpdate = true; }
+ virtual bool needsBoundariesUpdate() OVERRIDE { return m_needsBoundariesUpdate; }
virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
virtual void fillShape(GraphicsContext*) const;
virtual void strokeShape(GraphicsContext*) const;
Modified: branches/safari-536.28-branch/Source/WebCore/rendering/svg/SVGRenderSupport.cpp (137488 => 137489)
--- branches/safari-536.28-branch/Source/WebCore/rendering/svg/SVGRenderSupport.cpp 2012-12-12 19:23:48 UTC (rev 137488)
+++ branches/safari-536.28-branch/Source/WebCore/rendering/svg/SVGRenderSupport.cpp 2012-12-12 19:27:35 UTC (rev 137489)
@@ -211,11 +211,20 @@
{
bool layoutSizeChanged = layoutSizeOfNearestViewportChanged(start);
bool transformChanged = transformToRootChanged(start);
+ bool hasSVGShadow = rendererHasSVGShadow(start);
+ bool needsBoundariesUpdate = start->needsBoundariesUpdate();
HashSet<RenderObject*> notlayoutedObjects;
for (RenderObject* child = start->firstChild(); child; child = child->nextSibling()) {
bool needsLayout = selfNeedsLayout;
+ if (needsBoundariesUpdate && hasSVGShadow) {
+ // If we have a shadow, our shadow is baked into our children's cached boundaries,
+ // so they need to update.
+ child->setNeedsBoundariesUpdate();
+ needsLayout = true;
+ }
+
if (transformChanged) {
// If the transform changed we need to update the text metrics (note: this also happens for layoutSizeChanged=true).
if (child->isSVGText())