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 6db283f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 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 Expand Up @@ -312,8 +314,10 @@ export default function(opts) {
}

/**
* To support context, this traverses the DOM to find potential parent svelte-retag elements which may contain
* context necessary to render this component. See context functions at: https://svelte.dev/docs/svelte#setcontext
* To support context, this traverses the DOM to find potential parent elements (also managed by svelte-retag) which
* may contain context necessary to render this component.
*
* See context functions at: https://svelte.dev/docs/svelte#setcontext
*
* @returns {Map|null}
*/
Expand Down

0 comments on commit 6db283f

Please sign in to comment.