chpwd.js: Only update DOM properties if they're actually going to change.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 15 May 2020 17:00:06 +0000 (18:00 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 16 May 2020 09:53:32 +0000 (10:53 +0100)
commit245db33989f02513293b162695fac2114141bdc0
tree38dade3a1f2de0e79e084045bc95209609f2f35d
parent99ed4b3f1e1c687f915a98aa01bcf9703d30d641
chpwd.js: Only update DOM properties if they're actually going to change.

This might have a significant effect on the background-friendliness of
the validation machinery.  Certainly, if I open Firefox's developer
tools, I used to see the various `whinge' elements highlighted as
changing all the time, which was rather distracting if nothing else, and
probably meant that DOM change-handling machinery was being engaged in
order to do nothing of any use.

Introduce a new function `update' which changes an object property only
if its value would actually change, and use this in the `check'
function.
chpwd.js