Bug 62546

Summary: Leading space in numeric attribute makes attribute parse as zero
Product: WebKit Reporter: Tim Horton <thorton>
Component: SVGAssignee: Tim Horton <thorton>
Status: RESOLVED INVALID    
Severity: Normal CC: simon.fraser, zimmermann
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
URL: http://upload.wikimedia.org/wikipedia/commons/f/fe/E8_graph.svg
Attachments:
Description Flags
Testcase (should see two overlapping circles if rendered correctly) none

Tim Horton
Reported 2011-06-13 10:08:44 PDT
Created attachment 96966 [details] Testcase (should see two overlapping circles if rendered correctly) The SVG document at http://upload.wikimedia.org/wikipedia/commons/f/fe/E8_graph.svg contains numeric attributes (the cx and cy of some circle elements, for example) which have leading spaces (" 99.8"). In WebKit, these are currently parsed as 0, causing the document to render incorrectly (though Opera is the only current browser I can find that renders it "correctly", so I'll have to see what the spec says). Reduced test case attached.
Attachments
Testcase (should see two overlapping circles if rendered correctly) (293 bytes, image/svg+xml)
2011-06-13 10:08 PDT, Tim Horton
no flags
Tim Horton
Comment 1 2011-06-13 10:18:10 PDT
Related: https://bugzilla.mozilla.org/show_bug.cgi?id=404089#c4 http://code.google.com/p/chromium/issues/detail?id=8424 https://bugs.kde.org/show_bug.cgi?id=181170 The consensus seems to be that this is an invalid SVG, and that no space is allowed in these fields. The most interesting part of this is that it validates (http://validator.w3.org), but people on the bugs listed above suggest that this is actually a bug in the validator.
Tim Horton
Comment 2 2011-06-13 10:50:21 PDT
Invalid as per SVG Spec (http://www.w3.org/TR/SVG/types.html#DataTypeNumber): length ::= number ("em" | "ex" | "px" | "in" | "cm" | "mm" | "pt" | "pc" | "%")? number ::= integer ([Ee] integer)? | [+-]? [0-9]* "." [0-9]+ ([Ee] integer)? integer ::= [+-]? [0-9]+
Simon Fraser (smfr)
Comment 3 2011-11-01 15:45:42 PDT
Note You need to log in before you can comment on or make changes to this bug.