frosty 0.0.42 → 0.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3922,9 +3922,10 @@ class _DOMRenderer extends renderer._Renderer {
3922
3922
  /** @internal */
3923
3923
  _afterUpdate() {
3924
3924
  this._tracked_style.select(this._tracked_style_names);
3925
+ const head = this.document.head ?? this.document.createElementNS(HTML_NS, 'head');
3925
3926
  if (this._tracked_style.isEmpty) {
3926
3927
  if (this._server) {
3927
- this.__replaceChildren(this.document.head, this._tracked_head_children);
3928
+ this.__replaceChildren(head, this._tracked_head_children);
3928
3929
  }
3929
3930
  }
3930
3931
  else {
@@ -3932,12 +3933,15 @@ class _DOMRenderer extends renderer._Renderer {
3932
3933
  styleElem.setAttribute('data-frosty-style', '');
3933
3934
  styleElem.textContent = this._tracked_style.css;
3934
3935
  if (this._server) {
3935
- this.__replaceChildren(this.document.head, [...this._tracked_head_children, styleElem]);
3936
+ this.__replaceChildren(head, [...this._tracked_head_children, styleElem]);
3936
3937
  }
3937
- else if (styleElem.parentNode !== this.document.head) {
3938
- this.document.head.appendChild(styleElem);
3938
+ else if (styleElem.parentNode !== head) {
3939
+ head.appendChild(styleElem);
3939
3940
  }
3940
3941
  }
3942
+ if (!this.document.head) {
3943
+ this.document.documentElement.insertBefore(head, this.document.body);
3944
+ }
3941
3945
  }
3942
3946
  /** @internal */
3943
3947
  _createElement(node, stack) {
@@ -4142,4 +4146,4 @@ class _DOMRenderer extends renderer._Renderer {
4142
4146
 
4143
4147
  exports.DOMNativeNode = DOMNativeNode;
4144
4148
  exports._DOMRenderer = _DOMRenderer;
4145
- //# sourceMappingURL=common-Da9gnaMF.js.map
4149
+ //# sourceMappingURL=common-P5AZ4-Yt.js.map