diff --git a/lib/CSSStyleDeclaration.js b/lib/CSSStyleDeclaration.js index a451cf9e..6d430623 100644 --- a/lib/CSSStyleDeclaration.js +++ b/lib/CSSStyleDeclaration.js @@ -391,7 +391,7 @@ Object.defineProperties(CSSStyleDeclaration.prototype, { return; } let originalText = ""; - if (typeof this._onChange === "function") { + if (typeof this._onChange === "function" && !this._setInProgress) { originalText = this.cssText; } if (this._values.has(property)) { @@ -414,8 +414,8 @@ Object.defineProperties(CSSStyleDeclaration.prototype, { this._values.set(property, val); if ( typeof this._onChange === "function" && - this.cssText !== originalText && - !this._setInProgress + !this._setInProgress && + this.cssText !== originalText ) { this._onChange(this.cssText); }