@posthog/rrweb 0.0.23 → 0.0.25

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.
package/dist/rrweb.js CHANGED
@@ -238,8 +238,8 @@ function stringifyStylesheet(s2) {
238
238
  return null;
239
239
  }
240
240
  let sheetHref = s2.href;
241
- if (!sheetHref && s2.ownerNode && s2.ownerNode.ownerDocument) {
242
- sheetHref = s2.ownerNode.ownerDocument.baseURI;
241
+ if (!sheetHref && s2.ownerNode) {
242
+ sheetHref = s2.ownerNode.baseURI;
243
243
  }
244
244
  const stringifiedRules = Array.from(
245
245
  rules2,
@@ -5640,6 +5640,12 @@ function buildNodeWithSN(n2, options) {
5640
5640
  } else {
5641
5641
  node2.appendChild(childNode);
5642
5642
  }
5643
+ } else if (n2.type === NodeType$1$1.Document && childN.type === NodeType$1$1.DocumentType) {
5644
+ if (node2.firstChild && node2.firstChild.nodeType === 1) {
5645
+ node2.insertBefore(childNode, node2.firstChild);
5646
+ } else {
5647
+ node2.appendChild(childNode);
5648
+ }
5643
5649
  } else {
5644
5650
  node2.appendChild(childNode);
5645
5651
  }
@@ -17468,12 +17474,13 @@ class Replayer {
17468
17474
  }
17469
17475
  }
17470
17476
  applyStyleDeclaration(data, styleSheet) {
17477
+ var _a2, _b;
17471
17478
  if (data.set) {
17472
17479
  const rule2 = getNestedRule(
17473
17480
  styleSheet.rules,
17474
17481
  data.index
17475
17482
  );
17476
- rule2.style.setProperty(
17483
+ (_a2 = rule2 == null ? void 0 : rule2.style) == null ? void 0 : _a2.setProperty(
17477
17484
  data.set.property,
17478
17485
  data.set.value,
17479
17486
  data.set.priority
@@ -17484,7 +17491,7 @@ class Replayer {
17484
17491
  styleSheet.rules,
17485
17492
  data.index
17486
17493
  );
17487
- rule2.style.removeProperty(data.remove.property);
17494
+ (_b = rule2 == null ? void 0 : rule2.style) == null ? void 0 : _b.removeProperty(data.remove.property);
17488
17495
  }
17489
17496
  }
17490
17497
  applyAdoptedStyleSheet(data) {