Closed Bug 404089 Opened 18 years ago Closed 18 years ago

SVG fails to ignore leading whitespace in coordinates

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: bugzilla, Unassigned)

References

Details

Attachments

(1 file)

In current trunk builds, ( tested with SM and Fx, Gecko/200711160{3|4} ) <line x1="557.8" y1="54.5" x2="28.1" y2="713.9"/> works, while <line x1="557.8" y1=" 54.5" x2=" 28.1" y2="713.9"/> doesn't (note the additional whitespace in y1 and x2): y1 and x2 are treated as undefined, i.e. 0. In branch build, this doesn't happen. This happens on all platforms. I searched the specs on http://www.w3.org/TR/SVG/ to check what actually /should/ happen in that case, but completely failed to find the relevant part. Also see attachment.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → INVALID
Regressed between 2007101902 and 2007102002. Robert: Where does this address whitespace *around* data types?
Ho-hum: http://validator.w3.org/check?uri=https://bugzilla.mozilla.org/attachment.cgi?id=289044 tells me the SVG *with* whitespace characters is valid too. This may of course be a mistake by the validator, but it makes me suspect there might be more to it.
First, I'm no SVG guru. but: the spec doesn't *allow* any whitespace in these fields, so there's just no need to prohibit them explicitly... <http://www.w3.org/TR/SVG/svgdtd.html>: x1 %Coordinate.datatype; #IMPLIED <http://www.w3.org/TR/SVG/types.html>: "A <coordinate> represents a <length>..." "The format of a <length> is a <number> optionally followed immediately by a unit identifier." And the <number> definition doesn't mention whitespace anywhere, but it says which characters are allowed...
(In reply to comment #3) You can report that bug in the validator at http://www.w3.org/Bugs/Public/
Depends on: 399642
Did anyone report this to the W3C bug tracker yet? Please put a link to the report in the URL field here. KSVG has the same bug: https://bugs.kde.org/show_bug.cgi?id=181170 But Inkscape and OpenOffice behave as exptected and ignore the leading whitespace. Suppose that a file with leading whitespace in a coordinate really is invalid. Is Mozillas behaviour to silently pick an arbitrary value for the coordinate correct? Should it not give an error instead?
(In reply to comment #11) > KSVG has the same bug: https://bugs.kde.org/show_bug.cgi?id=181170 I.e. KSVG works correctly. > > But Inkscape and OpenOffice behave as exptected and ignore the leading > whitespace. Report bugs on them then since that's not valid behaviour :-) > > Suppose that a file with leading whitespace in a coordinate really is invalid. > Is Mozillas behaviour to silently pick an arbitrary value for the coordinate > correct? Should it not give an error instead? We do give an error, check the error console, and we don't pick an arbitrary value, we use the default value for the attribute.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: