|
|
|
@ -111,19 +111,18 @@ export function element(anchor, get_tag, is_svg, render_fn) {
|
|
|
|
: document.createElement(next_tag);
|
|
|
|
: document.createElement(next_tag);
|
|
|
|
|
|
|
|
|
|
|
|
if (render_fn) {
|
|
|
|
if (render_fn) {
|
|
|
|
let anchor;
|
|
|
|
// If hydrating, use the existing ssr comment as the anchor so that the
|
|
|
|
|
|
|
|
// inner open and close methods can pick up the existing nodes correctly
|
|
|
|
if (hydrating) {
|
|
|
|
var child_anchor = hydrating
|
|
|
|
// Use the existing ssr comment as the anchor so that the inner open and close
|
|
|
|
? /** @type {Comment} */ (element.firstChild)
|
|
|
|
// methods can pick up the existing nodes correctly
|
|
|
|
: element.appendChild(empty());
|
|
|
|
anchor = /** @type {Comment} */ (element.firstChild);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
if (child_anchor) {
|
|
|
|
anchor = empty();
|
|
|
|
// `child_anchor` can be undefined if this is a void element with children,
|
|
|
|
element.appendChild(anchor);
|
|
|
|
// i.e. `<svelte:element this={"hr"}>...</svelte:element>`. This is
|
|
|
|
}
|
|
|
|
// user error, but we warn on it elsewhere (in dev) so here we just
|
|
|
|
|
|
|
|
// silently ignore it
|
|
|
|
if (anchor) {
|
|
|
|
render_fn(element, child_anchor);
|
|
|
|
render_fn(element, anchor);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|