(
/** @type {string} */ tagName,
/** @type {number} */ ns,
/** @type {HtmlAttribute[] | undefined} */ attributes,
/** @type {TagPos | null | undefined} */ pos
)
| 4658 | }; |
| 4659 | |
| 4660 | const mkEl = ( |
| 4661 | /** @type {string} */ tagName, |
| 4662 | /** @type {number} */ ns, |
| 4663 | /** @type {HtmlAttribute[] | undefined} */ attributes, |
| 4664 | /** @type {TagPos | null | undefined} */ pos |
| 4665 | ) => |
| 4666 | /** @type {HtmlElement} */ ({ |
| 4667 | type: NodeType.Element, |
| 4668 | tagName, |
| 4669 | namespace: ns, |
| 4670 | attributes: attributes || EMPTY_ATTRS, |
| 4671 | children: [], |
| 4672 | selfClosing: ns === NS_HTML && VOID.has(tagName), |
| 4673 | start: pos ? pos.start : 0, |
| 4674 | end: pos ? pos.end : 0, |
| 4675 | tagEnd: pos ? pos.tagEnd : 0, |
| 4676 | nameEnd: pos ? pos.nameEnd : 0, |
| 4677 | // Present from creation (only `<template>` fills it) so every element |
| 4678 | // keeps one monomorphic hidden class for the open-stack/scope loops. |
| 4679 | templateContent: undefined |
| 4680 | }); |
| 4681 | |
| 4682 | // Clone of a formatting element's attributes: keep name/value (and the |
| 4683 | // serializer name) but drop source offsets so the consumer doesn't emit a |
no test coverage detected