2006-09-26 Eric Seidel <eric@eseidel.com>
authoreseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Sep 2006 13:08:23 +0000 (13:08 +0000)
committereseidel <eseidel@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Sep 2006 13:08:23 +0000 (13:08 +0000)
        Reviewed by Tim H.

        viewbox parser does not allow <tab> as a delimiter
        http://bugzilla.opendarwin.org/show_bug.cgi?id=11014

        Test: svg/hixie/viewbox/003.xml

        * ksvg2/svg/svgpathparser.cpp:
        (WebCore::isWhitespace): new function
        (WebCore::skipOptionalSpaces):
        (WebCore::skipOptionalSpacesOrComma):

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

LayoutTests/ChangeLog
LayoutTests/svg/custom/gradient-stroke-width-expected.txt
LayoutTests/svg/hixie/viewbox/003-expected.checksum [new file with mode: 0644]
LayoutTests/svg/hixie/viewbox/003-expected.png [new file with mode: 0644]
LayoutTests/svg/hixie/viewbox/003-expected.txt [new file with mode: 0644]
LayoutTests/svg/hixie/viewbox/003.xml [new file with mode: 0644]
WebCore/ChangeLog
WebCore/ksvg2/svg/svgpathparser.cpp

index 95e6d1ca90818a9a30c306de79a7e5e7c20e025c..6849764c623a4c091d255bea7fd2df84ca0c6d95 100644 (file)
@@ -1,3 +1,15 @@
+2006-09-26  Eric Seidel  <eric@eseidel.com>
+
+        Reviewed by Tim H.
+        
+        viewbox parser does not allow <tab> as a delimiter
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=11014
+
+        * svg/hixie/viewbox/003-expected.checksum: Added.
+        * svg/hixie/viewbox/003-expected.png: Added.
+        * svg/hixie/viewbox/003-expected.txt: Added.
+        * svg/hixie/viewbox/003.xml: Added.
+
 2006-09-26  Eric Seidel  <eric@eseidel.com>
 
         Reviewed by Tim H.
index 8b15ee3c63a4c51b3af869661ea425471807ead1..e911cf6683d29d62950a6adc4517512914753643 100644 (file)
@@ -1,4 +1,3 @@
-EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:(null) affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 KRenderingPaintServer {id="black2white" [type=LINEAR-GRADIENT] [stops=[(0.00,#000000), (1.00,#0000004C)]] [start=(0,0)] [end=(100,0)]}
 KRenderingPaintServer {id="red-grad" [type=LINEAR-GRADIENT] [stops=[(0.00,#D7433C), (1.00,#BD1F1844)]] [start=(0,0)] [end=(100,0)]}
 KRenderingPaintServer {id="red-radial-grad" [type=RADIAL-GRADIENT] [stops=[(0.00,#D7433C), (1.00,#BD1F1844)]] [center=(50,50)] [focal=(50,50)] [radius=50.00]}
diff --git a/LayoutTests/svg/hixie/viewbox/003-expected.checksum b/LayoutTests/svg/hixie/viewbox/003-expected.checksum
new file mode 100644 (file)
index 0000000..693bad6
--- /dev/null
@@ -0,0 +1 @@
+9d1e111b0a2bc87833070eefa0ba3a56
\ No newline at end of file
diff --git a/LayoutTests/svg/hixie/viewbox/003-expected.png b/LayoutTests/svg/hixie/viewbox/003-expected.png
new file mode 100644 (file)
index 0000000..4b51af8
Binary files /dev/null and b/LayoutTests/svg/hixie/viewbox/003-expected.png differ
diff --git a/LayoutTests/svg/hixie/viewbox/003-expected.txt b/LayoutTests/svg/hixie/viewbox/003-expected.txt
new file mode 100644 (file)
index 0000000..760a33b
--- /dev/null
@@ -0,0 +1,7 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+    KCanvasContainer {svg} at (50,0) size 200x200
+      KCanvasItem {rect} at (50,0) size 200x200 [fill={[type=SOLID] [color=#008000]}] [data="M0.00,0.00L1.00,0.00L1.00,1.00L0.00,1.00"]
+      RenderSVGText {text} at (0,0) size 800x23
+        RenderText {#text} at (0,0) size 44x23
+          text run at (0,0) width 44: "FAIL"
diff --git a/LayoutTests/svg/hixie/viewbox/003.xml b/LayoutTests/svg/hixie/viewbox/003.xml
new file mode 100644 (file)
index 0000000..8eee8dd
--- /dev/null
@@ -0,0 +1,4 @@
+<svg width="300" height="200" viewBox="0     0,&#xA;1&#x9;1" xmlns="http://www.w3.org/2000/svg">
+ <rect x="0" y="0" width="1" height="1" fill="green"/>
+ <text x="10" y="30" font-size="20" fill="red">FAIL</text>
+</svg>
\ No newline at end of file
index 7da223fbf63fe91843e987fe0dd3639303b35f32..9bac03f73d6b9bf83685e2e3d60df9908f5a2a5d 100644 (file)
@@ -1,3 +1,17 @@
+2006-09-26  Eric Seidel  <eric@eseidel.com>
+
+        Reviewed by Tim H.
+        
+        viewbox parser does not allow <tab> as a delimiter
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=11014
+
+        Test: svg/hixie/viewbox/003.xml
+
+        * ksvg2/svg/svgpathparser.cpp:
+        (WebCore::isWhitespace): new function
+        (WebCore::skipOptionalSpaces):
+        (WebCore::skipOptionalSpacesOrComma):
+
 2006-09-26  Eric Seidel  <eric@eseidel.com>
 
         Reviewed by Tim H.
index 9649b93aea320fd8527291a0db252f378fb0a1ae..3fc69b6aa07d2bd621db296efc54215ffd87176b 100644 (file)
 
 namespace WebCore {
 
+// SVG allows several different whitespace characters:
+// http://www.w3.org/TR/SVG/paths.html#PathDataBNF
+static inline bool isWhitespace(char c) {
+    return (c == ' ' || c == '\t' || c == '\n' || c == '\r');
+}
 
 // All strings are assumed to be null terminated
 static inline bool skipOptionalSpaces(const char*& ptr) // true means "found space"
 {
-    if (*ptr != ' ')
+    if (!isWhitespace(*ptr))
         return false;
-    while (*ptr == ' ')
+    while (isWhitespace(*ptr))
         ptr++;
     return true;
 }
 
 static inline bool skipOptionalSpacesOrComma(const char*& ptr)
 {
-    if (*ptr != ' ' && *ptr != ',')
+    if (!isWhitespace(*ptr) && *ptr != ',')
         return false;
     skipOptionalSpaces(ptr);
     if (*ptr == ',') {