Closed cronon closed 6 years ago
Spec says to call it even when the value hasn't changed.
same input, same output ... please tell me why you want this.
Indeed, if you set the same attribute node twice in Chrome, nothing happens.
This polyfill has been around for many years and I don't feel like this change woud benefit anyone, quite the opposite, it would slow down every project that trusted same attribute wouldn't trigger twice the same callback, which is a very easy and safe guards against infinite dispatched events /changes loops.
Currently this callback is called only when the value of the attribute has changed. Spec says to call it even when the value hasn't changed. https://www.w3.org/TR/custom-elements/#concept-element-attributes-change https://bugs.chromium.org/p/chromium/issues/detail?id=676247
This also might cause issue with IE11 when attributeChangedCallback is not called when removing empty attribute
https://jsfiddle.net/cj1dhv7g/4/
Expected output (as in FF and Chrome):
Actual output in IE: