From ac592dc537264dc7c8ce8572670113df76b7f179 Mon Sep 17 00:00:00 2001 From: Eoghan Murray Date: Thu, 9 Dec 2021 17:26:43 +0000 Subject: [PATCH] Fix bug where style.opacity was incorrectly deleted when style.opacity was set to zero (#765) - this had the effect of making things visible which should have been invisible - not sure what I was thinking with 'potentially non-standard browsers', maybe I thought I was covering return values from getPropertyValue of null or false. Could potentially add explicit tests for null or false, but as there is no evidence for these non-standard browsers, leaving as-is --- packages/rrweb/src/record/mutation.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/rrweb/src/record/mutation.ts b/packages/rrweb/src/record/mutation.ts index be6fe19b9d..924c58cd2c 100644 --- a/packages/rrweb/src/record/mutation.ts +++ b/packages/rrweb/src/record/mutation.ts @@ -504,10 +504,7 @@ export default class MutationBuffer { } } for (const pname of Array.from(old.style)) { - if ( - target.style.getPropertyValue(pname) === '' || - !target.style.getPropertyValue(pname) // covering potential non-standard browsers - ) { + if (target.style.getPropertyValue(pname) === '') { // "if not set, returns the empty string" styleObj[pname] = false; // delete } }