Skip to content

Commit

Permalink
Issue #10: WIP: Fixing incomplete comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
patricknelson committed Sep 30, 2023
1 parent 8231c07 commit bcde3ae
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export default function(opts) {
* it's difficult to know what the correct/final slot content will be until after the parser has rendered the DOM for
* us.
*
* When performing shadow DOM rendering, it provides an un-styled container where we can attach
* When performing shadow DOM rendering, it provides an un-styled container where we can attach the Svelte component
* once it begins rendering.
*/
if (!window.customElements.get('svelte-retag')) {
window.customElements.define('svelte-retag', class extends HTMLElement {
Expand Down Expand Up @@ -148,7 +149,7 @@ export default function(opts) {

// If compiled as IIFE/UMD and executed early, then the document is likely to be in the process of loading
// and thus actively parsing tags, including not only this tag but also nested content (which may not yet be
// available yet).
// available).
const isLoading = (document.readyState === 'loading');

// Setup the special <svelte-retag> wrapper if not already present (which can happen when
Expand Down Expand Up @@ -241,7 +242,8 @@ export default function(opts) {
// construct/connectedCallback on this one).
this._restoreLightSlots();

// Lastly, unwinding everything in reverse: Remove the special <svelte-tag> wrapper.
// Lastly, unwinding everything in reverse: Remove the "light" DOM root (the special <svelte-tag> wrapper) which
// is only added during connectedCallback(), unlike shadow DOM which is attached in construct.
this.removeChild(this._root);
}
}
Expand Down

0 comments on commit bcde3ae

Please sign in to comment.