(block, parent_node, parent_nodes)
| 19505 | return super.is_dom_node() && !this.child_dynamic_element; |
| 19506 | } |
| 19507 | render_element(block, parent_node, parent_nodes) { |
| 19508 | const { renderer } = this; |
| 19509 | if (this.node.name === "noscript") |
| 19510 | return; |
| 19511 | const node2 = this.var; |
| 19512 | const nodes = parent_nodes && block.get_unique_name(`${this.var.name}_nodes`); |
| 19513 | const children = x`@children(${this.node.name === "template" ? x`${node2}.content` : node2})`; |
| 19514 | block.add_variable(node2); |
| 19515 | const render_statement = this.get_render_statement(block); |
| 19516 | block.chunks.create.push(b`${node2} = ${render_statement};`); |
| 19517 | if (renderer.options.hydratable) { |
| 19518 | if (parent_nodes) { |
| 19519 | block.chunks.claim.push(b` |
| 19520 | ${node2} = ${this.get_claim_statement(block, parent_nodes)}; |
| 19521 | `); |
| 19522 | if (!this.void && this.node.children.length > 0) { |
| 19523 | block.chunks.claim.push(b` |
| 19524 | var ${nodes} = ${children}; |
| 19525 | `); |
| 19526 | } |
| 19527 | } else { |
| 19528 | block.chunks.claim.push(b`${node2} = ${render_statement};`); |
| 19529 | } |
| 19530 | } |
| 19531 | if (parent_node) { |
| 19532 | const append2 = b`@append(${parent_node}, ${node2});`; |
| 19533 | append2[0].expression.callee.loc = { |
| 19534 | start: this.renderer.locate(this.node.start), |
| 19535 | end: this.renderer.locate(this.node.end) |
| 19536 | }; |
| 19537 | block.chunks.mount.push(append2); |
| 19538 | if (is_head(parent_node)) { |
| 19539 | block.chunks.destroy.push(b`@detach(${node2});`); |
| 19540 | } |
| 19541 | } else { |
| 19542 | const insert2 = b`@insert(#target, ${node2}, #anchor);`; |
| 19543 | insert2[0].expression.callee.loc = { |
| 19544 | start: this.renderer.locate(this.node.start), |
| 19545 | end: this.renderer.locate(this.node.end) |
| 19546 | }; |
| 19547 | block.chunks.mount.push(insert2); |
| 19548 | block.chunks.destroy.push(b`if (detaching) @detach(${node2});`); |
| 19549 | } |
| 19550 | const can_use_textcontent = this.can_use_textcontent(); |
| 19551 | if (!this.node.namespace && (this.can_use_innerhtml || can_use_textcontent) && this.fragment.nodes.length > 0) { |
| 19552 | if (this.fragment.nodes.length === 1 && this.fragment.nodes[0].node.type === "Text") { |
| 19553 | block.chunks.create.push(b`${node2}.textContent = ${string_literal(this.fragment.nodes[0].data)};`); |
| 19554 | } else { |
| 19555 | const state = { |
| 19556 | quasi: { |
| 19557 | type: "TemplateElement", |
| 19558 | value: { raw: "" } |
| 19559 | } |
| 19560 | }; |
| 19561 | const literal2 = { |
| 19562 | type: "TemplateLiteral", |
| 19563 | expressions: [], |
| 19564 | quasis: [] |
no test coverage detected