ember-source
Version:
A JavaScript framework for creating ambitious web applications
38 lines (32 loc) • 1.5 kB
JavaScript
import '../../shared-chunks/fragment-EpVz5Xuc.js';
import '../validator/index.js';
import '../../shared-chunks/reference-BNqcwZWH.js';
import { C as ConcreteBounds } from '../../shared-chunks/on-CrTl7JQU.js';
import '../../shared-chunks/constants-b-2IVErl.js';
import '../../shared-chunks/capabilities-DGmQ_mz4.js';
import createHTMLDocument from '../../@simple-dom/document/index.js';
import { D as DOMTreeConstruction } from '../../shared-chunks/element-builder-CiLTrXD6.js';
export { s as serializeBuilder } from '../../shared-chunks/serialize-builder-CVQ3q8rJ.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 };