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
+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.
-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]}
--- /dev/null
+9d1e111b0a2bc87833070eefa0ba3a56
\ No newline at end of file
--- /dev/null
+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"
--- /dev/null
+<svg width="300" height="200" viewBox="0 0,
1	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
+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.
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 == ',') {