From cc5e9870d1a801e33135e4234b16ce5fab0f5f64 Mon Sep 17 00:00:00 2001 From: Eoghan Murray Date: Wed, 12 Apr 2023 17:20:16 +0100 Subject: [PATCH] The bare unattachedDoc that I previously naively created didn't have a doctype and wasn't a HTML document, so the child style element didn't have the `old.style` attribute available --- packages/rrweb/src/record/mutation.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rrweb/src/record/mutation.ts b/packages/rrweb/src/record/mutation.ts index 6784489ab2..febcb2f618 100644 --- a/packages/rrweb/src/record/mutation.ts +++ b/packages/rrweb/src/record/mutation.ts @@ -462,7 +462,7 @@ export default class MutationBuffer { if (isIgnored(m.target, this.mirror)) { return; } - const unattachedDoc = new Document(); // avoid upsetting original document from a Content Security point of view + const unattachedDoc = document.implementation.createHTMLDocument(); // avoid upsetting original document from a Content Security point of view switch (m.type) { case 'characterData': { const value = m.target.textContent;