ember-source
Version:
A JavaScript framework for creating ambitious web applications
41 lines (35 loc) • 1.64 kB
JavaScript
import '../../shared-chunks/fragment-Cc5k9Oy4.js';
import '../../shared-chunks/debug-to-string-CFb7h0lY.js';
import '../global-context/index.js';
import '../validator/index.js';
import '../../shared-chunks/reference-C3TKDRnP.js';
import { C as ConcreteBounds } from '../../shared-chunks/dynamic-CFg3dljk.js';
import '../../shared-chunks/constants-eoaL3OJQ.js';
import '../destroyable/index.js';
import '../../shared-chunks/capabilities-O_xc7Yqk.js';
import createHTMLDocument from '../../@simple-dom/document/index.js';
import { D as DOMTreeConstruction } from '../../shared-chunks/element-builder-BOxP8emt.js';
export { s as serializeBuilder } from '../../shared-chunks/serialize-builder-b_gSYCSS.js';
class NodeDOMTreeConstruction extends DOMTreeConstruction {
// Hides property on base class
constructor(doc) {
super(doc || createHTMLDocument());
}
// override to prevent usage of `this.document` until after the constructor
setupUselessElement() {}
insertHTMLBefore(parent, reference, html) {
// eslint-disable-next-line @typescript-eslint/no-deprecated, @typescript-eslint/no-non-null-assertion
let raw = this.document.createRawHTMLSection(html);
parent.insertBefore(raw, reference);
return new ConcreteBounds(parent, raw, raw);
}
// override to avoid SVG detection/work when in node (this is not needed in SSR)
createElement(tag) {
return this.document.createElement(tag);
}
// override to avoid namespace shenanigans when in node (this is not needed in SSR)
setAttribute(element, name, value) {
element.setAttribute(name, value);
}
}
export { NodeDOMTreeConstruction };