[svgwg] Issue: 'Path' (entire path) vs. 'subpath' for markers on a start/end vertex of an open subpaths (#759) marked as Painting chapter

AmeliaBR has just labeled an issue for https://github.com/w3c/svgwg as "Painting chapter":

== 'Path' (entire path) vs. 'subpath' for markers on a start/end vertex of an open subpaths ==
In [1], it is stated:

> If the vertex is the start or end of an open subpath, then the marker is oriented in the path direction.

The question is whether the "path direction" here refers to the subpath or the entire path. It appears the result could differ depending on which it is.

Consider the following paths (see [2] for "live" demo):

1. `M10,10v10 m10,0h100`
2. `M10,40l90,10 m10,0`
3. `M10,70h100 m10,10v-10`
4. `M10,100 m10,10`

All have multiple (two) subpaths. 1 through 3 all have non-zero length (but 2 has a zero length subpath). 4 is zero length.

For 1 and 3, is the orientation of a marker at the end of the first subpath the same or different? I.e it seems if the "entire path" is used then this ends up in the "segment boundary" case, while for the "subpath" interpretation it would hit the "distance is the length of the path" case.

In 2, since the marker at the end of the first subpath is at the same distance as the marker on the second subpath, if "path direction" is for the entire path, then these two markers would orient the same (using the orientation of the former). If "path direction" is for the subpath in question, they would orient differently.

I included 4 because it seems fairly clear cut (regardless of "entire path" vs "subpath" the path is zero length) - i.e it would end up in the case where the direction would be the "same direction as the positive x-axis". Both Gecko and Blink seems to infer direction based on the "invisible segments" between first the origin and then the points themselves.

Using the "subpath" interpretation seems the more natural to me, but I don't find it entirely clear that this is what the current spec formulation is trying to convey. Gecko seems to mostly follow that interpretation (see note about path 4 above). Blink is currently inferring orientations based on the "invisible segments" between subpaths in some cases which isn't really correct in any interpretation. (I was in the process of fixing some marker issues in Blink when I noticed this issue though, so expect Blink to change to something much closer to the Gecko behavior.)

[1] https://svgwg.org/svg2-draft/painting.html#RenderingMarkers
[2] https://jsfiddle.net/juh3amxc/3/

See https://github.com/w3c/svgwg/issues/759

Received on Tuesday, 3 December 2019 18:24:06 UTC