From 7d3e867be6f91aa5421b4c4fc9b966cdc11df368 Mon Sep 17 00:00:00 2001 From: champkeh Date: Fri, 24 Dec 2021 11:53:10 +0800 Subject: [PATCH] transform all style attribute value --- packages/rrweb/src/record/mutation.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/rrweb/src/record/mutation.ts b/packages/rrweb/src/record/mutation.ts index ed05b47ddd..a5df942ed5 100644 --- a/packages/rrweb/src/record/mutation.ts +++ b/packages/rrweb/src/record/mutation.ts @@ -496,10 +496,12 @@ export default class MutationBuffer { newValue !== old.style.getPropertyValue(pname) || newPriority !== old.style.getPropertyPriority(pname) ) { - if (pname === 'background-image') { - // tagName parameter use 'table' in order to call `absoluteToDoc` route internal - newValue = transformAttribute(this.doc, 'table', 'background', newValue) - } + newValue = transformAttribute( + this.doc, + (m.target as HTMLElement).tagName, + m.attributeName, + newValue, + ); if (newPriority === '') { styleObj[pname] = newValue; } else {