Table of Contents

Class SVGAnimatedString

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The SVGAnimatedString interface represents string attributes which can be animated from each SVG declaration. You need to create SVG attribute before doing anything else, everything should be declared inside this.

[Value("SVGAnimatedString")]
public class SVGAnimatedString
Inheritance
SVGAnimatedString
Inherited Members

Remarks

-SVGScriptElement.Href, an object of this type.

See also on MDN

Constructors

SVGAnimatedString()

public SVGAnimatedString()

Properties

AnimVal

The animVal read-only property of the SVGAnimatedString interface is a string representing the animated value of the reflected attribute.

[Value("animVal")]
public string AnimVal { get; }

Property Value

string

As string.If the given attribute or property is being animated, this is the current animated value.
If the given attribute or property is not currently being animated, this is the same value as the BaseVal property.

Remarks

BaseVal

WARNING
The baseVal property can be used to set the non-animated value of a reflected attribute.
In the case of SVGScriptElementhref this property represents the URL of an external script loaded into the SVG script element.
APIs like this are known as injection sinks, and are potentially a vector for cross-site scripting (XSS) attacks.
[Value("baseVal")]
public string BaseVal { get; set; }

Property Value

string

Getting the property returns a string that represents the non-animated value of the reflected attribute, if it has been set.
If the reflected attribute is not specified but has an alternative deprecated version that has been set, then its value will be returned instead.
If neither reflected attribute is set, then the property will return an initial value for the reflected attribute if one exists, and otherwise the empty string ("").The property must be set to a TrustedScriptURL if the reflected attribute's element is an SVGScriptElement and Trusted Types are enforced by a CSP.
For all other cases, the value can be a string (or an object that can be resolved to a string).
The property sets the value of the reflected attribute if it is defined, but will set the alternative deprecated version of the reflected attribute if it is defined and the reflected attribute is not.Note that TrustedScriptURL or any other trusted type can be set for baseVal on any element, because the trusted types resolve to strings.
However TrustedScriptURL must be used for SVGScriptElementhref when trusted types are enforced.

Remarks

You can mitigate this risk by having a Content Security Policy (CSP) that restricts the locations from which scripts can be loaded, and by always assigning TrustedScriptURL objects instead of strings, and enforcing trusted types.
See Security considerations in SVGScriptElement.Href for more information.

The baseVal property of the SVGAnimatedString interface gets or sets the base value of the given attribute.

This is the value of the reflected attribute before any animations are applied.

See also on MDN