Re: [svgwg] Status of animVal deprecation (#1100)

> How can this change be implemented? `SVGSMILElement` animates the SVG animators when the timer fires. The calculated animated value has to be stored somewhere in the C++ SVG property say `m_animVal`. Because of the backward compatibility, we need to still provide the JS `animVal`. This proposal will make `baseVal` and `animVal` return the same thing: `m_baseVal`. So we calculate `m_animVal` but we return `m_baseVal` for both JS attributes `baseVal` and `animVal`.
> 
> This will make interfaces like `SVGAnimatedLength` useless. It has two attributes: `baseVal` and `animVal` and both of them return the same value regardless whether the property is currently animating or not.

That's correct -it will make SVGAnimatedLength "useless" but in a backwards compatible way. All SVG code from the past 25 years that uses "someRect.x.baseVal.value" will continue to work as-is. It's just that animVal reflection -- which is _rarely_ used, will be broken on purpose.

> 
> It will make more sense to replace all the SVG animated properties with the underlying properties' types. For example `SVGRectElement` can have this interface:
> 
> ```
> [
>     Exposed=Window
> ] interface SVGRectElement : SVGGeometryElement {
>     readonly attribute SVGLength x;
>     readonly attribute SVGLength y;
>     readonly attribute SVGLength width;
>     readonly attribute SVGLength height;
>     readonly attribute SVGLength rx;
>     readonly attribute SVGLength ry;
> };
> ```

That won't work, breaking all existing content that reads attribute values via SVG DOM. someRect.x.baseVal.value must continue to exist, we cannot change it to someRect.x.value instead.


-- 
GitHub Notification of comment by nikolaszimmermann
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/1100#issuecomment-4335082419 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 28 April 2026 12:12:08 UTC