[svgwg] Issue: Move path interrogation functions to SVGGeometryElement marked as DoC_accepted

nikosandronikos has just labeled an issue for 
https://github.com/w3c/svgwg as "DoC_accepted":

== Move path interrogation functions to SVGGeometryElement ==
All shape elements are described in terms of their equivalent path - 
or they at least have a defined start point and drawing direction.  
Therefore it seems reasonable and useful that they all ought to 
support the methods on `SVGPathElement` that let you interrogate the 
path.

SVG2 defines a new interface SVGGeometryElement:

    interface SVGGeometryElement : SVGGraphicsElement {
      boolean isPointInFill(DOMPoint point);
      boolean isPointInStroke(DOMPoint point);
    };

My suggestion is that the following methods be moved into this 
interface as well.

      float getTotalLength();
      SVGPoint getPointAtLength(in float distance);

There may be other new functions that could be considered for 
inclusion as well.

- `SVGPoint  nearestPointOnPath(SVGPoint point)`
- `SVGPathElement  toPath()` - returns the equivalent path
- `SVGPathElement  toFlattenedPath(float flatnessError)` - returns 
flattened version of path (line segments only)

Given the explosion of interactive SVG on the web.  Having these 
functions available on all shapes would be extremely useful. 

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

Received on Monday, 8 August 2016 11:06:21 UTC