(
/** @type {HtmlElement} */ el,
/** @type {number} */ kind
)
| 4896 | const SCOPE_BUTTON = 1; |
| 4897 | const SCOPE_LIST_ITEM = 2; |
| 4898 | const isBoundaryForKind = ( |
| 4899 | /** @type {HtmlElement} */ el, |
| 4900 | /** @type {number} */ kind |
| 4901 | ) => { |
| 4902 | if (isScopeBoundary(el)) return true; |
| 4903 | if (el.namespace !== NS_HTML) return false; |
| 4904 | if (kind === SCOPE_BUTTON) return el.tagName === "button"; |
| 4905 | if (kind === SCOPE_LIST_ITEM) { |
| 4906 | return el.tagName === "ol" || el.tagName === "ul"; |
| 4907 | } |
| 4908 | return false; |
| 4909 | }; |
| 4910 | // "have an element in scope": walk the open stack from the top until the |
| 4911 | // named HTML element is found (true) or a scope boundary is hit (false). |
| 4912 | const hasNameInScope = ( |
no test coverage detected