Reviewed by Maciej.
authorrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Feb 2007 07:55:31 +0000 (07:55 +0000)
committerrwlbuis <rwlbuis@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Feb 2007 07:55:31 +0000 (07:55 +0000)
        http://bugs.webkit.org/show_bug.cgi?id=12913
        Markers do not render in webkit when it misses markerWidth or markerHeight attribute

        Set defaults for markerWidth/markerHeight so markers that do not specify them render.

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

LayoutTests/ChangeLog
LayoutTests/svg/custom/marker-default-width-height-expected.checksum [new file with mode: 0644]
LayoutTests/svg/custom/marker-default-width-height-expected.png [new file with mode: 0644]
LayoutTests/svg/custom/marker-default-width-height-expected.txt [new file with mode: 0644]
LayoutTests/svg/custom/marker-default-width-height.svg [new file with mode: 0644]
WebCore/ChangeLog
WebCore/ksvg2/svg/SVGMarkerElement.cpp

index 02a97a1..46c31ab 100644 (file)
@@ -1,3 +1,16 @@
+2007-02-28  Rob Buis  <buis@kde.org>
+
+        Reviewed by Maciej.
+
+        Add test for:
+        http://bugs.webkit.org/show_bug.cgi?id=12913
+        Markers do not render in webkit when it misses markerWidth or markerHeight attribute
+
+        * svg/custom/marker-default-width-height-expected.checksum: Added.
+        * svg/custom/marker-default-width-height-expected.png: Added.
+        * svg/custom/marker-default-width-height-expected.txt: Added.
+        * svg/custom/marker-default-width-height.svg: Added.
+
 2007-02-27  Geoffrey Garen  <ggaren@apple.com>
 
         Extending the timeout on this test to see if it fixes the buildbot failure.
diff --git a/LayoutTests/svg/custom/marker-default-width-height-expected.checksum b/LayoutTests/svg/custom/marker-default-width-height-expected.checksum
new file mode 100644 (file)
index 0000000..9063ec3
--- /dev/null
@@ -0,0 +1 @@
+4ed2303a9c168a7a02b1ba05f389aff9
\ No newline at end of file
diff --git a/LayoutTests/svg/custom/marker-default-width-height-expected.png b/LayoutTests/svg/custom/marker-default-width-height-expected.png
new file mode 100644 (file)
index 0000000..40c85e5
Binary files /dev/null and b/LayoutTests/svg/custom/marker-default-width-height-expected.png differ
diff --git a/LayoutTests/svg/custom/marker-default-width-height-expected.txt b/LayoutTests/svg/custom/marker-default-width-height-expected.txt
new file mode 100644 (file)
index 0000000..8f96673
--- /dev/null
@@ -0,0 +1,26 @@
+KCanvasResource {id="marker1" [type=MARKER] [angle=0.00] [ref x=5.00 y=5.00]}
+KCanvasResource {id="marker2" [type=MARKER] [angle=0.00] [ref x=5.00 y=5.00]}
+KCanvasResource {id="marker3" [type=MARKER] [angle=0.00] [ref x=5.00 y=5.00]}
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    RenderSVGContainer {svg} at (0,0) size 643.33x283.33
+      RenderSVGContainer {g} at (0,0) size 643.33x283.33
+        RenderSVGText {text} at (0,20) size 800x18
+          RenderSVGInlineText {#text} at (0,-14) size 386x18
+            text run at (0,-14) width 386: "This should show three markers on the path for start/mid/end."
+        RenderSVGText {text} at (0,40) size 800x18
+          RenderSVGInlineText {#text} at (0,-14) size 364x18
+            text run at (0,-14) width 364: "Start marker has no markerWidth/markerHeight specified."
+        RenderSVGText {text} at (0,60) size 800x18
+          RenderSVGInlineText {#text} at (0,-14) size 270x18
+            text run at (0,-14) width 270: "Mid marker has no markerWidth specified."
+        RenderSVGText {text} at (0,80) size 800x18
+          RenderSVGInlineText {#text} at (0,-14) size 274x18
+            text run at (0,-14) width 274: "End marker has no markerHeight specified."
+        RenderSVGContainer {marker} at (0,0) size 5x5
+          RenderPath {rect} at (0,0) size 5x5 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L10.00,0.00L10.00,10.00L0.00,10.00"]
+        RenderSVGContainer {marker} at (0,0) size 5x5
+          RenderPath {rect} at (0,0) size 5x5 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L10.00,0.00L10.00,10.00L0.00,10.00"]
+        RenderSVGContainer {marker} at (0,0) size 5x5
+          RenderPath {rect} at (0,0) size 5x5 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L10.00,0.00L10.00,10.00L0.00,10.00"]
+        RenderPath {path} at (216.67,200) size 83.33x83.33 [start marker=#marker1] [middle marker=#marker2] [end marker=#marker3] [data="M130.00,120.00L180.00,120.00L180.00,170.00"]
diff --git a/LayoutTests/svg/custom/marker-default-width-height.svg b/LayoutTests/svg/custom/marker-default-width-height.svg
new file mode 100644 (file)
index 0000000..f6883e2
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" baseProfile="full" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" viewBox="0 0 480 360">
+       <g id="test-body-content">
+                <text x="0" y="20">This should show three markers on the path for start/mid/end.</text>
+                <text x="0" y="40">Start marker has no markerWidth/markerHeight specified.</text>
+                <text x="0" y="60">Mid marker has no markerWidth specified.</text>
+                <text x="0" y="80">End marker has no markerHeight specified.</text>
+               <marker id="marker1" viewBox="0 0 10 10" refX="5" refY="5" markerUnits="strokeWidth">
+                       <rect width="10" height="10" fill="green" stroke="none"/>
+               </marker>
+               <marker id="marker2" viewBox="0 0 10 10" markerHeight="3" refX="5" refY="5" markerUnits="strokeWidth">
+                       <rect width="10" height="10" fill="green" stroke="none"/>
+               </marker>
+               <marker id="marker3" viewBox="0 0 10 10" markerWidth="3" refX="5" refY="5" markerUnits="strokeWidth">
+                       <rect width="10" height="10" fill="green" stroke="none"/>
+               </marker>
+               <path fill="none" stroke="none" stroke-width="8" marker-start="url(#marker1)" marker-mid="url(#marker2)" marker-end="url(#marker3)" d="M 130 120 L 180 120 L 180 170"/>
+       </g>
+</svg>
index 2a098a9..3480489 100644 (file)
@@ -1,3 +1,15 @@
+2007-02-28  Rob Buis  <buis@kde.org>
+
+        Reviewed by Maciej.
+
+        http://bugs.webkit.org/show_bug.cgi?id=12913
+        Markers do not render in webkit when it misses markerWidth or markerHeight attribute
+
+        Set defaults for markerWidth/markerHeight so markers that do not specify them render.
+
+        * ksvg2/svg/SVGMarkerElement.cpp:
+        (WebCore::SVGMarkerElement::SVGMarkerElement):
+
 2007-02-27  Anders Carlsson  <acarlsson@apple.com>
 
         * loader/ResourceLoader.cpp:
index 440c26d..4a238c3 100644 (file)
@@ -49,6 +49,9 @@ SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document* doc)
     , m_orientType(0)
     , m_orientAngle(new SVGAngle(this))
 {
+    // Spec: If the attribute is not specified, the effect is as if a value of "3" were specified.
+    setMarkerWidthBaseValue(SVGLength(this, LengthModeWidth, "3"));
+    setMarkerHeightBaseValue(SVGLength(this, LengthModeHeight, "3"));
 }
 
 SVGMarkerElement::~SVGMarkerElement()