2006-01-15 Alexander Kellett <lypanov@kde.org>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Jan 2006 11:47:18 +0000 (11:47 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Jan 2006 11:47:18 +0000 (11:47 +0000)
        Reviewed by eseidel.

        <mask> inside <defs> crashes Safari.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=6548

        * ksvg2/svg/SVGMaskElementImpl.cpp:
        (KSVG::SVGMaskElementImpl::drawMaskerContent):

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

LayoutTests/ChangeLog
LayoutTests/svg/custom/mask-inside-defs-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/mask-inside-defs-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/mask-inside-defs-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/mask-inside-defs.svg [new file with mode: 0644]
WebCore/ChangeLog
WebCore/ksvg2/svg/SVGMaskElementImpl.cpp

index 411c3c8bc1ebf5c7129712b0eb0d52869fcb13fc..fe189c327e3c70613cffafb55a7a5e7c4a988b0a 100644 (file)
@@ -1,3 +1,15 @@
+2006-01-15  Alexander Kellett  <lypanov@kde.org>
+
+        Reviewed by eseidel.
+
+        <mask> inside <defs> crashes Safari.
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=6548
+
+        * svg/custom/mask-inside-defs-expected.checksum: Added.
+        * svg/custom/mask-inside-defs-expected.png: Added.
+        * svg/custom/mask-inside-defs-expected.txt: Added.
+        * svg/custom/mask-inside-defs.svg: Added.
+
 2006-01-15  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by mjs.
diff --git a/LayoutTests/svg/custom/mask-inside-defs-expected.checksum b/LayoutTests/svg/custom/mask-inside-defs-expected.checksum
new file mode 100644 (file)
index 0000000..c649070
--- /dev/null
@@ -0,0 +1 @@
+6f774d9750b7e9bf32b89d9de9c6066a
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/mask-inside-defs-expected.png b/LayoutTests/svg/custom/mask-inside-defs-expected.png
new file mode 100644 (file)
index 0000000..c551bfd
Binary files /dev/null and b/LayoutTests/svg/custom/mask-inside-defs-expected.png differ
diff --git a/LayoutTests/svg/custom/mask-inside-defs-expected.txt b/LayoutTests/svg/custom/mask-inside-defs-expected.txt
new file mode 100644 (file)
index 0000000..5304884
--- /dev/null
@@ -0,0 +1,10 @@
+KCanvasResource {id="mymask" [type=MASKER]}
+layer at (0,0) size 800x600
+  RenderCanvas at (0,0) size 800x600
+    KCanvasContainer {svg} at (0,0) size 590.50x390.50
+      KCanvasContainer {mask} at (0,0) size 100x100
+        KCanvasItem {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#000000]}] [data="M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00"]
+      KCanvasContainer {g} at (0,0) size 200x200
+        KCanvasItem {rect} at (0,0) size 200x200 [fill={[type=SOLID] [color=#FF0000]}] [data="M0.00,0.00L200.00,0.00L200.00,200.00L0.00,200.00"]
+        KCanvasItem {rect} at (0,0) size 100x100 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L100.00,0.00L100.00,100.00L0.00,100.00"]
+      KCanvasItem {rect} at (9.50,9.50) size 581x381 [stroke={[type=SOLID] [color=#008000]}] [data="M10.00,10.00L590.00,10.00L590.00,390.00L10.00,390.00"]
diff --git a/LayoutTests/svg/custom/mask-inside-defs.svg b/LayoutTests/svg/custom/mask-inside-defs.svg
new file mode 100644 (file)
index 0000000..834a3b9
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<svg xmlns="http://www.w3.org/2000/svg"
+     xmlns:xlink="http://www.w3.org/1999/xlink">
+    <mask id="mymask" x="0" y="0" width="100" height="100">
+        <rect x="0" y="0" width="100" height="100"/>
+    </mask>
+<g mask="url(#mymask)">
+    <rect x="0" y="0" width="200" height="200" fill="red"/>
+    <rect x="0" y="0" width="100" height="100" fill="green"/>
+</g>
+<rect x="10" y="10" width="580" height="380" stroke="green" fill="none" />
+</svg>
\ No newline at end of file
index fc4a35dccf9491da8170d3b5e0387a9505be704d..ac801b3e1c8fcfb60c1cddfd515a16032e8992b1 100644 (file)
@@ -1,3 +1,13 @@
+2006-01-15  Alexander Kellett  <lypanov@kde.org>
+
+        Reviewed by eseidel.
+
+        <mask> inside <defs> crashes Safari.
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=6548
+
+        * ksvg2/svg/SVGMaskElementImpl.cpp:
+        (KSVG::SVGMaskElementImpl::drawMaskerContent):
+
 2006-01-15  Eric Seidel  <eseidel@apple.com>
 
         Reviewed by mjs.
index 90c6317405ddefa5ab36d4a077a056d87c311a5f..917befb719a377a69f84bb2d56feb626afcbc927 100644 (file)
@@ -113,7 +113,7 @@ KCanvasImage *SVGMaskElementImpl::drawMaskerContent()
     KRenderingDevice *device = QPainter::renderingDevice();
     if (!device->currentContext()) // FIXME: hack for now until QPixmap::lockFocus exists
         return 0;
-    if (!attached())
+    if (!renderer())
         return 0;
     KCanvasImage *maskImage = static_cast<KCanvasImage *>(device->createResource(RS_IMAGE));