Bug 29123 - Fails to parse the "d" attribute of a path if a command starts with a '.'
Summary: Fails to parse the "d" attribute of a path if a command starts with a '.'
Status: VERIFIED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-10 06:49 PDT by Rafał Rutkowski
Modified: 2009-10-15 02:08 PDT (History)
2 users (show)

See Also:


Attachments
patch that fixes SVG path tat starts with dot '.' (1.37 KB, patch)
2009-09-14 07:49 PDT, Charles Wei
darin: review-
Details | Formatted Diff | Diff
re-submit the patch with test case added (2.92 KB, patch)
2009-09-15 00:15 PDT, Charles Wei
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.