[webkit-dev] SVGPathSegList relative coordinates and segment lengths

David Yonge-Mallo davinci at chromium.org
Thu Mar 25 08:44:30 PDT 2010


I'm trying to fix bug 30219 <https://bugs.webkit.org/show_bug.cgi?id=30219>,
and the problem is that relative path data commands appear to be internally
stored in absolute coordinates.  So an insertion of a relative path command
requires all subsequent coordinates to be updated.  (I'm not entirely clear
on where or how or even if pathSegList and normalizedPathSegList are

As a first step to get the test case working, I've made a patch that
calculates the correct coordinates in SVGPathSegList::toPathData().  This
isn't the correct fix (presumably the reason the coordinates appear to be
stored as absolute coordinates is so they wouldn't have to be recomputed,
for speed reasons), but it gets the test case to render correctly.

As a part of my investigation, I came across the
SVGPathSegList::getPathSegAtLength function.  This function is supposed to
take in a distance and return the index to the segment at that distance, but
it appears never to use its parameter.  Furthermore, the value that is
actually being used for the distance, PathTravelState::m_desiredLength,
appears to never be initialised anywhere.

The above is possibly related to bug
which seems to suggest that getSegmentAtLength isn't implemented.

Any advice about what needs to be updated for an inserted relative path
command and where those changes should properly go, as well as an
explanation of getPathSegAtLength, would be appreciated.  Thank you in

David Yonge-Mallo
Software Engineer - Google Waterloo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20100325/8da5ae15/attachment.html>

More information about the webkit-dev mailing list