Class: Element
Hierarchy​
Element
↳
UnknownElement
↳
RenderedElement
↳
PatternElement
↳
MarkerElement
↳
DefsElement
↳
GradientElement
↳
StopElement
↳
AnimateElement
↳
FontElement
↳
FontFaceElement
↳
StyleElement
↳
MaskElement
↳
ClipPathElement
↳
FilterElement
↳
TitleElement
↳
DescElement
Constructors​
constructor​
• new Element(document
, node?
, captureTextNodes?
)
Parameters​
Name | Type | Default value |
---|---|---|
document | Document | undefined |
node? | HTMLElement | undefined |
captureTextNodes | boolean | false |
Defined in​
Properties​
ignoreChildTypes​
â–ª Static
Readonly
ignoreChildTypes: string
[]
Defined in​
type​
• Readonly
type: string
= ''
Defined in​
attributes​
• Readonly
attributes: Record
<string
, Property
<unknown
>> = {}
Defined in​
styles​
• Readonly
styles: Record
<string
, Property
<unknown
>> = {}
Defined in​
stylesSpecificity​
• Readonly
stylesSpecificity: Record
<string
, string
> = {}
Defined in​
animationFrozen​
• animationFrozen: boolean
= false
Defined in​
animationFrozenValue​
• animationFrozenValue: string
= ''
Defined in​
parent​
• parent: Element
= null
Defined in​
children​
• children: Element
[] = []
Defined in​
document​
• Protected
Readonly
document: Document
Defined in​
node​
• Protected
Optional
Readonly
node: HTMLElement
Defined in​
captureTextNodes​
• Protected
Readonly
captureTextNodes: boolean
= false
Defined in​
Methods​
getAttribute​
â–¸ getAttribute(name
, createIfNotExists?
): Property
<unknown
>
Parameters​
Name | Type | Default value |
---|---|---|
name | string | undefined |
createIfNotExists | boolean | false |
Returns​
Property
<unknown
>
Defined in​
getHrefAttribute​
â–¸ getHrefAttribute(): Property
<unknown
>
Returns​
Property
<unknown
>
Defined in​
getStyle​
â–¸ getStyle(name
, createIfNotExists?
, skipAncestors?
): Property
<unknown
>
Parameters​
Name | Type | Default value |
---|---|---|
name | string | undefined |
createIfNotExists | boolean | false |
skipAncestors | boolean | false |
Returns​
Property
<unknown
>
Defined in​
render​
â–¸ render(ctx
): void
Parameters​
Name | Type |
---|---|
ctx | RenderingContext2D |
Returns​
void
Defined in​
setContext​
â–¸ setContext(_
): void
Parameters​
Name | Type |
---|---|
_ | RenderingContext2D |
Returns​
void
Defined in​
applyEffects​
â–¸ Protected
applyEffects(ctx
): void
Parameters​
Name | Type |
---|---|
ctx | RenderingContext2D |
Returns​
void
Defined in​
clearContext​
â–¸ clearContext(_
): void
Parameters​
Name | Type |
---|---|
_ | RenderingContext2D |
Returns​
void
Defined in​
renderChildren​
â–¸ renderChildren(ctx
): void
Parameters​
Name | Type |
---|---|
ctx | RenderingContext2D |
Returns​
void
Defined in​
addChild​
â–¸ Protected
addChild(childNode
): void
Parameters​
Name | Type |
---|---|
childNode | HTMLElement | Element |
Returns​
void
Defined in​
matchesSelector​
â–¸ Protected
matchesSelector(selector
): boolean
Parameters​
Name | Type |
---|---|
selector | string |
Returns​
boolean
Defined in​
addStylesFromStyleDefinition​
â–¸ addStylesFromStyleDefinition(): void
Returns​
void
Defined in​
removeStyles​
â–¸ Protected
removeStyles(element
, ignoreStyles
): [string
, string
][]
Parameters​
Name | Type |
---|---|
element | Element |
ignoreStyles | string [] |
Returns​
[string
, string
][]
Defined in​
restoreStyles​
â–¸ Protected
restoreStyles(element
, styles
): void
Parameters​
Name | Type |
---|---|
element | Element |
styles | [string , string ][] |
Returns​
void
Defined in​
isFirstChild​
â–¸ isFirstChild(): boolean
Returns​
boolean