I noticed this when looking into perf in https://bugzilla.mozilla.org/show_bug.cgi?id=1448213. We occasionally hit a case where an attribute gets removed and then re-added with the same value: https://searchfox.org/mozilla-central/rev/8848b9741fc4ee4e9bc3ae83ea0fc048da39979f/intl/l10n/DOMLocalization.jsm#170-189. This can cause issues where, for instance, we underline an accesskey in a label, and then un-underline it, and then re-underline it to the same value.
I notice this happens on <button id="useCurrentBtn">
in about:preferences as an example.