(embedEl: HTMLElement)
| 346 | } |
| 347 | |
| 348 | function disposeCodeEmbed(embedEl: HTMLElement) { |
| 349 | const ownerWindow = embedEl.ownerDocument.defaultView ?? window; |
| 350 | const pendingTimer = pendingEmbedTimers.get(embedEl); |
| 351 | if (pendingTimer) { |
| 352 | ownerWindow.clearTimeout(pendingTimer); |
| 353 | pendingEmbedTimers.delete(embedEl); |
| 354 | } |
| 355 | pendingEmbedRequests.delete(embedEl); |
| 356 | embedRenderTokens.delete(embedEl); |
| 357 | |
| 358 | const child = embedChildren.get(embedEl); |
| 359 | if (child) { |
| 360 | child.onunload(); |
| 361 | embedChildren.delete(embedEl); |
| 362 | } |
| 363 | |
| 364 | const staticChild = embedStaticChildren.get(embedEl); |
| 365 | if (staticChild) { |
| 366 | staticChild.onunload(); |
| 367 | embedStaticChildren.delete(embedEl); |
| 368 | } |
| 369 | |
| 370 | embedEl.removeAttribute("data-code-space-rendered-for"); |
| 371 | } |
| 372 | |
| 373 | function queueAllCodeEmbedsInDocument(doc: Document, docWindow: Window, plugin: CodeSpacePlugin) { |
| 374 | doc.querySelectorAll(".file-embed").forEach((element) => { |
no test coverage detected