happy-dom
Version:
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.
33 lines (30 loc) • 878 B
text/typescript
import * as PropertySymbol from '../../PropertySymbol.js';
import SVGAnimatedNumber from '../../svg/SVGAnimatedNumber.js';
import SVGElement from '../svg-element/SVGElement.js';
/**
* SVG Stop Element.
*
* @see https://developer.mozilla.org/en-US/docs/Web/API/SVGStopElement
*/
export default class SVGStopElement extends SVGElement {
// Internal properties
public [PropertySymbol.offset]: SVGAnimatedNumber | null = null;
/**
* Returns offset.
*
* @returns Offset.
*/
public get offset(): SVGAnimatedNumber {
if (!this[PropertySymbol.offset]) {
this[PropertySymbol.offset] = new SVGAnimatedNumber(
PropertySymbol.illegalConstructor,
this[PropertySymbol.window],
{
getAttribute: () => this.getAttribute('offset'),
setAttribute: (value) => this.setAttribute('offset', value)
}
);
}
return this[PropertySymbol.offset];
}
}