Bug 29123

Summary: Fails to parse the "d" attribute of a path if a command starts with a '.'
Product: WebKit Reporter: Rafał Rutkowski <rrutkowski>
Component: SVGAssignee: Nobody <webkit-unassigned>
Status: VERIFIED FIXED    
Severity: Normal CC: commit-queue, darin
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
patch that fixes SVG path tat starts with dot '.'
darin: review-
re-submit the patch with test case added none

Description Rafał Rutkowski 2009-09-10 06:49:35 PDT
The following path will not be parsed
<path d="M.1 0.1l0 .3 .2 0" />
The cause is the last command: ".2 0", which starts with a '.'.

The following examples work fine:
M.1 0.1l0 .3 +.2 0
M.1 0.1l0 .3 0.2 0
M.1 0.1l0 .3 l.2 0
M.1 0.1l0 .3

Test case:
http://strony.aster.pl/rrutkows/test_cases/webkit/svg_path_parse_error/L.svg

Result:
Nothing is displayed. An error appears in the Chrome console:
Error: Problem parsing d="M.1 0.1l0 .3 .2 0"

Expected result:
A black shape resembling a capital letter 'L' should be displayed. Works on Opera, Firefox and IE+Adobe SVG Viewer.

Tested on Safari 4.0 (530.17) and Chrome 4.0.206.1 (532.0)
Comment 1 Charles Wei 2009-09-14 07:49:34 PDT
Created attachment 39544 [details]
patch that fixes SVG path tat starts with dot '.'

This patch fixes the SVT Path problem that starts with a dot '.'
Comment 2 Darin Adler 2009-09-14 07:52:51 PDT
Comment on attachment 39544 [details]
patch that fixes SVG path tat starts with dot '.'

In the WebKit project we require regression tests checked in along with bug fixes.

There's already a test of the path parser in LayoutTests/svg/dom/path-parser.html so for this bug you could probably add some tests cases to that.

review- because of lack of a test
Comment 3 Charles Wei 2009-09-15 00:15:07 PDT
Created attachment 39589 [details]
re-submit the patch with test case added

resubmitting the patch with test cases added.
Comment 4 WebKit Commit Bot 2009-09-15 10:52:16 PDT
Comment on attachment 39589 [details]
re-submit the patch with test case added

Clearing flags on attachment: 39589

Committed r48393: <http://trac.webkit.org/changeset/48393>
Comment 5 WebKit Commit Bot 2009-09-15 10:52:22 PDT
All reviewed patches have been landed.  Closing bug.