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
This commit is contained in:
Eoghan Murray
2026-04-01 12:00:00 +08:00
committed by GitHub
parent e4b48fbc2b
commit 95b1497d3a

View File

@@ -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
}
}