Bug 72401 - [SVG2]: Implement support for the 'pathLength' attribute
Summary: [SVG2]: Implement support for the 'pathLength' attribute
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks: 191292 200143
  Show dependency treegraph
 
Reported: 2011-11-15 11:15 PST by Jonathan Watt
Modified: 2019-11-19 15:15 PST (History)
18 users (show)

See Also:


Attachments
testcase (357 bytes, image/svg+xml)
2011-11-15 11:16 PST, Jonathan Watt
no flags Details
Another test case (956 bytes, image/svg+xml)
2014-12-05 19:57 PST, Said Abou-Hallawa
no flags Details
Patch (131.59 KB, patch)
2019-11-19 13:45 PST, Said Abou-Hallawa
sabouhallawa: review?
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Watt 2011-11-15 11:15:05 PST
It seems like WebKit lacks support for the <path> element's 'pathLength' attribute:

http://www.w3.org/TR/SVG11/paths.html#PathLengthAttribute
Comment 1 Jonathan Watt 2011-11-15 11:16:50 PST
Created attachment 115207 [details]
testcase

The dashing of the two lines in this testcase should NOT be the same (the values in the stroke-dasharray of the second path should be scaled down by a half, since the user specified 'pathLength' is twice the actual length of the path).
Comment 2 Jonathan Watt 2011-11-15 11:23:05 PST
Note pathLength should affect offsets along a textPath too.
Comment 3 Dirk Schulze 2014-05-12 06:57:51 PDT
(In reply to comment #1)
> Created an attachment (id=115207) [details]
> testcase
> 
> The dashing of the two lines in this testcase should NOT be the same (the values in the stroke-dasharray of the second path should be scaled down by a half, since the user specified 'pathLength' is twice the actual length of the path).

We do not support it. But the specification seems vague as well. Does pathLength mean we change the offset of markers too?
Comment 4 Jonathan Watt 2014-05-12 07:06:10 PDT
Markers are not positioned at a distance specified by the author. They are on the vertices, and should stay on the vertices regardless of pathLength.
Comment 5 Dirk Schulze 2014-05-12 09:01:58 PDT
(In reply to comment #4)
> Markers are not positioned at a distance specified by the author. They are on the vertices, and should stay on the vertices regardless of pathLength.

Beside glyph/element positioning and dash array, what else is effected? line caps?
Comment 6 Cameron McCormack 2014-06-01 18:36:13 PDT
(In reply to comment #4)
> Markers are not positioned at a distance specified by the author. They are on the vertices, and should stay on the vertices regardless of pathLength.

Although the new positioned markers in SVG 2 should be affected by pathLength.

(In reply to comment #5)
> Beside glyph/element positioning and dash array, what else is effected? line caps?

The DOM methods on SVGPathElement that take an offset along the path, too.
Comment 7 Said Abou-Hallawa 2014-12-05 19:57:52 PST
Created attachment 242696 [details]
Another test case

This test case is originally from Mozilla test suite for SVG. I changed it a little and I modified the comment accordingly.
Comment 8 Radar WebKit Bug Importer 2014-12-05 19:58:31 PST
<rdar://problem/19165803>
Comment 9 Said Abou-Hallawa 2019-07-25 13:57:55 PDT
Failed WPT tests: http://web-platform-tests.live/svg/shapes/line-dasharray.svg
Comment 13 Said Abou-Hallawa 2019-11-19 13:45:44 PST
Created attachment 383900 [details]
Patch