@posthog/rrweb-record 0.0.33 → 0.0.34

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.
@@ -879,6 +879,7 @@ function hrefFrom(n2) {
879
879
  return n2.href;
880
880
  }
881
881
  function serializeElementNode(n2, options) {
882
+ var _a2, _b;
882
883
  const {
883
884
  doc,
884
885
  blockClass,
@@ -1052,11 +1053,13 @@ function serializeElementNode(n2, options) {
1052
1053
  }
1053
1054
  }
1054
1055
  if (needBlock) {
1055
- const { width, height } = n2.getBoundingClientRect();
1056
+ const { width, height, left, top } = n2.getBoundingClientRect();
1056
1057
  attributes = {
1057
1058
  class: attributes.class,
1058
1059
  rr_width: `${width}px`,
1059
- rr_height: `${height}px`
1060
+ rr_height: `${height}px`,
1061
+ rr_left: `${Math.floor(left + (((_a2 = doc.defaultView) == null ? void 0 : _a2.scrollX) || 0))}px`,
1062
+ rr_top: `${Math.floor(top + (((_b = doc.defaultView) == null ? void 0 : _b.scrollY) || 0))}px`
1060
1063
  };
1061
1064
  }
1062
1065
  if (tagName === "iframe" && !keepIframeSrcFn(attributes.src)) {