Skip to content

Commit

Permalink
Fix bug where style.opacity was incorrectly deleted when style.opacit…
Browse files Browse the repository at this point in the history
…y 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
  • Loading branch information
eoghanmurray authored Dec 9, 2021
1 parent ce9e97f commit ac592dc
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions packages/rrweb/src/record/mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit ac592dc

Please sign in to comment.