From c98b1eba244e5ac62a671dba9ae00de5ebfc3f5d Mon Sep 17 00:00:00 2001 From: Eoghan Murray Date: Tue, 13 Jul 2021 17:31:02 +0100 Subject: [PATCH 1/2] My best interpretation of what the typings should look like after merge of #464 --- src/record/mutation.ts | 15 ++++++++++----- src/replay/index.ts | 18 ++++++++++++------ src/types.ts | 4 +++- typings/types.d.ts | 8 ++++++-- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/src/record/mutation.ts b/src/record/mutation.ts index 2344265c27..7b093ee9a3 100644 --- a/src/record/mutation.ts +++ b/src/record/mutation.ts @@ -28,6 +28,7 @@ import { isIgnored, isIframeINode, hasShadowRoot, + styleAttributeValue, } from '../utils'; import { IframeManager } from './iframe-manager'; import { ShadowDomManager } from './shadow-dom-manager'; @@ -475,10 +476,14 @@ export default class MutationBuffer { } if (m.attributeName === 'style') { const old = this.doc.createElement('span'); - old.setAttribute('style', m.oldValue); - if (item.attributes['style'] === undefined) { + if (m.oldValue) { + old.setAttribute('style', m.oldValue); + } + if (item.attributes['style'] === undefined || + item.attributes['style'] === null) { item.attributes['style'] = {}; } + const style_obj = (item.attributes['style'] as styleAttributeValue); for (let i=0; i Date: Wed, 14 Jul 2021 22:27:53 +0100 Subject: [PATCH 2/2] Apply variable name changes as per Juice10 review Co-authored-by: Justin Halsall --- src/record/mutation.ts | 8 ++++---- src/replay/index.ts | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/record/mutation.ts b/src/record/mutation.ts index 7b093ee9a3..b924fc9720 100644 --- a/src/record/mutation.ts +++ b/src/record/mutation.ts @@ -483,7 +483,7 @@ export default class MutationBuffer { item.attributes['style'] === null) { item.attributes['style'] = {}; } - const style_obj = (item.attributes['style'] as styleAttributeValue); + const styleObj = (item.attributes['style'] as styleAttributeValue); for (let i=0; i