jsdom / cssstyle

A Node.js implementation of the CSS Object Model CSSStyleDeclaration interface
MIT License
107 stars 70 forks source link

fix: skip onchange callback if serialized value did not change #147

Closed just-boris closed 8 months ago

just-boris commented 2 years ago

fixes jsdom/jsdom#3305

According to the spec, setting a css declaration "must return true if the serialization of declarations was changed as result of the steps. It may return false otherwise". This information is used when calling setProperty, "if updated is true, update style attribute for the CSS declaration block."

At the same time for cssText property, there are no conditions for setting the new value