Issue 125447 - [SVG] in path data digit 0 may be omitted
Summary: [SVG] in path data digit 0 may be omitted
Status: CLOSED FIXED
Alias: None
Product: Draw
Classification: Application
Component: code (show other issues)
Version: 4.1.0
Hardware: PC Windows 7
: P3 Normal (vote)
Target Milestone: 4.2.0
Assignee: Armin Le Grand
QA Contact:
URL: http://www.w3.org/TR/SVG/paths.html
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-17 12:39 UTC by Regina Henschel
Modified: 2017-05-20 10:35 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
floating point .8 and 5. in various combinations (1.62 KB, image/svg+xml)
2014-08-17 12:39 UTC, Regina Henschel
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Regina Henschel 2014-08-17 12:39:37 UTC
Created attachment 83842 [details]
floating point .8 and 5. in various combinations

The corresponding issue in LibreOffice is https://bugs.freedesktop.org/show_bug.cgi?id=48068

The error has been discovered by test case "path-data-18-f.svg" from the W3C-SVG test suite. 

Read section "8.3.9 The grammar for path data". The BNF has
floating-point-constant:
    fractional-constant exponent?
    | digit-sequence exponent
fractional-constant:
    digit-sequence? "." digit-sequence
    | digit-sequence "."

That means, that in a fractional-constant
(A) a leading zero can be omitted if a digit-sequence follows the dot.
(B) a trailing zero can be omitted if a digit-sequence is before the dot.

The attached example should show a black line same as the green line but only shifted down a little bit.
 
In AOO the case A fails. The affects the third, forth, fifth and sixth bar in the example.

In Seamonkey the case B fails (first and second bar), Batik shows all cases correctly.
Comment 1 Armin Le Grand 2014-08-25 10:04:55 UTC
Grepping to keep in focus
Comment 2 Armin Le Grand 2014-10-08 10:45:18 UTC
Had to adapt some of the string conversion tools in basegfx to handle the conversions of those numbers in the test doc correctly. Checked and investigated other usages, looks okay. Doing some more checks...
Comment 3 SVN Robot 2014-10-08 11:03:03 UTC
"alg" committed SVN revision 1630069 into trunk:
i125447 corrected some string to number conversion tools to correct svg:d imp...
Comment 4 Armin Le Grand 2014-10-08 11:03:26 UTC
Okay, done.