utils.dom namespace
Enumerations
Enumeration | Description |
|---|---|
Node type constants. https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType |
Functions
Function | Description |
|---|---|
Add a CSS class to a element. Handles multiple space-separated classes for legacy reasons. | |
Helper method for creating SVG elements. | |
getFastTextWidth(textElement, fontSize, fontWeight, fontFamily) | Gets the width of a text element using a faster method than |
getFastTextWidthWithSizeString(textElement, fontSize, fontWeight, fontFamily) | Gets the width of a text element using a faster method than |
Gets the width of a text element, caching it in the process. | |
Checks if an element has the specified CSS class. | |
Insert a node after a reference node. Contrast with node.insertBefore function. | |
Measure a font's metrics. The height and baseline values. | |
Remove a CSS class from a element. Handles multiple space-separated classes for legacy reasons. | |
Removes multiple classes from an element. | |
Removes a node from its parent. No-op if not attached to a parent. | |
Sets the CSS transform property on an element. This function sets the non-vendor-prefixed and vendor-prefixed versions for backwards compatibility with older browsers. See https://caniuse.com/#feat=transforms2d | |
Start caching text widths. Every call to this function MUST also call stopTextWidthCache. Caches must not survive between execution threads. | |
Stop caching field widths. Unless caching was already on when the corresponding call to startTextWidthCache was made. |
Variables
Variable | Description |
|---|---|
Required name space for HTML elements. | |
Required name space for SVG elements. | |
Required name space for XLINK elements. |