- From: Said Abou-Hallawa via GitHub <noreply@w3.org>
- Date: Wed, 18 Jun 2025 17:20:22 +0000
- To: public-svg-issues@w3.org
I think `SVGPolylineElement` and `SVGPolygonElement` have weird and inconsistent interfaces compared to the rest of the SVG elements. These two elements have the `baseVal` and `animVal` of the points flattened to two members `points` and `animatedPoints`. But `SVGTextPositioningElement`, for example, has a different interface. It has its members represented as `SVGAnimatedLengthList`
```
interface SVGTextPositioningElement : SVGTextContentElement {
readonly attribute SVGAnimatedLengthList x;
...
};
```
It does not have `x` and `animatedX` of type `SVGLengthList`. It just has `x` of type `SVGAnimatedLengthList`.
So to access the `baseVal` or `animVal` `SVGLengthList` of a text element, you would say `text.x.baseVal` or `text.x.animVal`.
It would have made things much simpler and clearer if `SVGPolylineElement` was defined like this:
```
interface SVGPolylineElement : SVGGeometryElement {
readonly attribute SVGAnimatedPointList points;
};
```
And instead of accessing the current `points` and `animatedPoints` we would have accessed `points.baseVal` and `points.animVal`
--
GitHub Notification of comment by shallawa
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/706#issuecomment-2985118963 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Wednesday, 18 June 2025 17:20:23 UTC