- From: ewilligers via GitHub <sysbot+gh@w3.org>
- Date: Sat, 27 May 2017 08:21:57 +0000
- To: public-svg-issues@w3.org
ewilligers has just created a new issue for https://github.com/w3c/svgwg:
== Serialization format for path strings ==
This issue came up in an Intent to Ship (offset-path animation) discussion on blink-dev.
https://groups.google.com/a/chromium.org/d/msg/blink-dev/_DPl-JG6bV8/y2_GUwFVDwAJ
'd' path strings can contain a mix of absolute and relative coordinates, and a mix of comma and
space separators. https://www.w3.org/TR/SVG2/paths.html#TheDProperty
It is also possible to animate between paths that differ in the use of separators and absolute and
relative coordinates, for example between 'M 200 400 H 500 v -100' and 'm100,200h400V300'.
Now that 'd' is exposed as a presentation attribute, page authors can use getComputedStyle to
inspect the path string.
For consistency between implementations, it would be helpful if the standard specified absolute
[or relative] coordinates in the serialization format, and space separators.
The above example path strings would become 'M 200 400 H 500 V 300' and 'M 100 200 H 500 V300'
when serialized.
Blink's currently shipping implementation uses space separators, and uses the 'to' format for
absolute/relative coordinates, except at animation progress 0, where the 'from' format is used:-
property <d> from [path('M 200 400 H 500 v -100')] to [path('m100,200h400V300')]
at (0) is [path('M 200 400 H 500 v -100')]
at (0.5) is [path('m 150 300 h 350 V 300')]
at (1) is [path('m 100 200 h 400 V 300')]
If we specify absolute coordinates for the serialization format, these would become:
property <d> from [path('M 200 400 H 500 v -100')] to [path('m100,200h400V300')]
at (0) is [path('M 200 400 H 500 V 300')]
at (0.5) is [path('M 150 300 H 500 V 300')]
at (1) is [path('M 100 200 H 500 V 300')]
If we specify relative coordinates for the serialization format, these would become:
property <d> from [path('M 200 400 H 500 v -100')] to [path('m100,200h400V300')]
at (0) is [path('m 200 400 h 300 v -100')]
at (0.5) is [path('m 150 300 h 350 v 0')]
at (1) is [path('m 100 200 h 400 v 100')]
No backward compatibility issues are anticipated in moving to consistent absolute coordinates [or consistent relative coordinates].
If issue #320 is accepted, there is also the choice of quote character around the path string. Blink uses single quotes.
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/321 using your GitHub account
Received on Saturday, 27 May 2017 08:22:04 UTC