[svgwg] Issue: SVG marker orientation at a 180° U-turn not well defined marked as SVG Core

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

== SVG marker orientation at a 180° U-turn not well defined ==
SVG 2 provides clear a definition of the ["Path Directionality"](https://www.w3.org/TR/SVG2/paths.html#PathDirectionality), which should help define the correct behavior of auto-orienting markers in most cases.

However, for markers that are not at the start or end of an open sub-path, the [current SVG 2 guidance](https://www.w3.org/TR/SVG2/painting.html#RenderingMarkers) says:

> Otherwise, the marker is oriented in a direction half way between the direction at the end of the preceding segment and the direction at the start of the following segment.

I think that "half way between" needs to be defined more explicitly.  Browsers are currently inconsistent about what that means when the start and end tangent angles are the same (that is, if the path does a U-turn).

Consider this test case ([CodePen link](https://codepen.io/AmeliaBR/pen/8af9bb5a11b8da414499cb8f51c5191c/)):

```xml
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 10">
  <marker id="m" overflow="visible" orient="auto">
    <polygon fill="red" fill-opacity="0.8" points="-2,0 0,-4 2,0" />
  </marker>
  <path fill="none" marker-mid="url('#m')" stroke="navy" 
             d="M 0 3 Q 10 0 10 6 Q 10 0 20 3" />
</svg>
```


Inkscape, Firefox, Chrome, and Safari draw it this way, with the arrow pointing up:

![A symmetrical blue curve, that pinches together in a vertical point in the middle, with an upwardly-pointing red triangle over the mid-point.](https://user-images.githubusercontent.com/9876129/28234987-30ad36a4-68c3-11e7-856f-eddcdaa293a2.png)


MS Edge and IE draw it this way, with the arrow pointing down:

![The same curve, but now the red arrow points down](https://user-images.githubusercontent.com/9876129/28235016-afc76a68-68c3-11e7-9e7f-19e6c0692dbd.png)

Based on consensus, I'm going to say the arrow should point up.  But I don't think the spec text is explicit enough to back that up.


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

Received on Saturday, 15 July 2017 00:42:29 UTC