[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.18-1-697-g2f78b87
bdakin at apple.com
bdakin at apple.com
Wed Jan 20 22:19:50 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit 095f462a201db00cb2b53ef1f372fa02c901dc18
Author: bdakin at apple.com <bdakin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Jan 11 22:56:09 2010 +0000
WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=33491 REGRESSION:
Many SVG -webkit-shadow tests are currently failing (in the pixel
tests)
-and-
<rdar://problem/7501200>
Reviewed by Oliver Hunt.
The real fix here is to call inflateForShadow() on the repaintRect
in prepareToRenderSVGContent(). But in order to do that, I had to
move inflateForShadow() to a different class since functions in
SVGRenderBase cannot call each other. inflateForShadow() now exists
in SVGRenderStyle which I think makes some sense because a similar
function that returns a box shadow's extent exists on RenderStyle.
Now call inflateForShadow() through the SVGRenderStyle.
* rendering/RenderForeignObject.cpp:
(WebCore::RenderForeignObject::computeRectForRepaint):
* rendering/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::computeRectForRepaint):
* rendering/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::computeRectForRepaint):
* rendering/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeRectForRepaint):
* rendering/RenderSVGText.cpp:
(WebCore::RenderSVGText::computeRectForRepaint):
No longer implement inflateForShadow() here.
* rendering/SVGRenderSupport.cpp:
(WebCore::SVGRenderBase::prepareToRenderSVGContent): Call new
inflateForShadow() through the SVGRenderStyle
* rendering/SVGRenderSupport.h:
Implementation of inflateForShadow() now lives here.
* rendering/style/SVGRenderStyle.cpp:
(WebCore::getSVGShadowExtent):
(WebCore::SVGRenderStyle::inflateForShadow):
* rendering/style/SVGRenderStyle.h:
LayoutTests: New tests for https://bugs.webkit.org/show_bug.cgi?id=33491
REGRESSION: Many SVG -webkit-shadow tests are currently failing (in
the pixel tests)
-and-
<rdar://problem/7501200>
Reviewed by Oliver Hunt.
I would like to note that this change fixes some existing layout
tests as well.
* platform/mac/svg/css/shadow-with-large-radius-expected.checksum: Added.
* platform/mac/svg/css/shadow-with-large-radius-expected.png: Added.
* platform/mac/svg/css/shadow-with-large-radius-expected.txt: Added.
* platform/mac/svg/css/shadow-with-negative-offset-expected.checksum: Added.
* platform/mac/svg/css/shadow-with-negative-offset-expected.png: Added.
* platform/mac/svg/css/shadow-with-negative-offset-expected.txt: Added.
* platform/mac/svg/css/stars-with-shadow-expected.checksum:
* platform/mac/svg/css/stars-with-shadow-expected.png:
* svg/css/shadow-with-large-radius.svg: Added.
* svg/css/shadow-with-negative-offset.svg: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53103 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 8b5bdf8..965127b 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,28 @@
+2010-01-11 Beth Dakin <bdakin at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ New tests for https://bugs.webkit.org/show_bug.cgi?id=33491
+ REGRESSION: Many SVG -webkit-shadow tests are currently failing (in
+ the pixel tests)
+ -and-
+ <rdar://problem/7501200>
+
+ I would like to note that this change fixes some existing layout
+ tests as well.
+
+ * platform/mac/svg/css/shadow-with-large-radius-expected.checksum: Added.
+ * platform/mac/svg/css/shadow-with-large-radius-expected.png: Added.
+ * platform/mac/svg/css/shadow-with-large-radius-expected.txt: Added.
+ * platform/mac/svg/css/shadow-with-negative-offset-expected.checksum: Added.
+ * platform/mac/svg/css/shadow-with-negative-offset-expected.png: Added.
+ * platform/mac/svg/css/shadow-with-negative-offset-expected.txt: Added.
+ * platform/mac/svg/css/stars-with-shadow-expected.checksum:
+ * platform/mac/svg/css/stars-with-shadow-expected.png:
+ * svg/css/shadow-with-large-radius.svg: Added.
+ * svg/css/shadow-with-negative-offset.svg: Added.
+
+
2010-01-11 Eric Seidel <eric at webkit.org>
Rubber-stamped by Csaba Osztrogonac.
diff --git a/LayoutTests/platform/mac/svg/css/shadow-with-large-radius-expected.checksum b/LayoutTests/platform/mac/svg/css/shadow-with-large-radius-expected.checksum
new file mode 100644
index 0000000..065efa9
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/css/shadow-with-large-radius-expected.checksum
@@ -0,0 +1 @@
+b61b672d9b1b9b1a6a79d783d7fd218f
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/css/shadow-with-large-radius-expected.png b/LayoutTests/platform/mac/svg/css/shadow-with-large-radius-expected.png
new file mode 100644
index 0000000..084e7a8
Binary files /dev/null and b/LayoutTests/platform/mac/svg/css/shadow-with-large-radius-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/css/shadow-with-large-radius-expected.txt b/LayoutTests/platform/mac/svg/css/shadow-with-large-radius-expected.txt
new file mode 100644
index 0000000..c90d22a
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/css/shadow-with-large-radius-expected.txt
@@ -0,0 +1,5 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderSVGRoot {svg} at (95,95) size 110x110
+ RenderPath {path} at (95,95) size 110x110 [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M100.00,100.00 L200.00,100.00 L200.00,200.00 L100.00,200.00 Z"]
diff --git a/LayoutTests/platform/mac/svg/css/shadow-with-negative-offset-expected.checksum b/LayoutTests/platform/mac/svg/css/shadow-with-negative-offset-expected.checksum
new file mode 100644
index 0000000..817c807
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/css/shadow-with-negative-offset-expected.checksum
@@ -0,0 +1 @@
+b322c1317f68c4e9b9299532233e7200
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/css/shadow-with-negative-offset-expected.png b/LayoutTests/platform/mac/svg/css/shadow-with-negative-offset-expected.png
new file mode 100644
index 0000000..3858a86
Binary files /dev/null and b/LayoutTests/platform/mac/svg/css/shadow-with-negative-offset-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/css/shadow-with-negative-offset-expected.txt b/LayoutTests/platform/mac/svg/css/shadow-with-negative-offset-expected.txt
new file mode 100644
index 0000000..c90d22a
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/css/shadow-with-negative-offset-expected.txt
@@ -0,0 +1,5 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderSVGRoot {svg} at (95,95) size 110x110
+ RenderPath {path} at (95,95) size 110x110 [stroke={[type=SOLID] [color=#000000] [stroke width=10.00]}] [fill={[type=SOLID] [color=#999999]}] [data="M100.00,100.00 L200.00,100.00 L200.00,200.00 L100.00,200.00 Z"]
diff --git a/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.checksum b/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.checksum
index 83557a0..41225da 100644
--- a/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.checksum
+++ b/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.checksum
@@ -1 +1 @@
-201684955d552b1a57f8bced9aaa6e4e
\ No newline at end of file
+de73673c1e37edf6d9f7f141bdf10bd0
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.png b/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.png
index 41c4cd9..9b2a365 100644
Binary files a/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.png and b/LayoutTests/platform/mac/svg/css/stars-with-shadow-expected.png differ
diff --git a/LayoutTests/svg/css/shadow-with-large-radius.svg b/LayoutTests/svg/css/shadow-with-large-radius.svg
new file mode 100644
index 0000000..83b709d
--- /dev/null
+++ b/LayoutTests/svg/css/shadow-with-large-radius.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<path d="M 100 100 L 200 100 L 200 200 L 100 200 Z" fill="#999" stroke="#000" stroke-width="10" style="-webkit-shadow: #f00 5px 5px 50px"></path>
+</svg>
diff --git a/LayoutTests/svg/css/shadow-with-negative-offset.svg b/LayoutTests/svg/css/shadow-with-negative-offset.svg
new file mode 100644
index 0000000..cb5d6d8
--- /dev/null
+++ b/LayoutTests/svg/css/shadow-with-negative-offset.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<path d="M 100 100 L 200 100 L 200 200 L 100 200 Z" fill="#999" stroke="#000" stroke-width="10" style="-webkit-shadow: #f00 -5px -5px 50px"></path>
+</svg>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5964019..bcfe425 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,44 @@
+2010-01-11 Beth Dakin <bdakin at apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=33491 REGRESSION:
+ Many SVG -webkit-shadow tests are currently failing (in the pixel
+ tests)
+ -and-
+ <rdar://problem/7501200>
+
+ The real fix here is to call inflateForShadow() on the repaintRect
+ in prepareToRenderSVGContent(). But in order to do that, I had to
+ move inflateForShadow() to a different class since functions in
+ SVGRenderBase cannot call each other. inflateForShadow() now exists
+ in SVGRenderStyle which I think makes some sense because a similar
+ function that returns a box shadow's extent exists on RenderStyle.
+
+ Now call inflateForShadow() through the SVGRenderStyle.
+ * rendering/RenderForeignObject.cpp:
+ (WebCore::RenderForeignObject::computeRectForRepaint):
+ * rendering/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::computeRectForRepaint):
+ * rendering/RenderSVGModelObject.cpp:
+ (WebCore::RenderSVGModelObject::computeRectForRepaint):
+ * rendering/RenderSVGRoot.cpp:
+ (WebCore::RenderSVGRoot::computeRectForRepaint):
+ * rendering/RenderSVGText.cpp:
+ (WebCore::RenderSVGText::computeRectForRepaint):
+
+ No longer implement inflateForShadow() here.
+ * rendering/SVGRenderSupport.cpp:
+ (WebCore::SVGRenderBase::prepareToRenderSVGContent): Call new
+ inflateForShadow() through the SVGRenderStyle
+ * rendering/SVGRenderSupport.h:
+
+ Implementation of inflateForShadow() now lives here.
+ * rendering/style/SVGRenderStyle.cpp:
+ (WebCore::getSVGShadowExtent):
+ (WebCore::SVGRenderStyle::inflateForShadow):
+ * rendering/style/SVGRenderStyle.h:
+
2010-01-11 Alexander Pavlov <apavlov at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebCore/rendering/RenderForeignObject.cpp b/WebCore/rendering/RenderForeignObject.cpp
index 809ad5d..35bc207 100644
--- a/WebCore/rendering/RenderForeignObject.cpp
+++ b/WebCore/rendering/RenderForeignObject.cpp
@@ -84,7 +84,7 @@ FloatRect RenderForeignObject::repaintRectInLocalCoordinates() const
void RenderForeignObject::computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& rect, bool fixed)
{
rect = localToParentTransform().mapRect(rect);
- inflateForShadow(style(), rect);
+ style()->svgStyle()->inflateForShadow(rect);
RenderBlock::computeRectForRepaint(repaintContainer, rect, fixed);
}
diff --git a/WebCore/rendering/RenderSVGImage.cpp b/WebCore/rendering/RenderSVGImage.cpp
index ae648c6..5a4442d 100644
--- a/WebCore/rendering/RenderSVGImage.cpp
+++ b/WebCore/rendering/RenderSVGImage.cpp
@@ -175,7 +175,7 @@ IntRect RenderSVGImage::clippedOverflowRectForRepaint(RenderBoxModelObject* repa
void RenderSVGImage::computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed)
{
- inflateForShadow(style(), repaintRect);
+ style()->svgStyle()->inflateForShadow(repaintRect);
SVGRenderBase::computeRectForRepaint(this, repaintContainer, repaintRect, fixed);
}
diff --git a/WebCore/rendering/RenderSVGModelObject.cpp b/WebCore/rendering/RenderSVGModelObject.cpp
index 045adb4..7a76fbd 100644
--- a/WebCore/rendering/RenderSVGModelObject.cpp
+++ b/WebCore/rendering/RenderSVGModelObject.cpp
@@ -56,7 +56,7 @@ IntRect RenderSVGModelObject::clippedOverflowRectForRepaint(RenderBoxModelObject
void RenderSVGModelObject::computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed)
{
- inflateForShadow(style(), repaintRect);
+ style()->svgStyle()->inflateForShadow(repaintRect);
SVGRenderBase::computeRectForRepaint(this, repaintContainer, repaintRect, fixed);
}
diff --git a/WebCore/rendering/RenderSVGRoot.cpp b/WebCore/rendering/RenderSVGRoot.cpp
index e68cfc8..be8cef9 100644
--- a/WebCore/rendering/RenderSVGRoot.cpp
+++ b/WebCore/rendering/RenderSVGRoot.cpp
@@ -265,7 +265,7 @@ void RenderSVGRoot::computeRectForRepaint(RenderBoxModelObject* repaintContainer
// Apply our local transforms (except for x/y translation), then our shadow,
// and then call RenderBox's method to handle all the normal CSS Box model bits
repaintRect = localToBorderBoxTransform().mapRect(repaintRect);
- inflateForShadow(style(), repaintRect);
+ style()->svgStyle()->inflateForShadow(repaintRect);
RenderBox::computeRectForRepaint(repaintContainer, repaintRect, fixed);
}
diff --git a/WebCore/rendering/RenderSVGText.cpp b/WebCore/rendering/RenderSVGText.cpp
index cf0fec1..5763235 100644
--- a/WebCore/rendering/RenderSVGText.cpp
+++ b/WebCore/rendering/RenderSVGText.cpp
@@ -59,7 +59,7 @@ IntRect RenderSVGText::clippedOverflowRectForRepaint(RenderBoxModelObject* repai
void RenderSVGText::computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed)
{
- inflateForShadow(style(), repaintRect);
+ style()->svgStyle()->inflateForShadow(repaintRect);
SVGRenderBase::computeRectForRepaint(this, repaintContainer, repaintRect, fixed);
}
diff --git a/WebCore/rendering/SVGRenderSupport.cpp b/WebCore/rendering/SVGRenderSupport.cpp
index a2b4cdf..a11ecef 100644
--- a/WebCore/rendering/SVGRenderSupport.cpp
+++ b/WebCore/rendering/SVGRenderSupport.cpp
@@ -40,8 +40,6 @@
#include "TransformationMatrix.h"
#include <wtf/UnusedParam.h>
-using namespace std;
-
namespace WebCore {
SVGRenderBase::~SVGRenderBase()
@@ -61,48 +59,6 @@ IntRect SVGRenderBase::clippedOverflowRectForRepaint(RenderObject* object, Rende
return repaintRect;
}
-static void getSVGShadowExtent(ShadowData* shadow, int& top, int& right, int& bottom, int& left)
-{
- top = 0;
- right = 0;
- bottom = 0;
- left = 0;
-
- int blurAndSpread = shadow->blur + shadow->spread;
-
- top = min(top, shadow->y - blurAndSpread);
- right = max(right, shadow->x + blurAndSpread);
- bottom = max(bottom, shadow->y + blurAndSpread);
- left = min(left, shadow->x - blurAndSpread);
-}
-
-void SVGRenderBase::inflateForShadow(RenderStyle* style, IntRect& repaintRect) const
-{
- ASSERT(style);
- if (!style)
- return;
-
- ShadowData* shadow = style->svgStyle()->shadow();
- if (!shadow)
- return;
-
- int shadowTop;
- int shadowRight;
- int shadowBottom;
- int shadowLeft;
- getSVGShadowExtent(shadow, shadowTop, shadowRight, shadowBottom, shadowLeft);
-
- int overflowLeft = repaintRect.x() + shadowLeft;
- int overflowRight = repaintRect.right() + shadowRight;
- int overflowTop = repaintRect.y() + shadowTop;
- int overflowBottom = repaintRect.bottom() + shadowBottom;
-
- repaintRect.setX(overflowLeft);
- repaintRect.setY(overflowTop);
- repaintRect.setWidth(overflowRight - overflowLeft);
- repaintRect.setHeight(overflowBottom - overflowTop);
-}
-
void SVGRenderBase::computeRectForRepaint(RenderObject* object, RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed)
{
// Translate to coords in our parent renderer, and then call computeRectForRepaint on our parent
@@ -144,13 +100,9 @@ bool SVGRenderBase::prepareToRenderSVGContent(RenderObject* object, RenderObject
}
if (ShadowData* shadow = svgStyle->shadow()) {
- int xShift = shadow->x < 0 ? shadow->x : 0;
- int yShift = shadow->y < 0 ? shadow->y :0;
- int widthShift = shadow->x < 0 ? 0 : shadow->x;
- int heightShift = shadow->y < 0 ? 0 : shadow->y;
- FloatRect shadowRect = FloatRect(repaintRect.x() + xShift, repaintRect.y() + yShift,
- repaintRect.width() + widthShift, repaintRect.height() + heightShift);
- paintInfo.context->clip(enclosingIntRect(shadowRect));
+ IntRect shadowRect = enclosingIntRect(repaintRect);
+ svgStyle->inflateForShadow(shadowRect);
+ paintInfo.context->clip(shadowRect);
paintInfo.context->setShadow(IntSize(shadow->x, shadow->y), shadow->blur, shadow->color, style->colorSpace());
paintInfo.context->beginTransparencyLayer(1.0f);
}
diff --git a/WebCore/rendering/SVGRenderSupport.h b/WebCore/rendering/SVGRenderSupport.h
index bd067eb..9ea66e3 100644
--- a/WebCore/rendering/SVGRenderSupport.h
+++ b/WebCore/rendering/SVGRenderSupport.h
@@ -56,8 +56,6 @@ namespace WebCore {
FloatRect clipperBoundingBoxForRenderer(const RenderObject*) const;
FloatRect maskerBoundingBoxForRenderer(const RenderObject*) const;
- virtual void inflateForShadow(RenderStyle*, IntRect&) const;
-
protected:
static IntRect clippedOverflowRectForRepaint(RenderObject*, RenderBoxModelObject* repaintContainer);
static void computeRectForRepaint(RenderObject*, RenderBoxModelObject* repaintContainer, IntRect&, bool fixed);
diff --git a/WebCore/rendering/style/SVGRenderStyle.cpp b/WebCore/rendering/style/SVGRenderStyle.cpp
index 728738b..d5ba549 100644
--- a/WebCore/rendering/style/SVGRenderStyle.cpp
+++ b/WebCore/rendering/style/SVGRenderStyle.cpp
@@ -30,11 +30,14 @@
#include "CSSPrimitiveValue.h"
#include "CSSValueList.h"
+#include "IntRect.h"
#include "NodeRenderStyle.h"
#include "RenderObject.h"
#include "RenderStyle.h"
#include "SVGStyledElement.h"
+using namespace std;
+
namespace WebCore {
SVGRenderStyle::SVGRenderStyle()
@@ -141,6 +144,45 @@ float SVGRenderStyle::cssPrimitiveToLength(const RenderObject* item, CSSValue* v
return primitive->computeLengthFloat(const_cast<RenderStyle*>(item->style()), item->document()->documentElement()->renderStyle());
}
+
+static void getSVGShadowExtent(ShadowData* shadow, int& top, int& right, int& bottom, int& left)
+{
+ top = 0;
+ right = 0;
+ bottom = 0;
+ left = 0;
+
+ int blurAndSpread = shadow->blur + shadow->spread;
+
+ top = min(top, shadow->y - blurAndSpread);
+ right = max(right, shadow->x + blurAndSpread);
+ bottom = max(bottom, shadow->y + blurAndSpread);
+ left = min(left, shadow->x - blurAndSpread);
+}
+
+void SVGRenderStyle::inflateForShadow(IntRect& repaintRect) const
+{
+ ShadowData* svgShadow = shadow();
+ if (!svgShadow)
+ return;
+
+ int shadowTop;
+ int shadowRight;
+ int shadowBottom;
+ int shadowLeft;
+ getSVGShadowExtent(svgShadow, shadowTop, shadowRight, shadowBottom, shadowLeft);
+
+ int overflowLeft = repaintRect.x() + shadowLeft;
+ int overflowRight = repaintRect.right() + shadowRight;
+ int overflowTop = repaintRect.y() + shadowTop;
+ int overflowBottom = repaintRect.bottom() + shadowBottom;
+
+ repaintRect.setX(overflowLeft);
+ repaintRect.setY(overflowTop);
+ repaintRect.setWidth(overflowRight - overflowLeft);
+ repaintRect.setHeight(overflowBottom - overflowTop);
+}
+
}
#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/style/SVGRenderStyle.h b/WebCore/rendering/style/SVGRenderStyle.h
index c65be97..a7cea22 100644
--- a/WebCore/rendering/style/SVGRenderStyle.h
+++ b/WebCore/rendering/style/SVGRenderStyle.h
@@ -36,6 +36,7 @@ namespace WebCore {
class RenderObject;
class RenderStyle;
+ class IntRect;
class SVGRenderStyle : public RefCounted<SVGRenderStyle> {
public:
@@ -45,6 +46,8 @@ namespace WebCore {
bool inheritedNotEqual(const SVGRenderStyle*) const;
void inheritFrom(const SVGRenderStyle*);
+
+ void inflateForShadow(IntRect&) const;
bool operator==(const SVGRenderStyle&) const;
bool operator!=(const SVGRenderStyle& o) const { return !(*this == o); }
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list