Web/API/SVGGradientElement

From Get docs


The SVGGradient interface is a base interface used by SVGLinearGradientElement and SVGRadialGradientElement.

Constants

Name Value Description
SVG_SPREADMETHOD_UNKNOWN 0 The type is not one of predefined types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.
SVG_SPREADMETHOD_PAD 1 Corresponds to value pad.
SVG_SPREADMETHOD_REFLECT 2 Corresponds to value reflect.
SVG_SPREADMETHOD_REPEAT 3 Corresponds to value repeat.

Properties

This interface also inherits properties from its parent, SVGElement, and implements those of SVGURIReference.

SVGGradientElement.gradientUnits Read only
Returns an SVGAnimatedEnumeration corresponding to the gradientUnits attribute on the given element. Takes one of the constants defined in SVGUnitTypes.
SVGGradientElement.gradientTransform Read only
Returns an SVGAnimatedTransformList corresponding to attribute gradientTransform on the given element.
SVGGradientElement.spreadMethod Read only
Returns an SVGAnimatedEnumeration corresponding to attribute spreadMethod on the given element. One of the spread method types defined on this interface.

Methods

This interface does not provide any specific methods, but implements those of its parent, SVGElement.

Specifications

Specification Status Comment
Scalable Vector Graphics (SVG) 2The definition of 'SVGGradientElement' in that specification. Candidate Recommendation Removed inheritance of SVGExternalResourcesRequired, SVGStylable, and SVGUnitTypes
Scalable Vector Graphics (SVG) 1.1 (Second Edition)The definition of 'SVGGradientElement' in that specification. Recommendation Initial definition

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
SVGGradientElement Chrome

Full support Yes

Edge

Full support ≤18

Firefox

Full support Yes

IE

?

Opera

Full support Yes

Safari

Full support Yes

WebView Android

No support No

Chrome Android

Full support Yes

Firefox Android

Full support Yes

Opera Android

Full support Yes

Safari iOS

Full support Yes

Samsung Internet Android

Full support Yes

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown