[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
krit at webkit.org
krit at webkit.org
Wed Mar 17 17:59:49 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 58c42856fdddddb9b0d378cab03dd0a3959dd0eb
Author: krit at webkit.org <krit at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Feb 25 23:02:00 2010 +0000
2010-02-25 Dirk Schulze <krit at webkit.org>
Reviewed by Nikolas Zimmermann.
Use-element doesn't transform clipPath
https://bugs.webkit.org/show_bug.cgi?id=35375
If the use element is a child of clipPath, any settings on x, y or transform does not
transform the clipPath it references.
The use-element just misses this transformation in toClipPath.
Test: svg/custom/use-on-clip-path-with-transformation.svg
* platform/graphics/cairo/PathCairo.cpp: Gtk port translated the path to the wrong direction.
(WebCore::Path::translate):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::toClipPath):
2010-02-25 Dirk Schulze <krit at webkit.org>
Reviewed by Nikolas Zimmermann.
Use-element doesn't transform clipPath
https://bugs.webkit.org/show_bug.cgi?id=35375
Check if the clipPath gets transformed on setting a transform or translation for use.
* platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.checksum: Added.
* platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.png: Added.
* platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.txt: Added.
* svg/custom/use-on-clip-path-with-transformation.svg: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55259 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ca839b9..0f69d4a 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-02-25 Dirk Schulze <krit at webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Use-element doesn't transform clipPath
+ https://bugs.webkit.org/show_bug.cgi?id=35375
+
+ Check if the clipPath gets transformed on setting a transform or translation for use.
+
+ * platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.checksum: Added.
+ * platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.png: Added.
+ * platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.txt: Added.
+ * svg/custom/use-on-clip-path-with-transformation.svg: Added.
+
2010-02-25 Jian Li <jianli at chromium.org>
Reviewed by Dmitry Titov.
diff --git a/LayoutTests/platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.checksum b/LayoutTests/platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.checksum
new file mode 100644
index 0000000..7bcd829
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.checksum
@@ -0,0 +1 @@
+a4a354708e1ba9bae23f2f2fc4d46bec
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.png b/LayoutTests/platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.png
new file mode 100644
index 0000000..df2c051
Binary files /dev/null and b/LayoutTests/platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.png differ
diff --git a/LayoutTests/platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.txt b/LayoutTests/platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.txt
new file mode 100644
index 0000000..96463fd
--- /dev/null
+++ b/LayoutTests/platform/mac/svg/custom/use-on-clip-path-with-transformation-expected.txt
@@ -0,0 +1,12 @@
+KCanvasResource {id="clip" [type=CLIPPER] [clip data=[[winding=NON-ZERO] [bounding box mode=1] [path=M0.50,0.36 L0.64,0.50 L0.50,0.64 L0.36,0.50 Z]]]}
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderSVGRoot {svg} at (0,0) size 800x600
+ RenderSVGHiddenContainer {defs} at (0,0) size 0x0
+ RenderPath {rect} at (0,0) size 1x1 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L0.20,0.00 L0.20,0.20 L0.00,0.20 Z"]
+ RenderSVGHiddenContainer {clipPath} at (0,0) size 0x0
+ RenderSVGContainer {use} at (0,0) size 2x2 [transform={m=((0.71,0.71)(-0.71,0.71)) t=(0.50,-0.21)}]
+ RenderSVGContainer {g} at (0,0) size 2x3 [transform={m=((1.00,0.00)(0.00,1.00)) t=(0.40,0.40)}]
+ RenderPath {rect} at (0,0) size 2x3 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00 L0.20,0.00 L0.20,0.20 L0.00,0.20 Z"]
+ RenderPath {rect} at (107,107) size 86x86 [fill={[type=SOLID] [color=#008000]}] [clip path="clip"] [data="M0.00,0.00 L300.00,0.00 L300.00,300.00 L0.00,300.00 Z"]
diff --git a/LayoutTests/svg/custom/use-on-clip-path-with-transformation.svg b/LayoutTests/svg/custom/use-on-clip-path-with-transformation.svg
new file mode 100644
index 0000000..c90ca86
--- /dev/null
+++ b/LayoutTests/svg/custom/use-on-clip-path-with-transformation.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<defs>
+<rect id="rect" x="0" y="0" width=".2" height=".2"/>
+<clipPath id="clip" clipPathUnits="objectBoundingBox">
+ <use x=".4" y=".4" xlink:href="#rect" transform="rotate(45, .5, .5)"/>
+</clipPath>
+</defs>
+<rect x="0" y="0" height="300" width="300" style="fill:green;clip-path:url(#clip);"/>
+</svg>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ae70755..f1f21ae 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-02-25 Dirk Schulze <krit at webkit.org>
+
+ Reviewed by Nikolas Zimmermann.
+
+ Use-element doesn't transform clipPath
+ https://bugs.webkit.org/show_bug.cgi?id=35375
+
+ If the use element is a child of clipPath, any settings on x, y or transform does not
+ transform the clipPath it references.
+ The use-element just misses this transformation in toClipPath.
+
+ Test: svg/custom/use-on-clip-path-with-transformation.svg
+
+ * platform/graphics/cairo/PathCairo.cpp: Gtk port translated the path to the wrong direction.
+ (WebCore::Path::translate):
+ * svg/SVGUseElement.cpp:
+ (WebCore::SVGUseElement::toClipPath):
+
2010-02-25 Jian Li <jianli at chromium.org>
Reviewed by Dmitry Titov.
diff --git a/WebCore/platform/graphics/cairo/PathCairo.cpp b/WebCore/platform/graphics/cairo/PathCairo.cpp
index bc68b37..88078c5 100644
--- a/WebCore/platform/graphics/cairo/PathCairo.cpp
+++ b/WebCore/platform/graphics/cairo/PathCairo.cpp
@@ -89,7 +89,7 @@ bool Path::hasCurrentPoint() const
void Path::translate(const FloatSize& p)
{
cairo_t* cr = platformPath()->m_cr;
- cairo_translate(cr, p.width(), p.height());
+ cairo_translate(cr, -p.width(), -p.height());
}
void Path::moveTo(const FloatPoint& p)
diff --git a/WebCore/svg/SVGUseElement.cpp b/WebCore/svg/SVGUseElement.cpp
index 2ce1bd1..a8d4f7b 100644
--- a/WebCore/svg/SVGUseElement.cpp
+++ b/WebCore/svg/SVGUseElement.cpp
@@ -592,8 +592,12 @@ Path SVGUseElement::toClipPath() const
if (!isDirectReference(n))
// Spec: Indirect references are an error (14.3.5)
document()->accessSVGExtensions()->reportError("Not allowed to use indirect reference in <clip-path>");
- else
- return static_cast<SVGStyledTransformableElement*>(n)->toClipPath();
+ else {
+ Path clipPath = static_cast<SVGStyledTransformableElement*>(n)->toClipPath();
+ clipPath.translate(FloatSize(x().value(this), y().value(this)));
+ clipPath.transform(animatedLocalTransform());
+ return clipPath;
+ }
}
return Path();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list